src/server/ucx/list.h

Mon, 23 Jul 2012 15:13:19 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 23 Jul 2012 15:13:19 +0200
changeset 32
ebba53de8b18
parent 16
a9bbd82d2dce
child 36
450d2d5f4735
permissions
-rw-r--r--

added solaris 10 support

/*
 *
 */

#ifndef LIST_H
#define	LIST_H

#include "ucx.h"
#include <stddef.h>

#ifdef	__cplusplus
extern "C" {
#endif

typedef struct UcxList UcxList;
struct UcxList {
    void    *data;
    UcxList *next;
};

UcxList *ucx_list_clone(UcxList *l, copy_func fnc, void *data);
int ucx_list_equals(UcxList *l1, UcxList *l2, cmp_func fnc, void *data);

void ucx_list_free(UcxList *l);
UcxList *ucx_list_append(UcxList *l, void *data);
UcxList *ucx_list_prepend(UcxList *l, void *data);
UcxList *ucx_list_concat(UcxList *l1, UcxList *l2);
UcxList *ucx_list_last(UcxList *l);
UcxList *ucx_list_get(UcxList *l, int index);
size_t ucx_list_size(UcxList *l);
void ucx_list_foreach(UcxList *l, ucx_callback fnc, void *data);

/* list specific functions */
UcxList *ucx_list_remove(UcxList *l, UcxList *e);

#ifdef	__cplusplus
}
#endif

#endif	/* LIST_H */

mercurial