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:
Lennart Poettering 2007-12-29 18:03:53 +00:00
parent 2a44213430
commit 2cb1b2c067
2 changed files with 15 additions and 0 deletions

View file

@ -242,3 +242,16 @@ char *pa_proplist_to_string(pa_proplist *p) {
return pa_strbuf_tostring_free(buf); 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;
}

View file

@ -85,4 +85,6 @@ const char *pa_proplist_iterate(pa_proplist *p, void **state);
char *pa_proplist_to_string(pa_proplist *p); char *pa_proplist_to_string(pa_proplist *p);
int pa_proplist_contains(pa_proplist *p, const char *key);
#endif #endif