1 #ifndef ___ARRAYLIST_H___
2 #define ___ARRAYLIST_H___
22 #include <apr_pools.h>
48 #define ARRAYLIST_DEFAULT_SIZE 50
50 #define E_ARRAYLIST_UNABLE_TO_ALLOCATE_ARRAY 1
51 #define E_ARRAYLIST_INDEX_BEYOND_CAPACITY 2
52 #define E_ARRAYLIST_INDEX_NOT_FOUND 3
54 #define MAX_VOIDPTR_ALLOCATE (SIZE_MAX / sizeof(void*))
56 typedef void (arraylist_free_function)(
void* data);
59 typedef void (arraylist_item_to_lua_object)(lua_State* L,
int index,
void* data);
83 arraylist_free_function* free_fn;
85 arraylist_item_to_lua_object* convert_to_lua;
120 void set_lua_convertor(
arraylist* l, arraylist_item_to_lua_object* convert_to_lua);
129 void convert_to_lua_array(
arraylist* list, lua_State* L);
234 int arraylist_apr_new(
arraylist** l, apr_pool_t* pool, arraylist_free_function* free_fn);
235 int arraylist_apr_new_with_capacity(
arraylist** l, apr_pool_t* pool,
size_t capacity, arraylist_free_function* free_fn);
void * arraylist_get(arraylist *l, size_t loc)
Definition: coll_arraylist.c:242
int arraylist_insert(arraylist *l, size_t loc, void *item)
Definition: coll_arraylist.c:189
int arraylist_delete(arraylist *l, size_t loc)
Definition: coll_arraylist.c:266
size_t arraylist_length(arraylist *l)
Definition: coll_arraylist.c:110
void arraylist_clear(arraylist *l)
Definition: coll_arraylist.c:254
struct arraylist_t arraylist
void arraylist_print(arraylist *l, void(*item_print)(void *item))
Definition: coll_arraylist.c:321
int arraylist_add(arraylist *l, void *item)
Definition: coll_arraylist.c:216
int arraylist_new_with_capacity(arraylist **l, size_t capacity, arraylist_free_function *free_fn)
Definition: coll_arraylist.c:10
int arraylist_new(arraylist **l, arraylist_free_function *free_fn)
Definition: coll_arraylist.c:5
int arraylist_set(arraylist *l, size_t loc, void *item)
Definition: coll_arraylist.c:221
void arraylist_free(arraylist *l)
Definition: coll_arraylist.c:287
Definition: coll_arraylist.h:80