• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:list

2  * Copyright © 2008-2011 Kristian Høgsberg
4 * Copyright © 2013-2015 Red Hat, Inc.
32 #include "util-list.h"
35 list_init(struct list *list) in list_init() argument
37 list->prev = list; in list_init()
38 list->next = list; in list_init()
42 list_insert(struct list *list, struct list *elm) in list_insert() argument
44 assert((list->next != NULL && list->prev != NULL) || in list_insert()
45 !"list->next|prev is NULL, possibly missing list_init()"); in list_insert()
46 assert(((elm->next == NULL && elm->prev == NULL) || list_empty(elm)) || in list_insert()
47 !"elm->next|prev is not NULL, list node used twice?"); in list_insert()
49 elm->prev = list; in list_insert()
50 elm->next = list->next; in list_insert()
51 list->next = elm; in list_insert()
52 elm->next->prev = elm; in list_insert()
56 list_append(struct list *list, struct list *elm) in list_append() argument
58 assert((list->next != NULL && list->prev != NULL) || in list_append()
59 !"list->next|prev is NULL, possibly missing list_init()"); in list_append()
60 assert(((elm->next == NULL && elm->prev == NULL) || list_empty(elm)) || in list_append()
61 !"elm->next|prev is not NULL, list node used twice?"); in list_append()
63 elm->next = list; in list_append()
64 elm->prev = list->prev; in list_append()
65 list->prev = elm; in list_append()
66 elm->prev->next = elm; in list_append()
70 list_remove(struct list *elm) in list_remove()
72 assert((elm->next != NULL && elm->prev != NULL) || in list_remove()
73 !"list->next|prev is NULL, possibly missing list_init()"); in list_remove()
75 elm->prev->next = elm->next; in list_remove()
76 elm->next->prev = elm->prev; in list_remove()
77 elm->next = NULL; in list_remove()
78 elm->prev = NULL; in list_remove()
82 list_empty(const struct list *list) in list_empty() argument
84 assert((list->next != NULL && list->prev != NULL) || in list_empty()
85 !"list->next|prev is NULL, possibly missing list_init()"); in list_empty()
87 return list->next == list; in list_empty()
91 list_is_last(const struct list *list, const struct list *elm) in list_is_last() argument
93 return elm->next == list; in list_is_last()