chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hashmap: introduce hashmap_reserve()
[elogind.git]
/
src
/
shared
/
set.c
diff --git
a/src/shared/set.c
b/src/shared/set.c
index 02ea8315934daed162390f70944300bc8b0759e5..1a3465ca8bd59e95e18436de8c351b3647acd71b 100644
(file)
--- 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 */
/* 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) {
}
void set_free(Set* s) {
@@
-42,8
+42,8
@@
void set_free_free(Set *s) {
hashmap_free_free(MAKE_HASHMAP(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) {
}
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);
}
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));
}
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));
}
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_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));
}
void set_move(Set *s, Set *other) {
return hashmap_move(MAKE_HASHMAP(s), MAKE_HASHMAP(other));
}