mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
new configuration subsystem
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@198 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
fbefe67d52
commit
829656c5fc
23 changed files with 755 additions and 231 deletions
|
|
@ -36,6 +36,7 @@
|
|||
#include "sink.h"
|
||||
#include "source.h"
|
||||
#include "xmalloc.h"
|
||||
#include "util.h"
|
||||
|
||||
struct pa_modargs;
|
||||
|
||||
|
|
@ -229,6 +230,7 @@ int pa_modargs_get_value_s32(struct pa_modargs *ma, const char *key, int32_t *va
|
|||
|
||||
int pa_modargs_get_value_boolean(struct pa_modargs *ma, const char *key, int *value) {
|
||||
const char *v;
|
||||
int r;
|
||||
assert(ma && key && value);
|
||||
|
||||
if (!(v = pa_modargs_get_value(ma, key, NULL)))
|
||||
|
|
@ -237,13 +239,10 @@ int pa_modargs_get_value_boolean(struct pa_modargs *ma, const char *key, int *va
|
|||
if (!*v)
|
||||
return -1;
|
||||
|
||||
if (!strcmp(v, "1") || !strcasecmp(v, "yes") || !strcasecmp(v, "y") || !strcasecmp(v, "on"))
|
||||
*value = 1;
|
||||
else if (!strcmp(v, "0") || !strcasecmp(v, "no") || !strcasecmp(v, "n") || !strcasecmp(v, "off"))
|
||||
*value = 0;
|
||||
else
|
||||
if ((r = pa_parse_boolean(v)) < 0)
|
||||
return -1;
|
||||
|
||||
*value = r;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue