Lines Matching refs:item

47  * determine if the list contains an item
60 * locate the item in the list that points at the object
80 * insert item into list in the desired order (ascending or descending)
84 * and item is the item to be inserted.
88 * if (ascending && compare(item, iter) <= 0 ||
89 * (descending && compare(item, iter) >= 0)
90 * item goes before iter
92 * item goes after iter
96 dlist_t *item,
107 head = item;
115 result = (compare)(item->obj, iter->obj);
121 head = item;
122 item->next = iter;
123 iter->prev = item;
125 item->prev = iter->prev;
126 item->prev->next = item;
127 iter->prev = item;
128 item->next = iter;
134 /* end of list, so item becomes the new end */
135 iter->next = item;
136 item->prev = iter;
146 * Remove the first node pointing to same content as item from list,
149 * The caller is responsible for freeing the removed item if it is no
158 * by an item in the list.
164 * the list containing the item to remove
167 * the object with which to compare each item
171 * of each item, to return 0 if item should be removed
174 * RETURN: the removed item, or NULL if none was found
185 dlist_t *item;
193 item = dlist_find(list, obj, compare);
194 if (item == NULL) {
198 *removed = item;
200 return (dlist_remove(item));
204 * Remove an item from its list. Return the resulting list.
206 * @param item
207 * the item to remove, with prev and next pointers
214 dlist_t *item)
218 if (item != NULL) {
219 if (item->next != NULL) {
220 item->next->prev = item->prev;
221 head = item->next;
224 if (item->prev != NULL) {
225 item->prev->next = item->next;
226 head = item->prev;
229 item->next = NULL;
230 item->prev = NULL;
240 * append item to list, either beginning or end
244 dlist_t *item,
252 head = item;
254 } else if (item == NULL) {
265 iter->next = item;
266 item->prev = iter;
270 item->next = head;
271 head->prev = item;
272 head = item;
303 dlist_t *item = dlist_new_item(object);
305 if (item == NULL) {
309 *list = dlist_append(item, *list, attail);
368 dlist_t *item = (dlist_t *)calloc(1, sizeof (dlist_t));
370 if (item != NULL) {
371 item->obj = obj;
374 return (item);
388 dlist_t *item = head;
392 freefunc(item->obj);
395 free((void *) item);
428 dlist_t *item;
437 for (item = list; item != NULL; ) {
440 /* Remove this item from the list */
441 list = dlist_remove(item);
446 categories[ncategories - 1] = item;
450 list, item->obj, compare, &removed);
452 /* Add removed item to category */
453 dlist_append(removed, item, AT_TAIL);
455 list, item->obj, compare, &removed);
458 item = list;
499 item = categories[curcat];
500 categories[curcat] = dlist_remove(item);
503 list = dlist_append(item, list, AT_TAIL);