ucx/list.h

Thu, 11 Oct 2012 11:42:31 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 11 Oct 2012 11:42:31 +0200
changeset 67
27e67e725d35
parent 36
a9d656e4f7ce
child 87
bd444539cced
permissions
-rw-r--r--

added some qualifiers + removed pointer alias in mergesort

olaf@2 1 /*
olaf@2 2 *
olaf@2 3 */
olaf@2 4
olaf@2 5 #ifndef LIST_H
olaf@2 6 #define LIST_H
olaf@2 7
olaf@6 8 #include "ucx.h"
olaf@6 9 #include <stddef.h>
olaf@6 10
olaf@2 11 #ifdef __cplusplus
olaf@2 12 extern "C" {
olaf@2 13 #endif
universe@26 14
olaf@5 15 typedef struct UcxList UcxList;
olaf@5 16 struct UcxList {
olaf@5 17 void *data;
olaf@5 18 UcxList *next;
olaf@5 19 };
olaf@2 20
universe@67 21 UcxList *restrict ucx_list_clone(UcxList *restrict l,
universe@67 22 copy_func fnc, void *data);
universe@67 23 int ucx_list_equals(const UcxList *l1, const UcxList *l2,
universe@67 24 cmp_func fnc, void *data);
universe@18 25
olaf@12 26 void ucx_list_free(UcxList *l);
olaf@6 27 UcxList *ucx_list_append(UcxList *l, void *data);
olaf@6 28 UcxList *ucx_list_prepend(UcxList *l, void *data);
universe@67 29 UcxList *ucx_list_concat(UcxList *restrict l1, UcxList *restrict l2);
universe@67 30 UcxList *ucx_list_last(const UcxList *l);
universe@67 31 UcxList *ucx_list_get(const UcxList *l, int index);
universe@67 32 size_t ucx_list_size(const UcxList *l);
olaf@2 33
universe@36 34 UcxList *ucx_list_sort(UcxList *l, cmp_func fnc, void *data);
universe@35 35
universe@23 36 /* list specific functions */
universe@23 37 UcxList *ucx_list_remove(UcxList *l, UcxList *e);
olaf@2 38
olaf@2 39 #ifdef __cplusplus
olaf@2 40 }
olaf@2 41 #endif
olaf@2 42
olaf@2 43 #endif /* LIST_H */
olaf@2 44

mercurial