ucx/list.h

Thu, 16 Aug 2012 11:31:16 +0200

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

changed API of sort algorithms (no further hint for the algorithms used in preparation for the upcomming change from qsort to natural merge sort)

     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(UcxList *l1, UcxList *l2, cmp_func fnc, void *data);
    24 void ucx_list_free(UcxList *l);
    25 UcxList *ucx_list_append(UcxList *l, void *data);
    26 UcxList *ucx_list_prepend(UcxList *l, void *data);
    27 UcxList *ucx_list_concat(UcxList *l1, UcxList *l2);
    28 UcxList *ucx_list_last(UcxList *l);
    29 UcxList *ucx_list_get(UcxList *l, int index);
    30 size_t ucx_list_size(UcxList *l);
    32 UcxList *ucx_list_sort(UcxList *l, cmp_func fnc, void *data);
    34 /* list specific functions */
    35 UcxList *ucx_list_remove(UcxList *l, UcxList *e);
    37 #ifdef	__cplusplus
    38 }
    39 #endif
    41 #endif	/* LIST_H */

mercurial