Single chained list example.
Single chained list example.
#include <banjo/assert.h>
#include <banjo/main.h>
int main(int argc, char* argv[]) {
(void)argc;
(void)argv;
bj_assert(list);
bj_assert(iterator);
}
return 0;
}
void bj_list_clear(bj_list *list)
Clears all data in the list.
void * bj_list_at(bj_list *list, size_t index)
Returns the value of the element at the specified index.
struct bj_list_t bj_list
Typedef for the BList_t struct.
Definition list.h:23
void * bj_list_insert(bj_list *list, size_t index, void *p_data)
Inserts a new element at the specified index and returns a pointer to it.
void bj_list_del(bj_list *p_list)
Deletes a bj_list object and releases associated memory.
#define bj_list_new_t(T)
Creates a new bj_list with type inference for elements.
Definition list.h:54
size_t bj_list_len(bj_list *list)
Returns the number of elements in the given list.
bj_list_iterator * bj_list_iterator_new(bj_list *list)
Creates a forward-only iterator for the given list.
void * bj_list_iterator_next(bj_list_iterator *iterator)
Returns the next element in the iteration.
struct bj_list_iterator_t bj_list_iterator
Typedef for the bj_list_iterator_t structure.
Definition list.h:184
bj_bool bj_list_iterator_has_next(bj_list_iterator *iterator)
Returns BJ_TRUE if the iterator has more elements.
void bj_list_iterator_del(bj_list_iterator *iterator)
Destroys the given list iterator.
Header file for List container type.