set.h revision 6091827530d6dd43479d6709fb6e9f745c11e900
/*-*- Mode: C; c-basic-offset: 8 -*-*/
#ifndef foosethfoo
#define foosethfoo
/* Pretty straightforward set implementation. Internally based on the
* hashmap. That means that as a minor optimization a NULL set
* object will be treated as empty set for all read
* operations. That way it is not necessary to instantiate an object
* for each set use. */
#include "hashmap.h"
bool set_isempty(Set *s);
void *set_steal_first(Set *h);
#define SET_FOREACH(e, s, state) \
#define SET_FOREACH_BACKWARDS(e, s, state) \
for ((state) = NULL, (e) = set_iterate_backwards((s), &(state)); (e); (e) = set_iterate_backwards((s), &(state)))
#endif