mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-16 03:27:49 +07:00
hashmap: add hashmap_first_key()
This commit is contained in:
parent
5079a105e7
commit
2e4a6ff47b
@ -558,6 +558,17 @@ void* hashmap_first(Hashmap *h) {
|
||||
return h->iterate_list_head->value;
|
||||
}
|
||||
|
||||
void* hashmap_first_key(Hashmap *h) {
|
||||
|
||||
if (!h)
|
||||
return NULL;
|
||||
|
||||
if (!h->iterate_list_head)
|
||||
return NULL;
|
||||
|
||||
return (void*) h->iterate_list_head->key;
|
||||
}
|
||||
|
||||
void* hashmap_last(Hashmap *h) {
|
||||
|
||||
if (!h)
|
||||
|
@ -74,6 +74,7 @@ void hashmap_clear(Hashmap *h);
|
||||
void *hashmap_steal_first(Hashmap *h);
|
||||
void *hashmap_steal_first_key(Hashmap *h);
|
||||
void* hashmap_first(Hashmap *h);
|
||||
void* hashmap_first_key(Hashmap *h);
|
||||
void* hashmap_last(Hashmap *h);
|
||||
|
||||
char **hashmap_get_strv(Hashmap *h);
|
||||
|
Loading…
Reference in New Issue
Block a user