Thu, 23 Jan 2025 20:19:03 +0100
add symbols that need documentation as TODOs
relates to #451
1141 | 1 | # linked_list.h |
2 | ||
3 | On top of implementing the list interface, this header also defines several low-level functions that | |
4 | work with arbitrary structures. | |
5 | Low-level functions, in contrast to the high-level list interface, can easily be recognized by their snake-casing. | |
6 | The function `cx_linked_list_at`, for example, implements a similar functionality like `cxListAt`, but operates | |
7 | on arbitrary structures. | |
8 | The following snippet shows how it is used. | |
9 | All other low-level functions work similarly. | |
10 | ```c | |
11 | struct node { | |
12 | node *next; | |
13 | node *prev; | |
14 | int data; | |
15 | }; | |
16 | ||
17 | const ptrdiff_t loc_prev = offsetof(struct node, prev); | |
18 | const ptrdiff_t loc_next = offsetof(struct node, next); | |
19 | const ptrdiff_t loc_data = offsetof(struct node, data); | |
20 | ||
21 | struct node a = {0}, b = {0}, c = {0}, d = {0}; | |
22 | cx_linked_list_link(&a, &b, loc_prev, loc_next); | |
23 | cx_linked_list_link(&b, &c, loc_prev, loc_next); | |
24 | cx_linked_list_link(&c, &d, loc_prev, loc_next); | |
25 | ||
26 | cx_linked_list_at(&a, 0, loc_next, 2); // returns pointer to c | |
27 | ``` | |
1142
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
28 | |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
29 | ## Undocumented Symbols (TODO) |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
30 | ### cx_linked_list_add |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
31 | ### cx_linked_list_at |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
32 | ### cx_linked_list_compare |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
33 | ### cxLinkedListCreate |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
34 | ### cx_linked_list_find |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
35 | ### cx_linked_list_find_node |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
36 | ### cx_linked_list_first |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
37 | ### cx_linked_list_insert |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
38 | ### cx_linked_list_insert_chain |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
39 | ### cx_linked_list_insert_sorted |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
40 | ### cx_linked_list_insert_sorted_chain |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
41 | ### cx_linked_list_last |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
42 | ### cx_linked_list_link |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
43 | ### cx_linked_list_prepend |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
44 | ### cx_linked_list_prev |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
45 | ### cx_linked_list_remove_chain |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
46 | ### cx_linked_list_reverse |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
47 | ### cx_linked_list_size |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
48 | ### cx_linked_list_sort |
9437530176bc
add symbols that need documentation as TODOs
Mike Becker <universe@uap-core.de>
parents:
1141
diff
changeset
|
49 | ### cx_linked_list_unlink |