2000-08-24 12:49:51 +00:00
|
|
|
|
2001-02-05 15:44:42 +00:00
|
|
|
enum _snd_config_type {
|
2000-08-24 12:49:51 +00:00
|
|
|
SND_CONFIG_TYPE_INTEGER,
|
|
|
|
SND_CONFIG_TYPE_REAL,
|
|
|
|
SND_CONFIG_TYPE_STRING,
|
|
|
|
SND_CONFIG_TYPE_COMPOUND,
|
2001-02-05 15:44:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef SND_ENUM_TYPECHECK
|
|
|
|
typedef struct __snd_config_type *snd_config_type_t;
|
|
|
|
#else
|
|
|
|
typedef enum _snd_config_type snd_config_type_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define SND_CONFIG_TYPE_INTEGER ((snd_config_type_t) SND_CONFIG_TYPE_INTEGER)
|
|
|
|
#define SND_CONFIG_TYPE_REAL ((snd_config_type_t) SND_CONFIG_TYPE_REAL)
|
|
|
|
#define SND_CONFIG_TYPE_STRING ((snd_config_type_t) SND_CONFIG_TYPE_STRING)
|
|
|
|
#define SND_CONFIG_TYPE_COMPOUND ((snd_config_type_t) SND_CONFIG_TYPE_COMPOUND)
|
2000-08-24 12:49:51 +00:00
|
|
|
|
2000-11-20 20:10:46 +00:00
|
|
|
typedef struct _snd_config snd_config_t;
|
2001-02-07 11:34:33 +00:00
|
|
|
typedef struct _snd_config_iterator *snd_config_iterator_t;
|
2000-08-24 12:49:51 +00:00
|
|
|
|
2001-02-07 11:34:33 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2001-01-17 11:00:32 +00:00
|
|
|
|
2001-02-07 11:34:33 +00:00
|
|
|
snd_config_type_t snd_config_get_type(snd_config_t *config);
|
|
|
|
char *snd_config_get_id(snd_config_t *config);
|
2001-01-17 11:00:32 +00:00
|
|
|
|
2000-08-24 17:07:44 +00:00
|
|
|
int snd_config_top(snd_config_t **config);
|
2000-08-24 12:49:51 +00:00
|
|
|
|
2001-01-17 11:00:32 +00:00
|
|
|
int snd_config_load(snd_config_t *config, snd_input_t *in);
|
|
|
|
int snd_config_save(snd_config_t *config, snd_output_t *out);
|
2000-08-24 12:49:51 +00:00
|
|
|
|
2001-02-06 23:48:10 +00:00
|
|
|
int snd_config_search(snd_config_t *config, const char *key,
|
|
|
|
snd_config_t **result);
|
2000-08-24 17:07:44 +00:00
|
|
|
int snd_config_searchv(snd_config_t *config,
|
|
|
|
snd_config_t **result, ...);
|
2000-08-24 12:49:51 +00:00
|
|
|
|
|
|
|
int snd_config_add(snd_config_t *config, snd_config_t *leaf);
|
|
|
|
int snd_config_delete(snd_config_t *config);
|
|
|
|
|
2001-02-06 23:48:10 +00:00
|
|
|
int snd_config_make(snd_config_t **config, const char *key,
|
2000-08-24 12:49:51 +00:00
|
|
|
snd_config_type_t type);
|
2001-02-07 11:34:33 +00:00
|
|
|
int snd_config_make_integer(snd_config_t **config, const char *key);
|
|
|
|
int snd_config_make_real(snd_config_t **config, const char *key);
|
|
|
|
int snd_config_make_string(snd_config_t **config, const char *key);
|
|
|
|
int snd_config_make_compound(snd_config_t **config, const char *key, int join);
|
|
|
|
|
|
|
|
int snd_config_set_integer(snd_config_t *config, long value);
|
|
|
|
int snd_config_set_real(snd_config_t *config, double value);
|
|
|
|
int snd_config_set_string(snd_config_t *config, const char *value);
|
|
|
|
int snd_config_get_integer(snd_config_t *config, long *value);
|
|
|
|
int snd_config_get_real(snd_config_t *config, double *value);
|
|
|
|
int snd_config_get_string(snd_config_t *config, const char **value);
|
|
|
|
|
|
|
|
snd_config_iterator_t snd_config_iterator_first(snd_config_t *node);
|
|
|
|
snd_config_iterator_t snd_config_iterator_next(snd_config_iterator_t iterator);
|
|
|
|
snd_config_iterator_t snd_config_iterator_end(snd_config_t *node);
|
|
|
|
snd_config_t *snd_config_iterator_entry(snd_config_iterator_t iterator);
|
2000-08-24 12:49:51 +00:00
|
|
|
|
|
|
|
#define snd_config_foreach(iterator, node) \
|
2001-02-07 11:34:33 +00:00
|
|
|
for (iterator = snd_config_iterator_first(node); iterator != snd_config_iterator_end(node); iterator = snd_config_iterator_next(iterator))
|
2000-08-24 12:49:51 +00:00
|
|
|
|
2001-02-07 11:34:33 +00:00
|
|
|
snd_config_type_t snd_config_get_type(snd_config_t *config);
|
|
|
|
char *snd_config_get_id(snd_config_t *config);
|
2000-08-24 17:07:44 +00:00
|
|
|
|
2000-08-27 16:45:47 +00:00
|
|
|
extern snd_config_t *snd_config;
|
2000-08-24 17:07:44 +00:00
|
|
|
int snd_config_update();
|
2001-02-07 11:34:33 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|