ucx/list.h

changeset 6
50b5fe7c577f
parent 5
a1740117e2b7
child 9
013c5c4b7e44
equal deleted inserted replaced
5:a1740117e2b7 6:50b5fe7c577f
2 * 2 *
3 */ 3 */
4 4
5 #ifndef LIST_H 5 #ifndef LIST_H
6 #define LIST_H 6 #define LIST_H
7
8 #include "ucx.h"
9 #include <stddef.h>
7 10
8 #ifdef __cplusplus 11 #ifdef __cplusplus
9 extern "C" { 12 extern "C" {
10 #endif 13 #endif
11 14
13 struct UcxList { 16 struct UcxList {
14 void *data; 17 void *data;
15 UcxList *next; 18 UcxList *next;
16 }; 19 };
17 20
18 UcxList *ucx_dlist_append(UcxList *l, void *data); 21 UcxList *ucx_list_append(UcxList *l, void *data);
19 UcxList *ucx_dlist_prepend(UcxList *l, void *data); 22 UcxList *ucx_list_prepend(UcxList *l, void *data);
20 UcxList *ucx_dlist_concat(UcxList *l1, UcxDlist *l2); 23 UcxList *ucx_list_concat(UcxList *l1, UcxDlist *l2);
21 UcxList *ucx_dlist_last(UcxList *l); 24 UcxList *ucx_list_last(UcxList *l);
22 UcxList *ucx_dlist_get(UcxList *l, int index); 25 UcxList *ucx_list_get(UcxList *l, int index);
23 size_t *ucx_dlist_size(UcxList *l); 26 size_t ucx_list_size(UcxList *l);
27 void ucx_list_foreach(UcxList *l, ucx_callback fnc, void *data);
24 28
25 29
26 #ifdef __cplusplus 30 #ifdef __cplusplus
27 } 31 }
28 #endif 32 #endif

mercurial