chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
path: optionally, create watched directories in .path units
[elogind.git]
/
src
/
hashmap.c
diff --git
a/src/hashmap.c
b/src/hashmap.c
index 51f00131f46f36d632b8ad159549a0dde57a25de..4b187057ec34f8af4d5de0fcb7bbdff8159438dc 100644
(file)
--- a/
src/hashmap.c
+++ b/
src/hashmap.c
@@
-476,6
+476,21
@@
void* hashmap_steal_first(Hashmap *h) {
return data;
}
return data;
}
+void* hashmap_steal_first_key(Hashmap *h) {
+ void *key;
+
+ if (!h)
+ return NULL;
+
+ if (!h->iterate_list_head)
+ return NULL;
+
+ key = (void*) h->iterate_list_head->key;
+ remove_entry(h, h->iterate_list_head);
+
+ return key;
+}
+
unsigned hashmap_size(Hashmap *h) {
if (!h)
unsigned hashmap_size(Hashmap *h) {
if (!h)