Linux Packages Manuals » alsa-lib-devel-1.1.1
ALSA project - the C library reference
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
conf.h
Go to the documentation of this file.
1 
11 /*
12  * This library is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License as
14  * published by the Free Software Foundation; either version 2.1 of
15  * the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  */
27 
28 #ifndef __ALSA_CONF_H
29 #define __ALSA_CONF_H
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
43 #define SND_CONFIG_DLSYM_VERSION_EVALUATE _dlsym_config_evaluate_001
44 
45 #define SND_CONFIG_DLSYM_VERSION_HOOK _dlsym_config_hook_001
46 
48 typedef enum _snd_config_type {
62 
69 typedef struct _snd_config snd_config_t;
77 typedef struct _snd_config_iterator *snd_config_iterator_t;
83 typedef struct _snd_config_update snd_config_update_t;
84 
85 extern snd_config_t *snd_config;
86 
87 int snd_config_top(snd_config_t **config);
88 
89 int snd_config_load(snd_config_t *config, snd_input_t *in);
91 int snd_config_save(snd_config_t *config, snd_output_t *out);
92 int snd_config_update(void);
93 int snd_config_update_r(snd_config_t **top, snd_config_update_t **update, const char *path);
96 
98 void snd_config_ref(snd_config_t *top);
100 
101 int snd_config_search(snd_config_t *config, const char *key,
102  snd_config_t **result);
103 int snd_config_searchv(snd_config_t *config,
104  snd_config_t **result, ...);
106  const char *base, const char *key,
107  snd_config_t **result);
108 
109 int snd_config_expand(snd_config_t *config, snd_config_t *root,
110  const char *args, snd_config_t *private_data,
111  snd_config_t **result);
113  snd_config_t *private_data, snd_config_t **result);
114 
115 int snd_config_add(snd_config_t *config, snd_config_t *leaf);
116 int snd_config_delete(snd_config_t *config);
118 int snd_config_copy(snd_config_t **dst, snd_config_t *src);
119 
120 int snd_config_make(snd_config_t **config, const char *key,
121  snd_config_type_t type);
122 int snd_config_make_integer(snd_config_t **config, const char *key);
123 int snd_config_make_integer64(snd_config_t **config, const char *key);
124 int snd_config_make_real(snd_config_t **config, const char *key);
125 int snd_config_make_string(snd_config_t **config, const char *key);
126 int snd_config_make_pointer(snd_config_t **config, const char *key);
127 int snd_config_make_compound(snd_config_t **config, const char *key, int join);
128 
129 int snd_config_imake_integer(snd_config_t **config, const char *key, const long value);
130 int snd_config_imake_integer64(snd_config_t **config, const char *key, const long long value);
131 int snd_config_imake_real(snd_config_t **config, const char *key, const double value);
132 int snd_config_imake_string(snd_config_t **config, const char *key, const char *ascii);
133 int snd_config_imake_safe_string(snd_config_t **config, const char *key, const char *ascii);
134 int snd_config_imake_pointer(snd_config_t **config, const char *key, const void *ptr);
135 
137 
138 int snd_config_set_id(snd_config_t *config, const char *id);
139 int snd_config_set_integer(snd_config_t *config, long value);
140 int snd_config_set_integer64(snd_config_t *config, long long value);
141 int snd_config_set_real(snd_config_t *config, double value);
142 int snd_config_set_string(snd_config_t *config, const char *value);
143 int snd_config_set_ascii(snd_config_t *config, const char *ascii);
144 int snd_config_set_pointer(snd_config_t *config, const void *ptr);
145 int snd_config_get_id(const snd_config_t *config, const char **value);
146 int snd_config_get_integer(const snd_config_t *config, long *value);
147 int snd_config_get_integer64(const snd_config_t *config, long long *value);
148 int snd_config_get_real(const snd_config_t *config, double *value);
149 int snd_config_get_ireal(const snd_config_t *config, double *value);
150 int snd_config_get_string(const snd_config_t *config, const char **value);
151 int snd_config_get_ascii(const snd_config_t *config, char **value);
152 int snd_config_get_pointer(const snd_config_t *config, const void **value);
153 int snd_config_test_id(const snd_config_t *config, const char *id);
154 
155 snd_config_iterator_t snd_config_iterator_first(const snd_config_t *node);
156 snd_config_iterator_t snd_config_iterator_next(const snd_config_iterator_t iterator);
157 snd_config_iterator_t snd_config_iterator_end(const snd_config_t *node);
158 snd_config_t *snd_config_iterator_entry(const snd_config_iterator_t iterator);
159 
177 #define snd_config_for_each(pos, next, node) \
178  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))
179 
180 /* Misc functions */
181 
182 int snd_config_get_bool_ascii(const char *ascii);
183 int snd_config_get_bool(const snd_config_t *conf);
184 int snd_config_get_ctl_iface_ascii(const char *ascii);
185 int snd_config_get_ctl_iface(const snd_config_t *conf);
186 
187 /* Names functions */
188 
192 typedef struct snd_devname snd_devname_t;
193 
197 struct snd_devname {
198  char *name;
199  char *comment;
200  snd_devname_t *next;
201 };
202 
203 int snd_names_list(const char *iface, snd_devname_t **list);
204 void snd_names_list_free(snd_devname_t *list);
205 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #endif /* __ALSA_CONF_H */
int snd_config_update_ref(snd_config_t **top)
Updates snd_config and takes its reference.
Definition: conf.c:3876
Definition: conf.h:54
int snd_config_delete_compound_members(const snd_config_t *config)
Deletes the children of a node.
Definition: conf.c:1892
int snd_config_set_ascii(snd_config_t *config, const char *ascii)
Changes the value of a configuration node.
Definition: conf.c:2447
int snd_config_imake_string(snd_config_t **config, const char *key, const char *ascii)
Creates a string configuration node with the given initial value.
Definition: conf.c:2219
struct _snd_input snd_input_t
Internal structure for an input object.
Definition: input.h:54
Definition: conf.h:58
int snd_config_imake_integer(snd_config_t **config, const char *key, const long value)
Creates an integer configuration node with the given initial value.
Definition: conf.c:2132
Definition: conf.h:60
int snd_config_set_id(snd_config_t *config, const char *id)
Sets the id of a configuration node.
Definition: conf.c:1609
int snd_config_set_string(snd_config_t *config, const char *value)
Changes the value of a string configuration node.
Definition: conf.c:2382
snd_config_iterator_t snd_config_iterator_first(const snd_config_t *node)
Returns an iterator pointing to a node's first child.
Definition: conf.c:3992
int snd_config_evaluate(snd_config_t *config, snd_config_t *root, snd_config_t *private_data, snd_config_t **result)
Evaluates a configuration node at runtime.
Definition: conf.c:4401
int snd_config_make_compound(snd_config_t **config, const char *key, int join)
Creates an empty compound configuration node.
Definition: conf.c:2102
int snd_config_search_definition(snd_config_t *config, const char *base, const char *key, snd_config_t **result)
Searches for a definition in a configuration tree, using aliases and expanding hooks and arguments...
Definition: conf.c:4891
int snd_config_get_bool(const snd_config_t *conf)
Gets the boolean value from a configuration node.
Definition: confmisc.c:116
int snd_config_get_ascii(const snd_config_t *config, char **value)
Returns the value of a configuration node as a string.
Definition: conf.c:2665
int snd_config_copy(snd_config_t **dst, snd_config_t *src)
Creates a copy of a configuration node.
Definition: conf.c:4191
snd_config_iterator_t snd_config_iterator_next(const snd_config_iterator_t iterator)
Returns an iterator pointing to the next sibling.
Definition: conf.c:4012
int snd_config_set_integer(snd_config_t *config, long value)
Changes the value of an integer configuration node.
Definition: conf.c:2313
int snd_config_searchv(snd_config_t *config, snd_config_t **result,...)
Searches for a node in a configuration tree.
Definition: conf.c:3052
void snd_names_list_free(snd_devname_t *list)
This function is unimplemented.
Definition: names.c:53
int snd_config_get_real(const snd_config_t *config, double *value)
Returns the value of a real-number configuration node.
Definition: conf.c:2550
int snd_config_top(snd_config_t **config)
Creates a top level configuration node.
Definition: conf.c:1651
struct _snd_output snd_output_t
Internal structure for an output object.
Definition: output.h:54
int snd_config_update_free(snd_config_update_t *update)
Frees a private update structure.
Definition: conf.c:3938
int snd_config_get_bool_ascii(const char *ascii)
Gets the boolean value from the given ASCII string.
Definition: confmisc.c:88
int snd_config_get_id(const snd_config_t *config, const char **value)
Returns the id of a configuration node.
Definition: conf.c:1587
int snd_config_load(snd_config_t *config, snd_input_t *in)
Loads a configuration tree.
Definition: conf.c:1734
snd_config_t * snd_config_iterator_entry(const snd_config_iterator_t iterator)
Returns the configuration node handle pointed to by an iterator.
Definition: conf.c:4044
int snd_config_imake_integer64(snd_config_t **config, const char *key, const long long value)
Creates a 64-bit-integer configuration node with the given initial value.
Definition: conf.c:2162
int snd_config_make(snd_config_t **config, const char *key, snd_config_type_t type)
Creates a configuration node.
Definition: conf.c:1931
int snd_config_get_integer(const snd_config_t *config, long *value)
Returns the value of an integer configuration node.
Definition: conf.c:2507
Definition: conf.h:50
int snd_config_make_string(snd_config_t **config, const char *key)
Creates a string configuration node.
Definition: conf.c:2037
int snd_config_make_integer(snd_config_t **config, const char *key)
Creates an integer configuration node.
Definition: conf.c:1965
Definition: conf.h:56
int snd_names_list(const char *iface, snd_devname_t **list)
This function is unimplemented.
Definition: names.c:42
int snd_config_imake_pointer(snd_config_t **config, const char *key, const void *ptr)
Creates a pointer configuration node with the given initial value.
Definition: conf.c:2288
void snd_config_unref(snd_config_t *top)
Unreference the config tree.
Definition: conf.c:3925
char * name
Definition: conf.h:198
int snd_config_add(snd_config_t *config, snd_config_t *leaf)
Adds a child to a compound configuration node.
Definition: conf.c:1778
int snd_config_set_pointer(snd_config_t *config, const void *ptr)
Changes the value of a pointer configuration node.
Definition: conf.c:2413
int snd_config_set_integer64(snd_config_t *config, long long value)
Changes the value of a 64-bit-integer configuration node.
Definition: conf.c:2336
int snd_config_make_real(snd_config_t **config, const char *key)
Creates a real number configuration node.
Definition: conf.c:2012
char * comment
Definition: conf.h:199
struct _snd_config_update snd_config_update_t
Internal structure for a configuration private update object.
Definition: conf.h:83
int snd_config_load_override(snd_config_t *config, snd_input_t *in)
Loads a configuration tree and overrides existing configuration nodes.
Definition: conf.c:1749
void snd_config_ref(snd_config_t *top)
Take the reference of the config tree.
Definition: conf.c:3905
snd_config_type_t
Configuration node type.
Definition: conf.h:48
int snd_config_get_pointer(const snd_config_t *config, const void **value)
Returns the value of a pointer configuration node.
Definition: conf.c:2629
snd_config_iterator_t snd_config_iterator_end(const snd_config_t *node)
Returns an iterator that ends a node's children list.
Definition: conf.c:4030
Definition: conf.h:197
int snd_config_search(snd_config_t *config, const char *key, snd_config_t **result)
Searches for a node in a configuration tree.
Definition: conf.c:2961
struct _snd_config snd_config_t
Internal structure for a configuration node object.
Definition: conf.h:69
int snd_config_update(void)
Updates snd_config by rereading the global configuration files (if needed).
Definition: conf.c:3855
int snd_config_make_integer64(snd_config_t **config, const char *key)
Creates a 64-bit-integer configuration node.
Definition: conf.c:1990
int snd_config_delete(snd_config_t *config)
Frees a configuration node.
Definition: conf.c:1838
snd_config_t * snd_config
Configuration top-level node (the global configuration).
Definition: conf.c:3280
int snd_config_save(snd_config_t *config, snd_output_t *out)
Dumps the contents of a configuration node or tree.
Definition: conf.c:2766
int snd_config_make_pointer(snd_config_t **config, const char *key)
Creates a pointer configuration node.
Definition: conf.c:2059
int snd_config_update_free_global(void)
Frees the global configuration tree in snd_config.
Definition: conf.c:3960
int snd_config_expand(snd_config_t *config, snd_config_t *root, const char *args, snd_config_t *private_data, snd_config_t **result)
Expands a configuration node, applying arguments and functions.
Definition: conf.c:4809
int snd_config_get_integer64(const snd_config_t *config, long long *value)
Returns the value of a 64-bit-integer configuration node.
Definition: conf.c:2530
void * ptr
Definition: seq_event.h:199
snd_devname_t * next
Definition: conf.h:200
int snd_config_get_string(const snd_config_t *config, const char **value)
Returns the value of a string configuration node.
Definition: conf.c:2608
int snd_config_test_id(const snd_config_t *config, const char *id)
Compares the id of a configuration node to a given string.
Definition: conf.c:2739
int snd_config_update_r(snd_config_t **top, snd_config_update_t **update, const char *path)
Updates a configuration tree by rereading the configuration files (if needed).
Definition: conf.c:3699
int snd_config_get_ctl_iface(const snd_config_t *conf)
Gets the control interface index from a configuration node.
Definition: confmisc.c:173
int snd_config_get_ireal(const snd_config_t *config, double *value)
Returns the value of a real or integer configuration node.
Definition: conf.c:2573
Definition: conf.h:52
struct _snd_config_iterator * snd_config_iterator_t
Type for a configuration compound iterator.
Definition: conf.h:77
snd_config_type_t snd_config_get_type(const snd_config_t *config)
Returns the type of a configuration node.
Definition: conf.c:1566
int snd_config_set_real(snd_config_t *config, double value)
Changes the value of a real-number configuration node.
Definition: conf.c:2356
int snd_config_get_ctl_iface_ascii(const char *ascii)
Gets the control interface index from the given ASCII string.
Definition: confmisc.c:150
int snd_config_imake_real(snd_config_t **config, const char *key, const double value)
Creates a real number configuration node with the given initial value.
Definition: conf.c:2189

Generated for ALSA project - the C library reference by doxygen 1.8.5