chiark / gitweb /
test: adjust max load factor in test_hashmap_many()
[elogind.git] / src / shared / set.c
index 02ea8315934daed162390f70944300bc8b0759e5..84ab82a701738c08d567f9508953e56b1c94c929 100644 (file)
@@ -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,15 +133,15 @@ 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));
 }
 
-void set_move(Set *s, Set *other) {
+int set_reserve(Set *s, unsigned entries_add) {
+        return hashmap_reserve(MAKE_HASHMAP(s), entries_add);
+}
+
+int set_move(Set *s, Set *other) {
         return hashmap_move(MAKE_HASHMAP(s), MAKE_HASHMAP(other));
 }