Sat, 31 Dec 2011 18:18:03 +0100
added dlist to makefile, implemented first functions, discarded some fails
universe@4 | 1 | #include "dlist.h" |
universe@4 | 2 | |
universe@7 | 3 | UcxDlist *ucx_dlist_append(UcxDlist *l, void *data) { |
universe@7 | 4 | |
universe@7 | 5 | } |
universe@7 | 6 | |
universe@7 | 7 | UcxDlist *ucx_dlist_prepend(UcxDlist *l, void *data) { |
universe@7 | 8 | |
universe@7 | 9 | } |
universe@7 | 10 | |
universe@7 | 11 | UcxDlist *ucx_dlist_concat(UcxDlist *l1, UcxDlist *l2) { |
universe@7 | 12 | |
universe@7 | 13 | } |
universe@7 | 14 | |
universe@7 | 15 | UcxDlist *ucx_dlist_last(UcxDlist *l) { |
universe@7 | 16 | if (l == NULL) return NULL; |
universe@7 | 17 | |
universe@7 | 18 | UcxDlist *e = l; |
universe@7 | 19 | while (e->next != NULL) { |
universe@7 | 20 | e = e->next; |
universe@7 | 21 | } |
universe@7 | 22 | return e; |
universe@7 | 23 | } |
universe@7 | 24 | |
universe@7 | 25 | UcxDlist *ucx_dlist_get(UcxDlist *l, int index) { |
universe@7 | 26 | |
universe@7 | 27 | } |
universe@7 | 28 | |
universe@7 | 29 | size_t ucx_dlist_size(UcxDlist *l) { |
universe@7 | 30 | if (l == NULL) return 0; |
universe@7 | 31 | |
universe@7 | 32 | UcxDlist *e = l; |
universe@7 | 33 | size_t s = 1; |
universe@7 | 34 | while (e->next != NULL) { |
universe@7 | 35 | e = e->next; |
universe@7 | 36 | s++; |
universe@7 | 37 | } |
universe@7 | 38 | |
universe@7 | 39 | return s; |
universe@7 | 40 | } |
universe@7 | 41 | |
universe@7 | 42 | void ucx_dlist_foreach(UcxDlist *l, ucx_callback fnc, void* data) { |
universe@7 | 43 | |
universe@7 | 44 | } |
universe@7 | 45 | |
universe@7 | 46 | /* dlist specific functions */ |
universe@7 | 47 | UcxDlist *ucx_dlist_first(UcxDlist *l) { |
universe@7 | 48 | |
universe@7 | 49 | } |