summaryrefslogtreecommitdiff
path: root/src/basic/hash-funcs.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-11 18:08:57 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-19 16:50:36 +0200
commit87da87846dbfb07358d01f9d53f1c35ec61b447d (patch)
tree1568e43f10f8f8526e4e73adcf492eccb8b31df8 /src/basic/hash-funcs.h
parent0bf2c5e5ec1b756e95f0e0792bfa473b2e140a64 (diff)
downloadsystemd-87da87846dbfb07358d01f9d53f1c35ec61b447d.tar.gz
basic/hashmap: add hashops variant that does strdup/freeing on its own
So far, we'd use hashmap_free_free to free both keys and values along with the hashmap. I think it's better to make this more encapsulated: in this variant the way contents are freed can be decided when the hashmap is created, and users of the hashmap can always use hashmap_free.
Diffstat (limited to 'src/basic/hash-funcs.h')
-rw-r--r--src/basic/hash-funcs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/hash-funcs.h b/src/basic/hash-funcs.h
index 3d2ae4b55e..0d2d428389 100644
--- a/src/basic/hash-funcs.h
+++ b/src/basic/hash-funcs.h
@@ -76,6 +76,7 @@ struct hash_ops {
void string_hash_func(const char *p, struct siphash *state);
#define string_compare_func strcmp
extern const struct hash_ops string_hash_ops;
+extern const struct hash_ops string_hash_ops_free_free;
void path_hash_func(const char *p, struct siphash *state);
int path_compare_func(const char *a, const char *b) _pure_;