sysusers,strv: export the hash ops to map char* → strv

Also make string_strv_hashmap_put return 0 only if the entry already existed.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-07-19 16:49:41 +02:00
parent b124d3f2ce
commit cde7910993
3 changed files with 67 additions and 35 deletions
+5
View File
@@ -9,6 +9,7 @@
#include "alloc-util.h"
#include "extract-word.h"
#include "hashmap.h"
#include "macro.h"
#include "string-util.h"
@@ -188,3 +189,7 @@ int fputstrv(FILE *f, char **l, const char *separator, bool *space);
(b) = NULL; \
0; \
})
extern const struct hash_ops string_strv_hash_ops;
int string_strv_hashmap_put(Hashmap **h, const char *key, const char *value);
int string_strv_ordered_hashmap_put(OrderedHashmap **h, const char *key, const char *value);