Lines Matching refs:item
44 items, you must remember that each item passed back to your
45 DELETE function will be a boxed item that must be slist_unbox()ed
48 e.g. void boxed_delete (void *item) { item_free (slist_unbox (item)); }
54 slist_delete (SList *head, void (*delete_fct) (void *item))
68 /* Call FIND repeatedly with MATCHDATA and each item of *PHEAD, until
70 the matching item is destructively removed from *PHEAD, and the value
74 the stale item, you should probably return that from FIND if
76 every item in a boxed list before operating on its contents. */
168 slist_cons (SList *item, SList *slist)
170 if (!item)
175 assert (!item->next);
177 item->next = slist;
178 return item;
181 /* Return a list starting at the second item of SLIST. */
188 /* Return a list starting at the Nth item of SLIST. If SLIST is less
239 /* Call FOREACH once for each item in SLIST, passing both the item and
267 At each iteration, add another item to the merged list by taking the
268 lowest valued item from the head of either LEFT or RIGHT, determined
314 /* Be sure that LEFT and RIGHT never contain the same item. */
342 that case, so there is no need for a NEXT field in the item proper.
343 Some care must be taken to slist_box and slist_unbox each item in
353 SList *item = (SList *) malloc (sizeof *item);
355 if (item)
357 item->next = 0;
358 item->userdata = userdata;
361 return item;
366 slist_unbox (SList *item)
370 if (item)
374 userdata = (void *) item->userdata;
375 free (item);