XHashtableIter
typedef struct{
XHashtable *table;
size_t index;
}XHashtableIter;
typedef struct{
XHashtable *table;
size_t index;
}XHashtableIter;
Initialize an iterator for a hashtable.
X_HASHTABLE_API bool x_hashtable_iter_begin(
XHashtable *table,
XHashtableIter *it
);
XHashtable *tableXHashtableIter *itTrue if the iterator was initialized (even if empty table), false on invalid args.
Advance iterator to the next occupied entry.
X_HASHTABLE_API bool x_hashtable_iter_next(
XHashtableIter *it,
void **out_key,
void **out_value
);
XHashtableIter *itvoid **out_keyvoid **out_valueTrue if an entry was produced, false if iteration finished or invalid args.
Const-friendly variant of x_hashtable_iter_next().
X_HASHTABLE_API bool x_hashtable_iter_next_const(
XHashtableIter *it,
const void **out_key,
const void **out_value
);
Get the raw slot index of the current entry (mainly for debugging).
X_HASHTABLE_API size_t x_hashtable_iter_slot(const XHashtableIter *it);
const XHashtableIter *itCurrent slot index, or table->capacity if finished/invalid.