summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/hashmap.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-06-17 03:02:34 +0200
committerLennart Poettering <lennart@poettering.net>2009-06-17 03:02:34 +0200
commitc6830bd9dc53ee745ac331c4ab1c55134562d114 (patch)
tree96e09dd2aef85f894e4c65905a7092eb7026450e /src/pulsecore/hashmap.c
parenta1d84e39359fed52770f9d15650aabc6bcce6910 (diff)
hashmap: implement pa_hashmap_last()
Diffstat (limited to 'src/pulsecore/hashmap.c')
-rw-r--r--src/pulsecore/hashmap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pulsecore/hashmap.c b/src/pulsecore/hashmap.c
index b549cb1c..1fac97eb 100644
--- a/src/pulsecore/hashmap.c
+++ b/src/pulsecore/hashmap.c
@@ -279,6 +279,15 @@ void* pa_hashmap_first(pa_hashmap *h) {
return h->iterate_list_head->value;
}
+void* pa_hashmap_last(pa_hashmap *h) {
+ pa_assert(h);
+
+ if (!h->iterate_list_tail)
+ return NULL;
+
+ return h->iterate_list_tail->value;
+}
+
void* pa_hashmap_steal_first(pa_hashmap *h) {
void *data;