|
CX Framework
Cross-platform C utility framework
|
Functions | |
| _htiInitAnno bool | htiInit (htiter *iter, hashtable htbl) |
| _htiNextAnno bool | htiNext (htiter *iter) |
| void | htiFinish (htiter *iter) |
| bool | htiValid (htiter *iter) |
Iteration allows traversing all key-value pairs in the hash table. The order of iteration is the same as the order that the elements were inserted into the table.
Usage pattern:
| void htiFinish | ( | htiter * | iter | ) |
Finalizes an iterator after iteration is complete
This must be called after iteration is complete (when htiNext returns false) to properly clean up the iterator state.
| iter | Iterator to finalize |
| _htiInitAnno bool htiInit | ( | htiter * | iter, |
| hashtable | htbl | ||
| ) |
Initializes an iterator and positions it at the first element
If this returns false, do not call htiNext(), but htiValid() can be used regardless and is often more convenient. htiFinish() is also safe to call regardless of the return value.
| iter | Iterator to initialize |
| htbl | Hash table to iterate over |
| _htiNextAnno bool htiNext | ( | htiter * | iter | ) |
Advances the iterator to the next element
After this returns false, the iterator is invalid and htiFinish() should be called.
| iter | Iterator to advance |
|
inline |
Checks if an iterator is currently positioned at a valid element
| iter | Iterator to check |
Definition at line 676 of file hashtable.h.