diff options
| author | @syxhe <https://t.me/syxhe> | 2025-04-15 18:02:06 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2025-04-15 18:02:06 -0500 |
| commit | 54b82706a01049e4ed5e4d417f50f642c701105b (patch) | |
| tree | e0749b503a5cf5351fd46db1990bdd266f02c22d /src/ll.h | |
| parent | fce48bb669691b6d3690b032f7a88e22c6f5614a (diff) | |
Finish prototype scanning code
Diffstat (limited to 'src/ll.h')
| -rw-r--r-- | src/ll.h | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -21,11 +21,11 @@ | |||
| 21 | /* TODO: Implement a way to register a set of alloc functions to a linked list so I can give it arenas for memory allocation | 21 | /* TODO: Implement a way to register a set of alloc functions to a linked list so I can give it arenas for memory allocation |
| 22 | // instead of just xcalloc */ | 22 | // instead of just xcalloc */ |
| 23 | 23 | ||
| 24 | typedef int (*dll_freecb)(void*); | 24 | typedef void (*dll_freecb)(void*); |
| 25 | typedef struct dlinked dlinkedlist; | 25 | typedef struct dlinked dlinkedlist; |
| 26 | 26 | ||
| 27 | dlinkedlist * dlinkedlist_init(void); | 27 | dlinkedlist * dlinkedlist_init(void); |
| 28 | int dlinkedlist_free(dlinkedlist **ll); | 28 | void dlinkedlist_free(dlinkedlist *ll); |
| 29 | int dlinkedlist_append(dlinkedlist * const ll, void *data, dll_freecb fcb); | 29 | int dlinkedlist_append(dlinkedlist * const ll, void *data, dll_freecb fcb); |
| 30 | int dlinkedlist_prepend(dlinkedlist * const ll, void *data, dll_freecb fcb); | 30 | int dlinkedlist_prepend(dlinkedlist * const ll, void *data, dll_freecb fcb); |
| 31 | int dlinkedlist_insert(dlinkedlist * const ll, void *data, dll_freecb fcb, int index); | 31 | int dlinkedlist_insert(dlinkedlist * const ll, void *data, dll_freecb fcb, int index); |
| @@ -35,4 +35,6 @@ int dlinkedlist_remove(dlinkedlist * const ll, int index); | |||
| 35 | int dlinkedlist_size(const dlinkedlist * const ll); | 35 | int dlinkedlist_size(const dlinkedlist * const ll); |
| 36 | #define dlinkedlist_isempty(ll) (dlinkedlist_size((ll)) == 0) | 36 | #define dlinkedlist_isempty(ll) (dlinkedlist_size((ll)) == 0) |
| 37 | 37 | ||
| 38 | int dlinkedlist_foreach(dlinkedlist *ll, int (*callback)(void*)); | ||
| 39 | |||
| 38 | #endif \ No newline at end of file | 40 | #endif \ No newline at end of file |
