#ifndef __VXGG_REWRITE___LL_H___305861098005___ #define __VXGG_REWRITE___LL_H___305861098005___ // Notice: dlinked functions are no longer necessarily xalloc, but MAY be IF the `___VXGG___USE_XALLOC_FOR_VALLOC___` is greater than 0 /* TODO: Implement a way to register a set of alloc functions to a linked list so I can give it arenas for memory allocation // instead of just xcalloc */ // I don't know if I care to do this right now. I might be able to hack it in but it would be a fugly hack, something as bad if not worse than that weird callback thing I was doing with the ALWAYS_CHECK_LIBSODIUM macro typedef void (*dll_freecb)(void*); typedef struct dlinked dlinkedlist; #ifndef __VXGG_REWRITE___LL_INTERNAL___ dlinkedlist * dlinkedlist_init(void); void dlinkedlist_free(void *dll); int dlinkedlist_append(dlinkedlist * const ll, void *data, dll_freecb fcb); int dlinkedlist_prepend(dlinkedlist * const ll, void *data, dll_freecb fcb); int dlinkedlist_insert(dlinkedlist * const ll, void *data, dll_freecb fcb, int index); void* dlinkedlist_get(const dlinkedlist * const ll, int index); int dlinkedlist_remove(dlinkedlist * const ll, int index); void * dlinkedlist_poplast(dlinkedlist *ll); int dlinkedlist_size(const dlinkedlist * const ll); #define dlinkedlist_isempty(ll) (dlinkedlist_size((ll)) == 0) int dlinkedlist_foreach(dlinkedlist *ll, int (*callback)(void*)); #endif #endif