diff options
author | Susant Sahani <ssahani@vmware.com> | 2021-01-14 06:19:47 +0100 |
---|---|---|
committer | Susant Sahani <ssahani@gmail.com> | 2021-01-15 14:29:42 +0100 |
commit | 1346c36d5afa48a39b36485d80552fc1ae24ed12 (patch) | |
tree | 7cebd564f08713dfcbca5170c92f6fb825c4e386 /src/basic/hashmap.h | |
parent | 65ca9b53431aa4c75f9cb1436586655847ed78b7 (diff) | |
download | systemd-1346c36d5afa48a39b36485d80552fc1ae24ed12.tar.gz |
basic: introuce hashmap_ensure_put
Diffstat (limited to 'src/basic/hashmap.h')
-rw-r--r-- | src/basic/hashmap.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/basic/hashmap.h b/src/basic/hashmap.h index e99448375e..c20ee8eb4b 100644 --- a/src/basic/hashmap.h +++ b/src/basic/hashmap.h @@ -133,8 +133,11 @@ HashmapBase* _hashmap_copy(HashmapBase *h HASHMAP_DEBUG_PARAMS); #define ordered_hashmap_copy(h) ((OrderedHashmap*) _hashmap_copy(HASHMAP_BASE(h) HASHMAP_DEBUG_SRC_ARGS)) int _hashmap_ensure_allocated(Hashmap **h, const struct hash_ops *hash_ops HASHMAP_DEBUG_PARAMS); +int _hashmap_ensure_put(Hashmap **h, const struct hash_ops *hash_ops, const void *key, void *value HASHMAP_DEBUG_PARAMS); int _ordered_hashmap_ensure_allocated(OrderedHashmap **h, const struct hash_ops *hash_ops HASHMAP_DEBUG_PARAMS); + #define hashmap_ensure_allocated(h, ops) _hashmap_ensure_allocated(h, ops HASHMAP_DEBUG_SRC_ARGS) +#define hashmap_ensure_put(s, ops, key, value) _hashmap_ensure_put(s, ops, key, value HASHMAP_DEBUG_SRC_ARGS) #define ordered_hashmap_ensure_allocated(h, ops) _ordered_hashmap_ensure_allocated(h, ops HASHMAP_DEBUG_SRC_ARGS) int _ordered_hashmap_ensure_put(OrderedHashmap **h, const struct hash_ops *hash_ops, const void *key, void *value HASHMAP_DEBUG_PARAMS); |