ucx/dlist.c

Sat, 31 Dec 2011 18:18:03 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 31 Dec 2011 18:18:03 +0100
changeset 7
68091406d1cf
parent 4
dbc31727b38e
child 8
9cd2b2460db0
permissions
-rw-r--r--

added dlist to makefile, implemented first functions, discarded some fails

     1 #include "dlist.h"
     3 UcxDlist *ucx_dlist_append(UcxDlist *l, void *data)  {
     5 }
     7 UcxDlist *ucx_dlist_prepend(UcxDlist *l, void *data) {
     9 }
    11 UcxDlist *ucx_dlist_concat(UcxDlist *l1, UcxDlist *l2) {
    13 }
    15 UcxDlist *ucx_dlist_last(UcxDlist *l) {
    16     if (l == NULL) return NULL;
    18     UcxDlist *e = l;
    19     while (e->next != NULL) {
    20         e = e->next;
    21     }
    22     return e;
    23 }
    25 UcxDlist *ucx_dlist_get(UcxDlist *l, int index) {
    27 }
    29 size_t ucx_dlist_size(UcxDlist *l) {
    30     if (l == NULL) return 0;
    32     UcxDlist *e = l;
    33     size_t s = 1;
    34     while (e->next != NULL) {
    35         e = e->next;
    36         s++;
    37     }
    39     return s;
    40 }
    42 void ucx_dlist_foreach(UcxDlist *l, ucx_callback fnc, void* data) {
    44 }
    46 /* dlist specific functions */
    47 UcxDlist *ucx_dlist_first(UcxDlist *l) {
    49 }

mercurial