38 if (it->
next == NULL) {
42 bool ret = it->
next(ptr);
bool th_iterator_next(th_iterator_t **ptr)
Try to get the next element. Free the iterator if it reachs the end.
void th_iterator_free(th_iterator_t *it)
Free an iterator.
static void th_iterator_init(th_iterator_t *it, th_generic_table_t generic_table, th_iterator_next_func_t next)
th_iterator_t * th_iterator_create(th_generic_table_t generic_table, th_iterator_next_func_t next)
Allocate then init a new iterator.
bool(* th_iterator_next_func_t)(th_iterator_t **)
Pointer on function that get the next element.
Represents an iterator that allow to iterate over a generic table.
th_generic_table_t generic_table
bool(* next)(struct th_iterator_s **)
void * th_generic_table_t
Represents any table.