ucx/dlist.c

changeset 7
68091406d1cf
parent 4
dbc31727b38e
child 8
9cd2b2460db0
     1.1 --- a/ucx/dlist.c	Sat Dec 31 18:04:28 2011 +0100
     1.2 +++ b/ucx/dlist.c	Sat Dec 31 18:18:03 2011 +0100
     1.3 @@ -1,2 +1,49 @@
     1.4  #include "dlist.h"
     1.5  
     1.6 +UcxDlist *ucx_dlist_append(UcxDlist *l, void *data)  {
     1.7 +    
     1.8 +}
     1.9 +
    1.10 +UcxDlist *ucx_dlist_prepend(UcxDlist *l, void *data) {
    1.11 +    
    1.12 +}
    1.13 +
    1.14 +UcxDlist *ucx_dlist_concat(UcxDlist *l1, UcxDlist *l2) {
    1.15 +    
    1.16 +}
    1.17 +
    1.18 +UcxDlist *ucx_dlist_last(UcxDlist *l) {
    1.19 +    if (l == NULL) return NULL;
    1.20 +    
    1.21 +    UcxDlist *e = l;
    1.22 +    while (e->next != NULL) {
    1.23 +        e = e->next;
    1.24 +    }
    1.25 +    return e;
    1.26 +}
    1.27 +
    1.28 +UcxDlist *ucx_dlist_get(UcxDlist *l, int index) {
    1.29 +    
    1.30 +}
    1.31 +
    1.32 +size_t ucx_dlist_size(UcxDlist *l) {
    1.33 +    if (l == NULL) return 0;
    1.34 +    
    1.35 +    UcxDlist *e = l;
    1.36 +    size_t s = 1;
    1.37 +    while (e->next != NULL) {
    1.38 +        e = e->next;
    1.39 +        s++;
    1.40 +    }
    1.41 +
    1.42 +    return s;
    1.43 +}
    1.44 +
    1.45 +void ucx_dlist_foreach(UcxDlist *l, ucx_callback fnc, void* data) {
    1.46 +    
    1.47 +}
    1.48 +
    1.49 +/* dlist specific functions */
    1.50 +UcxDlist *ucx_dlist_first(UcxDlist *l) {
    1.51 +    
    1.52 +}
    1.53 \ No newline at end of file

mercurial