src/cx/list.h

changeset 519
79d14e821b3a
parent 508
8aea65ae1eaf
child 524
e98b09018d32
equal deleted inserted replaced
518:74d0372f5c6f 519:79d14e821b3a
201 * @param list_autofree a flag indicating, if the list allocator shall free the list, if the destructor did not do that 201 * @param list_autofree a flag indicating, if the list allocator shall free the list, if the destructor did not do that
202 * @param content_autofree a flag indicating, if the list allocator shall free an element, 202 * @param content_autofree a flag indicating, if the list allocator shall free an element,
203 * if the content destructor did not do that or no content destructor exists 203 * if the content destructor did not do that or no content destructor exists
204 */ 204 */
205 __attribute__((__nonnull__(1))) 205 __attribute__((__nonnull__(1)))
206 static inline void cxListMemoryMgmt( 206 void cxListMemoryMgmt(
207 CxList *list, 207 CxList *list,
208 cx_destructor_func list_destructor, 208 cx_destructor_func list_destructor,
209 cx_destructor_func content_destructor, 209 cx_destructor_func content_destructor,
210 bool list_autofree, 210 bool list_autofree,
211 bool content_autofree 211 bool content_autofree
212 ) { 212 );
213 if (list_destructor != NULL) list->list_destructor = list_destructor;
214 list->content_destructor = content_destructor;
215 list->autofree = list_autofree;
216 list->autofree_contents = content_autofree;
217 }
218 213
219 /** 214 /**
220 * Adds an item to the end of the list. 215 * Adds an item to the end of the list.
221 * 216 *
222 * @param list the list 217 * @param list the list

mercurial