ucx/list.c

changeset 27
22644e2572bc
parent 24
e04822101291
child 31
91ac86557290
equal deleted inserted replaced
26:59f147baea31 27:22644e2572bc
106 } 106 }
107 107
108 return s; 108 return s;
109 } 109 }
110 110
111 void ucx_list_foreach(UcxList *l, ucx_callback fnc, void* data) {
112 UcxList *e = l;
113 UcxList *n;
114 while (e != NULL) {
115 n = e->next;
116 fnc(e, data);
117 e = n;
118 }
119 }
120
121 /* list specific functions */ 111 /* list specific functions */
122 UcxList *ucx_list_remove(UcxList *l, UcxList *e) { 112 UcxList *ucx_list_remove(UcxList *l, UcxList *e) {
123 if (e == l) { 113 if (e == l) {
124 l = e->next; 114 l = e->next;
125 free(e); 115 free(e);

mercurial