From: Lennart Poettering Date: Wed, 20 Jan 2010 01:12:36 +0000 (+0100) Subject: add set_replace() X-Git-Tag: 0.git+20100605+dfd8ee-1~446 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f00b3eda2f92b2dcd13c50749ec5e7fce6720b52;p=systemd add set_replace() --- diff --git a/set.c b/set.c index 74137b77..5e23c20e 100644 --- a/set.c +++ b/set.c @@ -26,6 +26,10 @@ int set_put(Set *s, void *value) { return hashmap_put(MAKE_HASHMAP(s), value, value); } +int set_replace(Set *s, void *value) { + return hashmap_replace(MAKE_HASHMAP(s), value, value); +} + void *set_get(Set *s, void *value) { return hashmap_get(MAKE_HASHMAP(s), value); } diff --git a/set.h b/set.h index b206ba80..d8ef7aa5 100644 --- a/set.h +++ b/set.h @@ -18,6 +18,7 @@ Set* set_copy(Set *s); void set_free(Set* s); int set_put(Set *s, void *value); +int set_replace(Set *s, void *value); void *set_get(Set *s, void *value); void *set_remove(Set *s, void *value);