basic/ordered-set: add functions to operate on OrderedSets of strings

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-02-21 12:00:05 +01:00
parent 1b78172b5a
commit ef79eae09a
4 changed files with 69 additions and 0 deletions
+5
View File
@@ -48,9 +48,14 @@ static inline void* ordered_set_steal_first(OrderedSet *s) {
return ordered_hashmap_steal_first((OrderedHashmap*) s);
}
static inline char **ordered_set_get_strv(OrderedSet *s) {
return internal_hashmap_get_strv(HASHMAP_BASE((OrderedHashmap*) s));
}
int ordered_set_consume(OrderedSet *s, void *p);
int ordered_set_put_strdup(OrderedSet *s, const char *p);
int ordered_set_put_strdupv(OrderedSet *s, char **l);
int ordered_set_put_string_set(OrderedSet *s, OrderedSet *l);
#define ORDERED_SET_FOREACH(e, s, i) \
for ((i) = ITERATOR_FIRST; ordered_set_iterate((s), &(i), (void**)&(e)); )