src/server/ucx/list.h

Sat, 19 Jan 2013 20:13:07 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 19 Jan 2013 20:13:07 +0100
changeset 48
37a512d7b8f6
parent 36
450d2d5f4735
child 71
069c152f6272
permissions
-rw-r--r--

fixed some memory leaks

/*
 * 
 */

#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);

UcxList *ucx_list_sort(UcxList *l, cmp_func fnc, void *data);

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

#ifdef	__cplusplus
}
#endif

#endif	/* LIST_H */

mercurial