127 |
127 |
128 return (UcxDlist*)(index == 0 ? e : NULL); |
128 return (UcxDlist*)(index == 0 ? e : NULL); |
129 } |
129 } |
130 |
130 |
131 int ucx_dlist_contains(UcxDlist *l, void *elem, cmp_func fnc, void *cmpdata) { |
131 int ucx_dlist_contains(UcxDlist *l, void *elem, cmp_func fnc, void *cmpdata) { |
132 UCX_FOREACH(UcxDlist*, l, e) { |
132 UCX_FOREACH(l, e) { |
133 if (!fnc(elem, e->data, cmpdata)) { |
133 if (!fnc(elem, e->data, cmpdata)) { |
134 return 1; |
134 return 1; |
135 } |
135 } |
136 } |
136 } |
137 return 0; |
137 return 0; |