2 enum _snd_config_type {
3 SND_CONFIG_TYPE_INTEGER,
5 SND_CONFIG_TYPE_STRING,
6 SND_CONFIG_TYPE_COMPOUND,
9 #ifdef SND_ENUM_TYPECHECK
10 typedef struct __snd_config_type *snd_config_type_t;
12 typedef enum _snd_config_type snd_config_type_t;
15 #define SND_CONFIG_TYPE_INTEGER ((snd_config_type_t) SND_CONFIG_TYPE_INTEGER)
16 #define SND_CONFIG_TYPE_REAL ((snd_config_type_t) SND_CONFIG_TYPE_REAL)
17 #define SND_CONFIG_TYPE_STRING ((snd_config_type_t) SND_CONFIG_TYPE_STRING)
18 #define SND_CONFIG_TYPE_COMPOUND ((snd_config_type_t) SND_CONFIG_TYPE_COMPOUND)
20 typedef struct _snd_config snd_config_t;
21 typedef struct _snd_config_iterator *snd_config_iterator_t;
27 snd_config_type_t snd_config_get_type(snd_config_t *config);
28 const char *snd_config_get_id(snd_config_t *config);
30 int snd_config_top(snd_config_t **config);
32 int snd_config_load(snd_config_t *config, snd_input_t *in);
33 int snd_config_save(snd_config_t *config, snd_output_t *out);
35 int snd_config_search(snd_config_t *config, const char *key,
36 snd_config_t **result);
37 int snd_config_searchv(snd_config_t *config,
38 snd_config_t **result, ...);
40 int snd_config_add(snd_config_t *config, snd_config_t *leaf);
41 int snd_config_delete(snd_config_t *config);
43 int snd_config_make(snd_config_t **config, const char *key,
44 snd_config_type_t type);
45 int snd_config_make_integer(snd_config_t **config, const char *key);
46 int snd_config_make_real(snd_config_t **config, const char *key);
47 int snd_config_make_string(snd_config_t **config, const char *key);
48 int snd_config_make_compound(snd_config_t **config, const char *key, int join);
50 int snd_config_set_integer(snd_config_t *config, long value);
51 int snd_config_set_real(snd_config_t *config, double value);
52 int snd_config_set_string(snd_config_t *config, const char *value);
53 int snd_config_get_integer(snd_config_t *config, long *value);
54 int snd_config_get_real(snd_config_t *config, double *value);
55 int snd_config_get_string(snd_config_t *config, const char **value);
57 snd_config_iterator_t snd_config_iterator_first(snd_config_t *node);
58 snd_config_iterator_t snd_config_iterator_next(snd_config_iterator_t iterator);
59 snd_config_iterator_t snd_config_iterator_end(snd_config_t *node);
60 snd_config_t *snd_config_iterator_entry(snd_config_iterator_t iterator);
62 #define snd_config_for_each(pos, next, node) \
63 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))
65 snd_config_type_t snd_config_get_type(snd_config_t *config);
66 const char *snd_config_get_id(snd_config_t *config);
68 extern snd_config_t *snd_config;
69 int snd_config_update();