X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fset.c;h=1a3465ca8bd59e95e18436de8c351b3647acd71b;hb=e4c691b59db60ef2e6d8e64766d6ae02cd0dd457;hp=02ea8315934daed162390f70944300bc8b0759e5;hpb=c0c743cb3df7197b51bb89cc3c8ca7ed16d06396;p=elogind.git diff --git a/src/shared/set.c b/src/shared/set.c index 02ea83159..1a3465ca8 100644 --- a/src/shared/set.c +++ b/src/shared/set.c @@ -30,8 +30,8 @@ /* For now this is not much more than a wrapper around a hashmap */ -Set *set_new(hash_func_t hash_func, compare_func_t compare_func) { - return MAKE_SET(hashmap_new(hash_func, compare_func)); +Set *set_new(const struct hash_ops *hash_ops) { + return MAKE_SET(hashmap_new(hash_ops)); } void set_free(Set* s) { @@ -42,8 +42,8 @@ void set_free_free(Set *s) { hashmap_free_free(MAKE_HASHMAP(s)); } -int set_ensure_allocated(Set **s, hash_func_t hash_func, compare_func_t compare_func) { - return hashmap_ensure_allocated((Hashmap**) s, hash_func, compare_func); +int set_ensure_allocated(Set **s, const struct hash_ops *hash_ops) { + return hashmap_ensure_allocated((Hashmap**) s, hash_ops); } int set_put(Set *s, void *value) { @@ -125,14 +125,6 @@ void *set_iterate(Set *s, Iterator *i) { return hashmap_iterate(MAKE_HASHMAP(s), i, NULL); } -void *set_iterate_backwards(Set *s, Iterator *i) { - return hashmap_iterate_backwards(MAKE_HASHMAP(s), i, NULL); -} - -void *set_iterate_skip(Set *s, void *value, Iterator *i) { - return hashmap_iterate_skip(MAKE_HASHMAP(s), value, i); -} - void *set_steal_first(Set *s) { return hashmap_steal_first(MAKE_HASHMAP(s)); } @@ -141,14 +133,14 @@ void* set_first(Set *s) { return hashmap_first(MAKE_HASHMAP(s)); } -void* set_last(Set *s) { - return hashmap_last(MAKE_HASHMAP(s)); -} - int set_merge(Set *s, Set *other) { return hashmap_merge(MAKE_HASHMAP(s), MAKE_HASHMAP(other)); } +int set_reserve(Set *s, unsigned entries_add) { + return hashmap_reserve(MAKE_HASHMAP(s), entries_add); +} + void set_move(Set *s, Set *other) { return hashmap_move(MAKE_HASHMAP(s), MAKE_HASHMAP(other)); }