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 |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ucx/dlist.c Sat Dec 31 17:52:26 2011 +0100 1.3 @@ -0,0 +1,2 @@ 1.4 +#include "dlist.h" 1.5 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/ucx/dlist.h Sat Dec 31 17:52:26 2011 +0100 2.3 @@ -0,0 +1,36 @@ 2.4 +/* 2.5 + * 2.6 + */ 2.7 + 2.8 +#include <stddef.h> 2.9 + 2.10 +#ifndef DLIST_H 2.11 +#define DLIST_H 2.12 + 2.13 +#ifdef __cplusplus 2.14 +extern "C" { 2.15 +#endif 2.16 + 2.17 +typedef struct UcxDlist UcxDlist; 2.18 +struct UcxDlist { 2.19 + void *data; 2.20 + UcxDlist *next; 2.21 + UcxDlist *prev; 2.22 +}; 2.23 + 2.24 +UcxDlist *ucx_dlist_append(UcxDlist *l, void *data); 2.25 +UcxDlist *ucx_dlist_prepend(UcxDlist *l, void *data); 2.26 +UcxDlist *ucx_dlist_concat(UcxDlist *l1, UcxDlist *l2); 2.27 +UcxDlist *ucx_dlist_last(UcxDlist *l); 2.28 +UcxDlist *ucx_dlist_get(UcxDlist *l, int index); 2.29 +size_t *ucx_dlist_size(UcxDlist *l); 2.30 + 2.31 +/* dlist specific functions */ 2.32 +UcxDlist *ucx_dlist_first(UcxDlist *l); 2.33 + 2.34 +#ifdef __cplusplus 2.35 +} 2.36 +#endif 2.37 + 2.38 +#endif /* DLIST_H */ 2.39 +