llist: remove direct struct accesses, use only functions

- Turned them all into functions to also do asserts etc.

- The llist related structs got all their fields renamed in order to make
  sure no existing code remains using direct access.

- Each list node struct now points back to the list it "lives in", so
  Curl_node_remove() no longer needs the list pointer.

- Rename the node struct and some of the access functions.

- Added lots of ASSERTs to verify API being used correctly

- Fix some cases of API misuse

Add docs/LLIST.md documenting the internal linked list API.

Closes #14485
This commit is contained in:
Daniel Stenberg 2024-08-10 23:27:25 +02:00
parent 6f00a05e89
commit ba235ab269
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
27 changed files with 725 additions and 428 deletions

View file

@ -28,7 +28,7 @@
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_HEADERS_API)
struct Curl_header_store {
struct Curl_llist_element node;
struct Curl_llist_node node;
char *name; /* points into 'buffer' */
char *value; /* points into 'buffer */
int request; /* 0 is the first request, then 1.. 2.. */