ucx/list.h

Sat, 31 Dec 2011 19:10:29 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 31 Dec 2011 19:10:29 +0100
changeset 12
fe50a85e69e7
parent 9
013c5c4b7e44
child 18
69636f81db31
permissions
-rw-r--r--

Added list tests2

     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