• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/zebra/lib/

Lines Matching refs:list

1 /* Generic linked list routine.
28 /* Allocate new list. */
29 struct list *
32 struct list *new;
34 new = XMALLOC (MTYPE_LINK_LIST, sizeof (struct list));
35 memset (new, 0, sizeof (struct list));
39 /* Free list. */
41 list_free (struct list *l)
65 /* Add new data to the list. */
67 listnode_add (struct list *list, void *val)
73 node->prev = list->tail;
76 if (list->head == NULL)
77 list->head = node;
79 list->tail->next = node;
80 list->tail = node;
82 list->count++;
87 listnode_add_sort (struct list *list, void *val)
95 if (list->cmp)
97 for (n = list->head; n; n = n->next)
99 if ((*list->cmp) (val, n->data) < 0)
107 list->head = new;
109 list->count++;
115 new->prev = list->tail;
117 if (list->tail)
118 list->tail->next = new;
120 list->head = new;
122 list->tail = new;
123 list->count++;
127 listnode_add_after (struct list *list, struct listnode *pp, void *val)
136 if (list->head)
137 list->head->prev = nn;
139 list->tail = nn;
141 nn->next = list->head;
144 list->head = nn;
151 list->tail = nn;
161 /* Delete specific date pointer from the list. */
163 listnode_delete (struct list *list, void *val)
167 for (node = list->head; node; node = node->next)
174 list->head = node->next;
179 list->tail = node->prev;
181 list->count--;
190 listnode_head (struct list *list)
194 node = list->head;
201 /* Delete all listnode from the list. */
203 list_delete_all_node (struct list *list)
208 for (node = list->head; node; node = next)
211 if (list->del)
212 (*list->del) (node->data);
215 list->head = list->tail = NULL;
216 list->count = 0;
219 /* Delete all listnode then free list itself. */
221 list_delete (struct list *list)
226 for (node = list->head; node; node = next)
229 if (list->del)
230 (*list->del) (node->data);
233 list_free (list);
238 listnode_lookup (struct list *list, void *data)
242 for (node = list->head; node; nextnode (node))
249 /* Delete the node from list. For ospfd and ospf6d. */
251 list_delete_node (list list, listnode node)
256 list->head = node->next;
260 list->tail = node->prev;
261 list->count--;
268 list_add_node_prev (list list, listnode current, void *val)
277 list->head = node;
284 list->count++;
289 list_add_node_next (list list, listnode current, void *val)
298 list->tail = node;
305 list->count++;
310 list_add_list (struct list *l, struct list *m)