add pa_proplist_size() and pa_proplist_isempty()

This commit is contained in:
Lennart Poettering 2009-01-14 00:06:26 +01:00
parent ef5a2b5f2c
commit 1872526508
2 changed files with 18 additions and 0 deletions

View file

@ -406,3 +406,15 @@ pa_proplist* pa_proplist_copy(pa_proplist *template) {
return p;
}
unsigned pa_proplist_size(pa_proplist *p) {
pa_assert(p);
return pa_hashmap_size(MAKE_HASHMAP(p));
}
int pa_proplist_isempty(pa_proplist *p) {
pa_assert(p);
return pa_hashmap_isempty(MAKE_HASHMAP(p));
}

View file

@ -228,6 +228,12 @@ void pa_proplist_clear(pa_proplist *p);
* the specific list. \since 0.9.11 */
pa_proplist* pa_proplist_copy(pa_proplist *t);
/** Return the number of entries on the property list. \since 0.9.15 */
unsigned pa_proplist_size(pa_proplist *t);
/** Returns 0 when the proplist is empty, positive otherwise \since 0.9.15 */
int pa_proplist_isempty(pa_proplist *t);
PA_C_DECL_END
#endif