Lines Matching refs:ilist

29 static void int_node__delete(struct int_node *ilist)  in int_node__delete()  argument
31 free(ilist); in int_node__delete()
50 int intlist__add(struct intlist *ilist, int i) in intlist__add() argument
52 return rblist__add_node(&ilist->rblist, (void *)((long)i)); in intlist__add()
55 void intlist__remove(struct intlist *ilist, struct int_node *node) in intlist__remove() argument
57 rblist__remove_node(&ilist->rblist, &node->rb_node); in intlist__remove()
60 static struct int_node *__intlist__findnew(struct intlist *ilist, in __intlist__findnew() argument
66 if (ilist == NULL) in __intlist__findnew()
70 rb_node = rblist__findnew(&ilist->rblist, (void *)((long)i)); in __intlist__findnew()
72 rb_node = rblist__find(&ilist->rblist, (void *)((long)i)); in __intlist__findnew()
80 struct int_node *intlist__find(struct intlist *ilist, int i) in intlist__find() argument
82 return __intlist__findnew(ilist, i, false); in intlist__find()
85 struct int_node *intlist__findnew(struct intlist *ilist, int i) in intlist__findnew() argument
87 return __intlist__findnew(ilist, i, true); in intlist__findnew()
90 static int intlist__parse_list(struct intlist *ilist, const char *s) in intlist__parse_list() argument
100 err = intlist__add(ilist, value); in intlist__parse_list()
111 struct intlist *ilist = malloc(sizeof(*ilist)); in intlist__new() local
113 if (ilist != NULL) { in intlist__new()
114 rblist__init(&ilist->rblist); in intlist__new()
115 ilist->rblist.node_cmp = intlist__node_cmp; in intlist__new()
116 ilist->rblist.node_new = intlist__node_new; in intlist__new()
117 ilist->rblist.node_delete = intlist__node_delete; in intlist__new()
119 if (slist && intlist__parse_list(ilist, slist)) in intlist__new()
123 return ilist; in intlist__new()
125 intlist__delete(ilist); in intlist__new()
129 void intlist__delete(struct intlist *ilist) in intlist__delete() argument
131 if (ilist != NULL) in intlist__delete()
132 rblist__delete(&ilist->rblist); in intlist__delete()
135 struct int_node *intlist__entry(const struct intlist *ilist, unsigned int idx) in intlist__entry() argument
140 rb_node = rblist__entry(&ilist->rblist, idx); in intlist__entry()