diff options
Diffstat (limited to 'src/pulse/proplist.c')
-rw-r--r-- | src/pulse/proplist.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pulse/proplist.c b/src/pulse/proplist.c index db4c9344..c904f533 100644 --- a/src/pulse/proplist.c +++ b/src/pulse/proplist.c @@ -140,6 +140,21 @@ static int proplist_setn(pa_proplist *p, const char *key, size_t key_length, con return 0; } +/** Will accept only valid UTF-8 */ +int pa_proplist_setp(pa_proplist *p, const char *pair) { + const char *t; + + pa_assert(p); + pa_assert(pair); + + if (!(t = strchr(pair, '='))) + return -1; + + return proplist_setn(p, + pair, t - pair, + t + 1, strchr(pair, 0) - t - 1); +} + static int proplist_sethex(pa_proplist *p, const char *key, size_t key_length, const char *value, size_t value_length) { struct property *prop; pa_bool_t add = FALSE; |