2 * \defgroup Config Configuration Interface
3 * Configuration Interface
7 /** dlsym version for config evaluate callback */
8 #define SND_CONFIG_DLSYM_VERSION_EVALUATE _dlsym_config_evaluate_001
9 /** dlsym version for config hook callback */
10 #define SND_CONFIG_DLSYM_VERSION_HOOK _dlsym_config_hook_001
12 /** Config node type */
13 typedef enum _snd_config_type {
15 SND_CONFIG_TYPE_INTEGER,
18 /** Character string */
19 SND_CONFIG_TYPE_STRING,
21 SND_CONFIG_TYPE_COMPOUND,
24 /** Config node handle */
25 typedef struct _snd_config snd_config_t;
26 /** Config compound iterator */
27 typedef struct _snd_config_iterator *snd_config_iterator_t;
33 int snd_config_top(snd_config_t **config);
35 int snd_config_load(snd_config_t *config, snd_input_t *in);
36 int snd_config_save(snd_config_t *config, snd_output_t *out);
38 int snd_config_search(snd_config_t *config, const char *key,
39 snd_config_t **result);
40 int snd_config_searchv(snd_config_t *config,
41 snd_config_t **result, ...);
42 int snd_config_search_definition(snd_config_t *config,
43 const char *base, const char *key,
44 snd_config_t **result);
46 int snd_config_expand(snd_config_t *config, snd_config_t *root,
47 const char *args, void *private_data,
48 snd_config_t **result);
49 int snd_config_evaluate(snd_config_t *config, snd_config_t *root,
50 void *private_data, snd_config_t **result);
52 int snd_config_add(snd_config_t *config, snd_config_t *leaf);
53 int snd_config_delete(snd_config_t *config);
54 int snd_config_copy(snd_config_t **dst, snd_config_t *src);
56 int snd_config_make(snd_config_t **config, const char *key,
57 snd_config_type_t type);
58 int snd_config_make_integer(snd_config_t **config, const char *key);
59 int snd_config_make_real(snd_config_t **config, const char *key);
60 int snd_config_make_string(snd_config_t **config, const char *key);
61 int snd_config_make_compound(snd_config_t **config, const char *key, int join);
63 int snd_config_set_id(snd_config_t *config, const char *id);
64 int snd_config_set_integer(snd_config_t *config, long value);
65 int snd_config_set_real(snd_config_t *config, double value);
66 int snd_config_set_string(snd_config_t *config, const char *value);
67 int snd_config_set_ascii(snd_config_t *config, const char *ascii);
68 int snd_config_get_integer(snd_config_t *config, long *value);
69 int snd_config_get_real(snd_config_t *config, double *value);
70 int snd_config_get_string(snd_config_t *config, const char **value);
71 int snd_config_get_ascii(snd_config_t *config, char **value);
73 snd_config_iterator_t snd_config_iterator_first(snd_config_t *node);
74 snd_config_iterator_t snd_config_iterator_next(snd_config_iterator_t iterator);
75 snd_config_iterator_t snd_config_iterator_end(snd_config_t *node);
76 snd_config_t *snd_config_iterator_entry(snd_config_iterator_t iterator);
78 /** Helper for compound config node leaves traversal
79 * \param pos Current node iterator
80 * \param next Next node iterator
81 * \param node Compound config node
83 * This macro is designed to permit the removal of current node.
85 #define snd_config_for_each(pos, next, node) \
86 for (pos = snd_config_iterator_first(node), next = snd_config_iterator_next(pos); pos != snd_config_iterator_end(node); pos = next, next = snd_config_iterator_next(pos))
88 snd_config_type_t snd_config_get_type(snd_config_t *config);
89 const char *snd_config_get_id(snd_config_t *config);
91 extern snd_config_t *snd_config;
92 int snd_config_update(void);
96 int snd_config_get_bool_ascii(const char *ascii);
97 int snd_config_get_bool(snd_config_t *conf);
98 int snd_config_get_ctl_iface_ascii(const char *ascii);
99 int snd_config_get_ctl_iface(snd_config_t *conf);