9
9
PulseAudio is free software; you can redistribute it and/or modify
10
10
it under the terms of the GNU Lesser General Public License as published
11
by the Free Software Foundation; either version 2 of the License,
11
by the Free Software Foundation; either version 2.1 of the License,
12
12
or (at your option) any later version.
14
14
PulseAudio is distributed in the hope that it will be useful, but
27
27
/* An abstract parser for simple, line based, shallow configuration
28
28
* files consisting of variable assignments only. */
30
typedef int (*pa_config_parser_cb_t)(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
30
32
/* Wraps info for parsing a specific configuration variable */
31
33
typedef struct pa_config_item {
32
34
const char *lvalue; /* name of the variable */
33
int (*parse)(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata); /* Function that is called to parse the variable's value */
35
pa_config_parser_cb_t parse; /* Function that is called to parse the variable's value */
34
36
void *data; /* Where to store the variable's data */
37
40
/* The configuration file parsing routine. Expects a table of
40
43
int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, void *userdata);
42
45
/* Generic parsers for integers, size_t, booleans and strings */
43
int pa_config_parse_int(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata);
44
int pa_config_parse_size(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata);
45
int pa_config_parse_bool(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata);
46
int pa_config_parse_string(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata);
46
int pa_config_parse_int(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
47
int pa_config_parse_unsigned(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
48
int pa_config_parse_size(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
49
int pa_config_parse_bool(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);
50
int pa_config_parse_string(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata);