diff -r 0f94d369bb02 -r 1bcaac272cdf ucx/list.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ucx/list.h Fri Nov 30 21:18:13 2012 +0100 @@ -0,0 +1,44 @@ +/* + * + */ + +#ifndef LIST_H +#define LIST_H + +#include "ucx.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct UcxList UcxList; +struct UcxList { + void *data; + UcxList *next; +}; + +UcxList *restrict ucx_list_clone(UcxList *restrict l, + copy_func fnc, void *data); +int ucx_list_equals(const UcxList *l1, const UcxList *l2, + cmp_func fnc, void *data); + +void ucx_list_free(UcxList *l); +UcxList *ucx_list_append(UcxList *l, void *data); +UcxList *ucx_list_prepend(UcxList *l, void *data); +UcxList *ucx_list_concat(UcxList *restrict l1, UcxList *restrict l2); +UcxList *ucx_list_last(const UcxList *l); +UcxList *ucx_list_get(const UcxList *l, int index); +size_t ucx_list_size(const UcxList *l); + +UcxList *ucx_list_sort(UcxList *l, cmp_func fnc, void *data); + +/* list specific functions */ +UcxList *ucx_list_remove(UcxList *l, UcxList *e); + +#ifdef __cplusplus +} +#endif + +#endif /* LIST_H */ +