ucx/list.h

Mon, 25 Feb 2013 16:26:50 +0100

author
Mike Becker <universe@uap-core.de>
date
Mon, 25 Feb 2013 16:26:50 +0100
changeset 87
bd444539cced
parent 67
27e67e725d35
child 93
a6a99e721660
permissions
-rw-r--r--

some fixes + ucx_(d)list_contains

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

mercurial