mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
add new function pa_proplist_contains()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2089 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
2a44213430
commit
2cb1b2c067
2 changed files with 15 additions and 0 deletions
|
|
@ -242,3 +242,16 @@ char *pa_proplist_to_string(pa_proplist *p) {
|
|||
|
||||
return pa_strbuf_tostring_free(buf);
|
||||
}
|
||||
|
||||
int pa_proplist_contains(pa_proplist *p, const char *key) {
|
||||
pa_assert(p);
|
||||
pa_assert(key);
|
||||
|
||||
if (!property_name_valid(key))
|
||||
return -1;
|
||||
|
||||
if (!(pa_hashmap_get(MAKE_HASHMAP(p), key)))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,4 +85,6 @@ const char *pa_proplist_iterate(pa_proplist *p, void **state);
|
|||
|
||||
char *pa_proplist_to_string(pa_proplist *p);
|
||||
|
||||
int pa_proplist_contains(pa_proplist *p, const char *key);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue