diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-10-13 22:39:02 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-10-13 22:39:06 +0900 |
commit | 11e9fec2590d9726c57498d5c2ed9ea2860ad443 (patch) | |
tree | e95e6321e2e57236094dcbca0241fff15eb8143f /src/basic/set.h | |
parent | a8cfc179626c19f5a79c0a91288664d3da107a2c (diff) | |
download | systemd-11e9fec2590d9726c57498d5c2ed9ea2860ad443.tar.gz |
hashmap: introduce {hashmap,set}_put_strdup_full()
They can take hash_ops.
Diffstat (limited to 'src/basic/set.h')
-rw-r--r-- | src/basic/set.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/basic/set.h b/src/basic/set.h index 7170eea84c..7749c18c45 100644 --- a/src/basic/set.h +++ b/src/basic/set.h @@ -128,10 +128,12 @@ int _set_ensure_consume(Set **s, const struct hash_ops *hash_ops, void *key HAS int set_consume(Set *s, void *value); -int _set_put_strdup(Set **s, const char *p HASHMAP_DEBUG_PARAMS); -#define set_put_strdup(s, p) _set_put_strdup(s, p HASHMAP_DEBUG_SRC_ARGS) -int _set_put_strdupv(Set **s, char **l HASHMAP_DEBUG_PARAMS); -#define set_put_strdupv(s, l) _set_put_strdupv(s, l HASHMAP_DEBUG_SRC_ARGS) +int _set_put_strdup_full(Set **s, const struct hash_ops *hash_ops, const char *p HASHMAP_DEBUG_PARAMS); +#define set_put_strdup_full(s, hash_ops, p) _set_put_strdup_full(s, hash_ops, p HASHMAP_DEBUG_SRC_ARGS) +#define set_put_strdup(s, p) set_put_strdup_full(s, &string_hash_ops_free, p) +int _set_put_strdupv_full(Set **s, const struct hash_ops *hash_ops, char **l HASHMAP_DEBUG_PARAMS); +#define set_put_strdupv_full(s, hash_ops, l) _set_put_strdupv_full(s, hash_ops, l HASHMAP_DEBUG_SRC_ARGS) +#define set_put_strdupv(s, l) set_put_strdupv_full(s, &string_hash_ops_free, l) int set_put_strsplit(Set *s, const char *v, const char *separators, ExtractFlags flags); |