Kestrel Interface
Loading...
Searching...
No Matches
kest_linked_list.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LL_FREE   kest_free
#define LL_MALLOC   kest_alloc
#define DECLARE_LINKED_LIST(X)
#define IMPLEMENT_LINKED_LIST(X)
#define DECLARE_LINKED_PTR_LIST(X)
#define IMPLEMENT_LINKED_PTR_LIST(X)

Macro Definition Documentation

◆ DECLARE_LINKED_LIST

#define DECLARE_LINKED_LIST ( X)
Value:
struct X##_ll; \
typedef struct X##_ll { \
X data; \
struct X##_ll *next; \
} X##_ll; \
\
X##_ll *X##_ll_new(X x); \
void X##_ll_free(X##_ll *list); \
X##_ll *X##_ll_tail(X##_ll *list); \
X##_ll *X##_ll_append(X##_ll *list, X x); \
int X##_ll_safe_append(X##_ll **list_ptr, X x); \
X##_ll *X##_ll_append_return_tail(X##_ll **list, X x); \
X##_ll *X##_ll_remove_next(X##_ll *list); \
void X##_ll_destroy(X##_ll *list, void (*destructor)(X x)); \
void X##_ll_map(X##_ll *list, X (*fmap)(X x)); \
X##_ll *X##_ll_cmp_search(X##_ll *list, int (*cmp_function)(X, X), X x); \
X##_ll *X##_ll_destructor_free_and_remove_matching(X##_ll *list, int (*cmp_function)(X, X), X x, void (*destructor)(X));

Definition at line 12 of file kest_linked_list.h.

◆ DECLARE_LINKED_PTR_LIST

#define DECLARE_LINKED_PTR_LIST ( X)
Value:
struct X##_pll; \
typedef struct X##_pll { \
X *data; \
struct X##_pll *next; \
} X##_pll; \
\
X##_pll *X##_pll_new(X *value); \
X##_pll *X##_pll_anew(X *value, void* (*allocator)(size_t size)); \
void X##_pll_free(X##_pll *list); \
X##_pll *X##_pll_tail(X##_pll *list); \
X##_pll *X##_pll_append(X##_pll *list, X *value); \
X##_pll *X##_pll_aappend(X##_pll *list, X *value, void* (*allocator)(size_t size)); \
int X##_pll_safe_append(X##_pll **list_ptr, X *value); \
int X##_pll_safe_aappend(X##_pll **list_ptr, X *value, void* (*allocator)(size_t size)); \
X##_pll *X##_pll_append_return_tail(X##_pll **list, X *x); \
X##_pll *X##_pll_aappend_return_tail(X##_pll **list, X *x, void* (*allocator)(size_t size)); \
X##_pll *X##_pll_remove_next(X##_pll *list); \
void X##_pll_free(X##_pll *list); \
void X##_pll_destroy(X##_pll *list, void (*destructor)(X *x)); \
X##_pll *X##_pll_cmp_search(X##_pll *list, int (*cmp_function)(const X*, const X*), const X *x); \
X##_pll *X##_pll_destructor_free_and_remove_matching(X##_pll *list, int (*cmp_function)(X*, X*), X *x, void (*destructor)(X*));

Definition at line 212 of file kest_linked_list.h.

◆ IMPLEMENT_LINKED_LIST

#define IMPLEMENT_LINKED_LIST ( X)

Definition at line 30 of file kest_linked_list.h.

◆ IMPLEMENT_LINKED_PTR_LIST

#define IMPLEMENT_LINKED_PTR_LIST ( X)

Definition at line 234 of file kest_linked_list.h.

◆ LL_FREE

#define LL_FREE   kest_free

Definition at line 5 of file kest_linked_list.h.

◆ LL_MALLOC

#define LL_MALLOC   kest_alloc

Definition at line 9 of file kest_linked_list.h.