]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
install: define hash_ops for UnitFileList
authorDavid Tardon <dtardon@redhat.com>
Tue, 28 Mar 2023 07:31:51 +0000 (09:31 +0200)
committerDavid Tardon <dtardon@redhat.com>
Tue, 28 Mar 2023 12:16:47 +0000 (14:16 +0200)
src/shared/install.c
src/shared/install.h

index 79f9ea9b0eb8ea7ae828d42e96e62b61afc42899..832ddaddd640f315d645a356cee97a0555a9db88 100644 (file)
@@ -3625,6 +3625,14 @@ Hashmap* unit_file_list_free(Hashmap *h) {
 
 DEFINE_TRIVIAL_CLEANUP_FUNC(UnitFileList*, unit_file_list_free_one);
 
+DEFINE_HASH_OPS_WITH_VALUE_DESTRUCTOR(
+        unit_file_list_hash_ops_free,
+        char,
+        string_hash_func,
+        string_compare_func,
+        UnitFileList,
+        unit_file_list_free_one);
+
 int unit_file_get_list(
                 RuntimeScope scope,
                 const char *root_dir,
index 0f9724f99935f3f3d3871ef92d27f972fe00abb8..9582fb210d9598bed70c0cd667d2e993c3e4e2a7 100644 (file)
@@ -196,6 +196,7 @@ int unit_file_exists(RuntimeScope scope, const LookupPaths *paths, const char *n
 
 int unit_file_get_list(RuntimeScope scope, const char *root_dir, Hashmap *h, char **states, char **patterns);
 Hashmap* unit_file_list_free(Hashmap *h);
+extern const struct hash_ops unit_file_list_hash_ops_free;
 
 InstallChangeType install_changes_add(InstallChange **changes, size_t *n_changes, InstallChangeType type, const char *path, const char *source);
 void install_changes_free(InstallChange *changes, size_t n_changes);