Sat, 31 Dec 2011 17:52:26 +0100
added dlist specification
ucx/dlist.c | file | annotate | diff | comparison | revisions | |
ucx/dlist.h | file | annotate | diff | comparison | revisions |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ucx/dlist.c Sat Dec 31 17:52:26 2011 +0100 @@ -0,0 +1,2 @@ +#include "dlist.h" +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ucx/dlist.h Sat Dec 31 17:52:26 2011 +0100 @@ -0,0 +1,36 @@ +/* + * + */ + +#include <stddef.h> + +#ifndef DLIST_H +#define DLIST_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct UcxDlist UcxDlist; +struct UcxDlist { + void *data; + UcxDlist *next; + UcxDlist *prev; +}; + +UcxDlist *ucx_dlist_append(UcxDlist *l, void *data); +UcxDlist *ucx_dlist_prepend(UcxDlist *l, void *data); +UcxDlist *ucx_dlist_concat(UcxDlist *l1, UcxDlist *l2); +UcxDlist *ucx_dlist_last(UcxDlist *l); +UcxDlist *ucx_dlist_get(UcxDlist *l, int index); +size_t *ucx_dlist_size(UcxDlist *l); + +/* dlist specific functions */ +UcxDlist *ucx_dlist_first(UcxDlist *l); + +#ifdef __cplusplus +} +#endif + +#endif /* DLIST_H */ +