3 SND_CONFIG_TYPE_INTEGER,
5 SND_CONFIG_TYPE_STRING,
6 SND_CONFIG_TYPE_COMPOUND,
9 typedef struct snd_config snd_config_t;
13 snd_config_type_t type;
19 struct list_head fields;
23 struct list_head list;
27 int snd_config_top(snd_config_t **config);
29 int snd_config_load(snd_config_t *config, FILE *fp);
30 int snd_config_save(snd_config_t *config, FILE *fp);
32 int snd_config_search(snd_config_t *config, char *key, snd_config_t **result);
33 int snd_config_searchv(snd_config_t *config,
34 snd_config_t **result, ...);
36 int snd_config_add(snd_config_t *config, snd_config_t *leaf);
37 int snd_config_delete(snd_config_t *config);
39 int snd_config_make(snd_config_t **config, char *key,
40 snd_config_type_t type);
42 int snd_config_integer_set(snd_config_t *config, long value);
43 int snd_config_real_set(snd_config_t *config, double value);
44 int snd_config_string_set(snd_config_t *config, char *value);
45 int snd_config_integer_get(snd_config_t *config, long *value);
46 int snd_config_real_get(snd_config_t *config, double *value);
47 int snd_config_string_get(snd_config_t *config, char **value);
49 /* One argument: long, double or char* */
50 int snd_config_set(snd_config_t *config, ...);
51 int snd_config_get(snd_config_t *config, void *);
53 typedef struct list_head *snd_config_iterator_t;
55 #define snd_config_foreach(iterator, node) \
56 assert((node)->type == SND_CONFIG_TYPE_COMPOUND); \
57 for (iterator = (node)->u.compound.fields.next; iterator != &(node)->u.compound.fields; iterator = iterator->next)
59 #define snd_config_entry(iterator) list_entry(iterator, snd_config_t, list)
61 static inline snd_config_type_t snd_config_type(snd_config_t *config)
66 static inline char *snd_config_id(snd_config_t *config)
71 snd_config_t *snd_config;
72 int snd_config_update();