src/cx/linked_list.h

changeset 1532
313fd460d264
parent 1426
3a89b31f0724
equal deleted inserted replaced
1531:3ee5a5c7823a 1532:313fd460d264
60 /** 60 /**
61 * Location of the payload (mandatory). 61 * Location of the payload (mandatory).
62 */ 62 */
63 off_t loc_data; 63 off_t loc_data;
64 /** 64 /**
65 * Location of extra data (optional).
66 * Negative when no extra data is requested.
67 * @see cx_linked_list_extra_data()
68 */
69 off_t loc_extra;
70 /**
65 * Additional bytes to allocate @em behind the payload (e.g. for metadata). 71 * Additional bytes to allocate @em behind the payload (e.g. for metadata).
72 * @see cx_linked_list_extra_data()
66 */ 73 */
67 size_t extra_data_len; 74 size_t extra_data_len;
68 /** 75 /**
69 * Pointer to the first node. 76 * Pointer to the first node.
70 */ 77 */
108 * @param elem_size (@c size_t) the size of each element in bytes 115 * @param elem_size (@c size_t) the size of each element in bytes
109 * @return (@c CxList*) the created list 116 * @return (@c CxList*) the created list
110 */ 117 */
111 #define cxLinkedListCreateSimple(elem_size) \ 118 #define cxLinkedListCreateSimple(elem_size) \
112 cxLinkedListCreate(NULL, NULL, elem_size) 119 cxLinkedListCreate(NULL, NULL, elem_size)
120
121 /**
122 * Instructs the linked list to reserve extra data in each node.
123 *
124 * The extra data will be aligned and placed behind the element data.
125 * The exact location in the node is stored in the @c loc_extra field
126 * of the linked list.
127 *
128 * You should usually not use this function except when you are creating an
129 * own linked-list implementation that is based on the UCX linked list and
130 * needs to store extra data in each node.
131 *
132 * @param list the list (must be a linked list)
133 * @param len the length of the extra data
134 */
135 cx_attr_nonnull
136 CX_EXPORT void cx_linked_list_extra_data(cx_linked_list *list, size_t len);
113 137
114 /** 138 /**
115 * Finds the node at a certain index. 139 * Finds the node at a certain index.
116 * 140 *
117 * This function can be used to start at an arbitrary position within the list. 141 * This function can be used to start at an arbitrary position within the list.

mercurial