42 #ifdef __cplusplus |
42 #ifdef __cplusplus |
43 extern "C" { |
43 extern "C" { |
44 #endif |
44 #endif |
45 |
45 |
46 /** |
46 /** |
|
47 * Meta data for a linked list. |
|
48 */ |
|
49 typedef struct cx_linked_list_s { |
|
50 /** Base members. */ |
|
51 struct cx_list_s base; |
|
52 /** |
|
53 * Location of the prev pointer (mandatory). |
|
54 */ |
|
55 off_t loc_prev; |
|
56 /** |
|
57 * Location of the next pointer (mandatory). |
|
58 */ |
|
59 off_t loc_next; |
|
60 /** |
|
61 * Location of the payload (mandatory). |
|
62 */ |
|
63 off_t loc_data; |
|
64 /** |
|
65 * Additional bytes to allocate @em behind the payload (e.g. for metadata). |
|
66 */ |
|
67 size_t extra_data_len; |
|
68 /** |
|
69 * Pointer to the first node. |
|
70 */ |
|
71 void *begin; |
|
72 /** |
|
73 * Pointer to the last node. |
|
74 */ |
|
75 void *end; |
|
76 } cx_linked_list; |
|
77 |
|
78 /** |
47 * Allocates a linked list for storing elements with @p elem_size bytes each. |
79 * Allocates a linked list for storing elements with @p elem_size bytes each. |
48 * |
80 * |
49 * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
81 * If @p elem_size is #CX_STORE_POINTERS, the created list stores pointers instead of |
50 * copies of the added elements and the compare function will be automatically set |
82 * copies of the added elements and the compare function will be automatically set |
51 * to cx_cmp_ptr(), if none is given. |
83 * to cx_cmp_ptr(), if none is given. |