From: Yu Watanabe Date: Mon, 8 Aug 2022 13:02:53 +0000 (+0900) Subject: hash-funcs: introduce string_hash_ops_free_strv_free X-Git-Tag: v252-rc1~491^2~3 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=52be2b43f530c69b058625d7b9e0a2184c5d3938;p=systemd%2F.git hash-funcs: introduce string_hash_ops_free_strv_free --- diff --git a/src/basic/hash-funcs.c b/src/basic/hash-funcs.c index 6addb76f1b..5fac467185 100644 --- a/src/basic/hash-funcs.c +++ b/src/basic/hash-funcs.c @@ -4,6 +4,7 @@ #include "hash-funcs.h" #include "path-util.h" +#include "strv.h" void string_hash_func(const char *p, struct siphash *state) { siphash24_compress(p, strlen(p) + 1, state); @@ -15,6 +16,9 @@ DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(string_hash_ops_free, DEFINE_HASH_OPS_FULL(string_hash_ops_free_free, char, string_hash_func, string_compare_func, free, void, free); +DEFINE_HASH_OPS_FULL(string_hash_ops_free_strv_free, + char, string_hash_func, string_compare_func, free, + char*, strv_free); void path_hash_func(const char *q, struct siphash *state) { bool add_slash = false; diff --git a/src/basic/hash-funcs.h b/src/basic/hash-funcs.h index c537c6af7e..c14302ec72 100644 --- a/src/basic/hash-funcs.h +++ b/src/basic/hash-funcs.h @@ -78,6 +78,7 @@ void string_hash_func(const char *p, struct siphash *state); extern const struct hash_ops string_hash_ops; extern const struct hash_ops string_hash_ops_free; extern const struct hash_ops string_hash_ops_free_free; +extern const struct hash_ops string_hash_ops_free_strv_free; void path_hash_func(const char *p, struct siphash *state); extern const struct hash_ops path_hash_ops;