PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
iterator.h File Reference
#include <stdbool.h>

Data Structures

struct  Iterator
 Iterator. More...
 

Macros

#define ITERATOR_EMPTY   ((Iterator){0, 0, 0})
 Iterator without callbacks or state.
 

Typedefs

typedef void * IteratorState
 Iterator state, owned by the caller.
 
typedef bool(* IteratorCallback) (IteratorState state)
 Step function of an iterator.
 

Functions

void iter_init (Iterator *iter, IteratorCallback next, IteratorCallback prev, IteratorState state)
 Initialize an iterator.
 
bool iter_next (Iterator *iter)
 Move to the next element.
 
bool iter_prev (Iterator *iter)
 Move to the previous element.