]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dns-domain: introduce dns_name_hash_ops_free
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 Dec 2022 13:35:09 +0000 (22:35 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Dec 2022 11:32:44 +0000 (20:32 +0900)
Preparation for later commits.

src/shared/dns-domain.c
src/shared/dns-domain.h

index ebf86d24050e864d4039dd1e91798142e5fa93d3..a071976442310d58237155b6eea223a9d20cf287 100644 (file)
@@ -527,7 +527,18 @@ int dns_name_compare_func(const char *a, const char *b) {
         }
 }
 
-DEFINE_HASH_OPS(dns_name_hash_ops, char, dns_name_hash_func, dns_name_compare_func);
+DEFINE_HASH_OPS(
+        dns_name_hash_ops,
+        char,
+        dns_name_hash_func,
+        dns_name_compare_func);
+
+DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(
+        dns_name_hash_ops_free,
+        char,
+        dns_name_hash_func,
+        dns_name_compare_func,
+        free);
 
 int dns_name_equal(const char *x, const char *y) {
         int r, q;
index 5421c60ee7ebd68a7ad0b3efe45c1ae9b22ed85a..7a35ae43bcb56cb8460fd257bd4409c96abd7252 100644 (file)
@@ -67,6 +67,7 @@ static inline bool dns_name_is_empty(const char *s) {
 void dns_name_hash_func(const char *s, struct siphash *state);
 int dns_name_compare_func(const char *a, const char *b);
 extern const struct hash_ops dns_name_hash_ops;
+extern const struct hash_ops dns_name_hash_ops_free;
 
 int dns_name_between(const char *a, const char *b, const char *c);
 int dns_name_equal(const char *x, const char *y);