alsa-lib/include/conf.h

139 lines
4.8 KiB
C
Raw Normal View History

2001-09-13 11:38:32 +00:00
/**
* \file <alsa/conf.h>
* \brief Application interface library for the ALSA driver
* \author Jaroslav Kysela <perex@suse.cz>
* \author Abramo Bagnara <abramo@alsa-project.org>
* \author Takashi Iwai <tiwai@suse.de>
* \date 1998-2001
*
* Application interface library for the ALSA driver
*
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef __ALSA_CONF_H
#define __ALSA_CONF_H
/**
* \defgroup Config Configuration Interface
* Configuration Interface
* \{
*/
2000-08-24 12:49:51 +00:00
/** dlsym version for config evaluate callback */
#define SND_CONFIG_DLSYM_VERSION_EVALUATE _dlsym_config_evaluate_001
/** dlsym version for config hook callback */
#define SND_CONFIG_DLSYM_VERSION_HOOK _dlsym_config_hook_001
2001-03-25 14:13:55 +00:00
/** Config node type */
typedef enum _snd_config_type {
/** Integer number */
2000-08-24 12:49:51 +00:00
SND_CONFIG_TYPE_INTEGER,
2001-03-25 14:13:55 +00:00
/** Real number */
2000-08-24 12:49:51 +00:00
SND_CONFIG_TYPE_REAL,
2001-03-25 14:13:55 +00:00
/** Character string */
2000-08-24 12:49:51 +00:00
SND_CONFIG_TYPE_STRING,
2001-03-25 14:13:55 +00:00
/** Compound */
2000-08-24 12:49:51 +00:00
SND_CONFIG_TYPE_COMPOUND,
2001-03-25 14:13:55 +00:00
} snd_config_type_t;
2000-08-24 12:49:51 +00:00
2001-03-25 14:13:55 +00:00
/** Config node handle */
2000-11-20 20:10:46 +00:00
typedef struct _snd_config snd_config_t;
2001-03-25 14:13:55 +00:00
/** Config compound iterator */
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
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
int snd_config_search(snd_config_t *config, const char *key,
snd_config_t **result);
int snd_config_searchv(snd_config_t *config,
snd_config_t **result, ...);
int snd_config_search_definition(snd_config_t *config,
const char *base, const char *key,
snd_config_t **result);
2000-08-24 12:49:51 +00:00
int snd_config_expand(snd_config_t *config, snd_config_t *root,
const char *args, void *private_data,
snd_config_t **result);
int snd_config_evaluate(snd_config_t *config, snd_config_t *root,
void *private_data, 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);
int snd_config_copy(snd_config_t **dst, snd_config_t *src);
2000-08-24 12:49:51 +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_id(snd_config_t *config, const char *id);
2001-02-07 11:34:33 +00:00
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_set_ascii(snd_config_t *config, const char *ascii);
2001-02-07 11:34:33 +00:00
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);
int snd_config_get_ascii(snd_config_t *config, char **value);
2001-02-07 11:34:33 +00:00
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
2001-03-25 14:13:55 +00:00
/** Helper for compound config node leaves traversal
* \param pos Current node iterator
* \param next Next node iterator
* \param node Compound config node
*
* This macro is designed to permit the removal of current node.
*/
#define snd_config_for_each(pos, next, node) \
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))
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);
const char *snd_config_get_id(snd_config_t *config);
2000-08-27 16:45:47 +00:00
extern snd_config_t *snd_config;
2001-03-29 17:50:28 +00:00
int snd_config_update(void);
2001-02-07 11:34:33 +00:00
/* Misc functions */
int snd_config_get_bool_ascii(const char *ascii);
int snd_config_get_bool(snd_config_t *conf);
int snd_config_get_ctl_iface_ascii(const char *ascii);
int snd_config_get_ctl_iface(snd_config_t *conf);
2001-02-07 11:34:33 +00:00
#ifdef __cplusplus
}
#endif
/** \} */
2001-09-13 11:38:32 +00:00
#endif /* __ALSA_CONF_H */