97 e = e->next; |
96 e = e->next; |
98 index--; |
97 index--; |
99 } |
98 } |
100 |
99 |
101 return (UcxDlist*)(index == 0 ? e : NULL); |
100 return (UcxDlist*)(index == 0 ? e : NULL); |
|
101 } |
|
102 |
|
103 int ucx_dlist_contains(UcxDlist *l, void *elem, cmp_func fnc, void *cmpdata) { |
|
104 UCX_FOREACH(UcxDlist*, l, e) { |
|
105 if (!fnc(elem, e->data, cmpdata)) { |
|
106 return 1; |
|
107 } |
|
108 } |
|
109 return 0; |
102 } |
110 } |
103 |
111 |
104 size_t ucx_dlist_size(const UcxDlist *l) { |
112 size_t ucx_dlist_size(const UcxDlist *l) { |
105 if (l == NULL) return 0; |
113 if (l == NULL) return 0; |
106 |
114 |