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);
41 int snd_config_integer_make(snd_config_t **config, char *key);
42 int snd_config_real_make(snd_config_t **config, char *key);
43 int snd_config_string_make(snd_config_t **config, char *key);
44 int snd_config_compound_make(snd_config_t **config, char *key, int join);
46 int snd_config_integer_set(snd_config_t *config, long value);
47 int snd_config_real_set(snd_config_t *config, double value);
48 int snd_config_string_set(snd_config_t *config, char *value);
49 int snd_config_integer_get(snd_config_t *config, long *value);
50 int snd_config_real_get(snd_config_t *config, double *value);
51 int snd_config_string_get(snd_config_t *config, char **value);
53 /* One argument: long, double or char* */
54 int snd_config_set(snd_config_t *config, ...);
55 int snd_config_get(snd_config_t *config, void *);
57 typedef struct list_head *snd_config_iterator_t;
59 #define snd_config_foreach(iterator, node) \
60 assert((node)->type == SND_CONFIG_TYPE_COMPOUND); \
61 for (iterator = (node)->u.compound.fields.next; iterator != &(node)->u.compound.fields; iterator = iterator->next)
63 #define snd_config_entry(iterator) list_entry(iterator, snd_config_t, list)
65 static inline snd_config_type_t snd_config_type(snd_config_t *config)
70 static inline char *snd_config_id(snd_config_t *config)
75 snd_config_t *snd_config;
76 int snd_config_update();