227#define cxIteratorValid(iter) (iter).base.valid(&(iter))
237#define cxIteratorCurrent(iter) (iter).base.current(&iter)
244#define cxIteratorNext(iter) (iter).base.next(&iter)
252#define cxIteratorFlagRemoval(iter) (iter).base.flag_removal(&iter)
260#define cx_foreach(type, elem, iter) \
261for (type elem; cxIteratorValid(iter) && (elem = (type)cxIteratorCurrent(iter)) != NULL ; cxIteratorNext(iter))
Common definitions and feature checks.
#define __attribute__(x)
Removes GNU C attributes where they are not supported.
Definition: common.h:127
The base of mutating and non-mutating iterators.
Definition: iterator.h:45
void *(* current_impl)(void const *)
Original implementation in case the function needs to be wrapped.
Definition: iterator.h:64
void *(* current)(void const *)
Returns a pointer to the current element.
Definition: iterator.h:58
bool remove
Internal flag for removing the current element when advancing.
Definition: iterator.h:90
bool(* valid)(void const *)
True iff the iterator points to valid data.
Definition: iterator.h:50
bool(* flag_removal)(void *)
Flag current element for removal, if possible.
Definition: iterator.h:80
bool mutating
Indicates whether this iterator may remove elements.
Definition: iterator.h:85
void(* next)(void *)
Advances the iterator.
Definition: iterator.h:72
Internal iterator struct - use CxIterator.
Definition: iterator.h:160
void * elem_handle
Handle for the current element, if required.
Definition: iterator.h:170
size_t slot
Field for storing a slot number.
Definition: iterator.h:196
void const * key
A pointer to the key.
Definition: iterator.h:185
size_t index
If the iterator is position-aware, contains the index of the element in the underlying collection.
Definition: iterator.h:202
void const * src_handle
Handle for the source collection, if any.
Definition: iterator.h:175
void * value
A pointer to the value.
Definition: iterator.h:189
Internal iterator struct - use CxMutIterator.
Definition: iterator.h:96
size_t slot
Field for storing a slot number.
Definition: iterator.h:132
size_t index
If the iterator is position-aware, contains the index of the element in the underlying collection.
Definition: iterator.h:138
void const * key
A pointer to the key.
Definition: iterator.h:121
void * elem_handle
Handle for the current element, if required.
Definition: iterator.h:106
void * value
A pointer to the value.
Definition: iterator.h:125
void * src_handle
Handle for the source collection, if any.
Definition: iterator.h:111