chiark / gitweb /
dbus: properly serialize calendar timer data
[elogind.git] / src / shared / set.c
index f5c7c37cab81922b6cdda91a0ed1df8654746ff1..53399b655b43daafe615489cdbadac8e9dfe17e9 100644 (file)
@@ -37,6 +37,14 @@ void set_free(Set* s) {
         hashmap_free(MAKE_HASHMAP(s));
 }
 
+void set_freep(Set **s) {
+        if (!s)
+                return;
+
+        set_free(*s);
+        *s = NULL;
+}
+
 void set_free_free(Set *s) {
         hashmap_free_free(MAKE_HASHMAP(s));
 }
@@ -57,6 +65,10 @@ void *set_get(Set *s, void *value) {
         return hashmap_get(MAKE_HASHMAP(s), value);
 }
 
+bool set_contains(Set *s, void *value) {
+        return hashmap_contains(MAKE_HASHMAP(s), value);
+}
+
 void *set_remove(Set *s, void *value) {
         return hashmap_remove(MAKE_HASHMAP(s), value);
 }
@@ -120,3 +132,7 @@ void set_clear(Set *s) {
 void set_clear_free(Set *s) {
         hashmap_clear_free(MAKE_HASHMAP(s));
 }
+
+char **set_get_strv(Set *s) {
+        return hashmap_get_strv(MAKE_HASHMAP(s));
+}