src/server/ucx/list.h

changeset 36
450d2d5f4735
parent 16
a9bbd82d2dce
child 71
069c152f6272
equal deleted inserted replaced
35:4417619a9bbd 36:450d2d5f4735
1 /* 1 /*
2 * 2 *
3 */ 3 */
4 4
5 #ifndef LIST_H 5 #ifndef LIST_H
6 #define LIST_H 6 #define LIST_H
7 7
9 #include <stddef.h> 9 #include <stddef.h>
10 10
11 #ifdef __cplusplus 11 #ifdef __cplusplus
12 extern "C" { 12 extern "C" {
13 #endif 13 #endif
14 14
15 typedef struct UcxList UcxList; 15 typedef struct UcxList UcxList;
16 struct UcxList { 16 struct UcxList {
17 void *data; 17 void *data;
18 UcxList *next; 18 UcxList *next;
19 }; 19 };
26 UcxList *ucx_list_prepend(UcxList *l, void *data); 26 UcxList *ucx_list_prepend(UcxList *l, void *data);
27 UcxList *ucx_list_concat(UcxList *l1, UcxList *l2); 27 UcxList *ucx_list_concat(UcxList *l1, UcxList *l2);
28 UcxList *ucx_list_last(UcxList *l); 28 UcxList *ucx_list_last(UcxList *l);
29 UcxList *ucx_list_get(UcxList *l, int index); 29 UcxList *ucx_list_get(UcxList *l, int index);
30 size_t ucx_list_size(UcxList *l); 30 size_t ucx_list_size(UcxList *l);
31 void ucx_list_foreach(UcxList *l, ucx_callback fnc, void *data); 31
32 UcxList *ucx_list_sort(UcxList *l, cmp_func fnc, void *data);
32 33
33 /* list specific functions */ 34 /* list specific functions */
34 UcxList *ucx_list_remove(UcxList *l, UcxList *e); 35 UcxList *ucx_list_remove(UcxList *l, UcxList *e);
35 36
36 #ifdef __cplusplus 37 #ifdef __cplusplus

mercurial