Lines Matching refs:list
50 * Inserts a new list element after the given one 'e'. If the given existing
51 * entry is NULL and the list already has elements, the new one will be
52 * inserted first in the list.
59 Curl_llist_insert_next(struct Curl_llist *list, struct Curl_llist_element *e,
64 if(list->size == 0) {
65 list->head = ne;
66 list->head->prev = NULL;
67 list->head->next = NULL;
68 list->tail = ne;
71 /* if 'e' is NULL here, we insert the new element first in the list */
72 ne->next = e?e->next:list->head;
75 list->head->prev = ne;
76 list->head = ne;
82 list->tail = ne;
88 ++list->size;
95 Curl_llist_remove(struct Curl_llist *list, struct Curl_llist_element *e,
99 if(!e || list->size == 0)
102 if(e == list->head) {
103 list->head = e->next;
105 if(!list->head)
106 list->tail = NULL;
115 list->tail = e->prev;
126 --list->size;
129 if(list->dtor)
130 list->dtor(user, ptr);
134 Curl_llist_destroy(struct Curl_llist *list, void *user)
136 if(list) {
137 while(list->size > 0)
138 Curl_llist_remove(list, list->tail, user);
143 Curl_llist_count(struct Curl_llist *list)
145 return list->size;