ucx/list.h

Thu, 05 Jan 2012 14:53:54 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 05 Jan 2012 14:53:54 +0100
changeset 20
db7d9860dbbd
parent 12
fe50a85e69e7
child 18
69636f81db31
permissions
-rw-r--r--

added some map functions

     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 void ucx_list_free(UcxList *l);
    22 UcxList *ucx_list_append(UcxList *l, void *data);
    23 UcxList *ucx_list_prepend(UcxList *l, void *data);
    24 UcxList *ucx_list_concat(UcxList *l1, UcxList *l2);
    25 UcxList *ucx_list_last(UcxList *l);
    26 UcxList *ucx_list_get(UcxList *l, int index);
    27 size_t ucx_list_size(UcxList *l);
    28 void ucx_list_foreach(UcxList *l, ucx_callback fnc, void *data);
    31 #ifdef	__cplusplus
    32 }
    33 #endif
    35 #endif	/* LIST_H */

mercurial