chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
architecture: add string table entries for mips-le archs which were missing
[elogind.git]
/
src
/
shared
/
set.c
diff --git
a/src/shared/set.c
b/src/shared/set.c
index 53399b655b43daafe615489cdbadac8e9dfe17e9..5a4bf11bdfda45b01d4ef63ad9220c127c2daa99 100644
(file)
--- a/
src/shared/set.c
+++ b/
src/shared/set.c
@@
-37,14
+37,6
@@
void set_free(Set* s) {
hashmap_free(MAKE_HASHMAP(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));
}
void set_free_free(Set *s) {
hashmap_free_free(MAKE_HASHMAP(s));
}
@@
-57,6
+49,16
@@
int set_put(Set *s, void *value) {
return hashmap_put(MAKE_HASHMAP(s), value, value);
}
return hashmap_put(MAKE_HASHMAP(s), value, value);
}
+int set_consume(Set *s, void *value) {
+ int r;
+
+ r = set_put(s, value);
+ if (r < 0)
+ free(value);
+
+ return r;
+}
+
int set_replace(Set *s, void *value) {
return hashmap_replace(MAKE_HASHMAP(s), value, value);
}
int set_replace(Set *s, void *value) {
return hashmap_replace(MAKE_HASHMAP(s), value, value);
}