ucx/dlist.c

changeset 7
68091406d1cf
parent 4
dbc31727b38e
child 8
9cd2b2460db0
equal deleted inserted replaced
6:50b5fe7c577f 7:68091406d1cf
1 #include "dlist.h" 1 #include "dlist.h"
2 2
3 UcxDlist *ucx_dlist_append(UcxDlist *l, void *data) {
4
5 }
6
7 UcxDlist *ucx_dlist_prepend(UcxDlist *l, void *data) {
8
9 }
10
11 UcxDlist *ucx_dlist_concat(UcxDlist *l1, UcxDlist *l2) {
12
13 }
14
15 UcxDlist *ucx_dlist_last(UcxDlist *l) {
16 if (l == NULL) return NULL;
17
18 UcxDlist *e = l;
19 while (e->next != NULL) {
20 e = e->next;
21 }
22 return e;
23 }
24
25 UcxDlist *ucx_dlist_get(UcxDlist *l, int index) {
26
27 }
28
29 size_t ucx_dlist_size(UcxDlist *l) {
30 if (l == NULL) return 0;
31
32 UcxDlist *e = l;
33 size_t s = 1;
34 while (e->next != NULL) {
35 e = e->next;
36 s++;
37 }
38
39 return s;
40 }
41
42 void ucx_dlist_foreach(UcxDlist *l, ucx_callback fnc, void* data) {
43
44 }
45
46 /* dlist specific functions */
47 UcxDlist *ucx_dlist_first(UcxDlist *l) {
48
49 }

mercurial