Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

conf.c File Reference

Configuration helper functions. More...


Data Structures

struct  _snd_config_update
struct  finfo

Defines

#define ALSA_CONFIG_PATH_VAR   "ALSA_CONFIG_PATH"
#define ALSA_CONFIG_PATH_DEFAULT   DATADIR "/alsa/alsa.conf"

Functions

int snd_config_substitute (snd_config_t *dst, snd_config_t *src)
 Substitutes one configuration node to another.

int snd_config_get_type_ascii (const char *ascii, snd_config_type_t *type)
 Converts an ASCII string to a configuration node type.

snd_config_type_t snd_config_get_type (const snd_config_t *config)
 Returns the type of a configuration node.

int snd_config_get_id (const snd_config_t *config, const char **id)
 Returns the id of a configuration node.

int snd_config_set_id (snd_config_t *config, const char *id)
 Sets the id of a configuration node.

int snd_config_top (snd_config_t **config)
 Creates a top level configuration node.

int snd_config_load (snd_config_t *config, snd_input_t *in)
 Loads a configuration tree.

int snd_config_load_override (snd_config_t *config, snd_input_t *in)
 Loads a configuration tree and overrides existing configuration nodes.

int snd_config_add (snd_config_t *father, snd_config_t *leaf)
 Adds a child to a compound configuration node.

int snd_config_remove (snd_config_t *config)
 Removes a configuration node from its tree.

int snd_config_delete (snd_config_t *config)
 Deletes a configuration node (freeing all its related resources).

int snd_config_delete_compound_members (const snd_config_t *config)
 Deletes the children of a compound configuration node (freeing all its related resources).

int snd_config_make (snd_config_t **config, const char *id, snd_config_type_t type)
 Creates a configuration node.

int snd_config_make_integer (snd_config_t **config, const char *id)
 Creates an integer configuration node.

int snd_config_make_integer64 (snd_config_t **config, const char *id)
 Creates an integer64 configuration node.

int snd_config_make_real (snd_config_t **config, const char *id)
 Creates a real configuration node.

int snd_config_make_string (snd_config_t **config, const char *id)
 Creates a string configuration node.

int snd_config_make_pointer (snd_config_t **config, const char *id)
 Creates a pointer configuration node.

int snd_config_make_compound (snd_config_t **config, const char *id, int join)
 Creates an empty compound configuration node.

int snd_config_imake_integer (snd_config_t **config, const char *id, const long value)
 Creates an integer configuration node with the given initial value.

int snd_config_imake_integer64 (snd_config_t **config, const char *id, const long long value)
 Creates an integer configuration node with the given initial value.

int snd_config_imake_real (snd_config_t **config, const char *id, const double value)
 Creates a real configuration node with the given initial value.

int snd_config_imake_string (snd_config_t **config, const char *id, const char *value)
 Creates a string configuration node with the given initial value.

int snd_config_imake_pointer (snd_config_t **config, const char *id, const void *value)
 Creates a pointer configuration node with the given initial value.

int snd_config_set_integer (snd_config_t *config, long value)
 Changes the value of an integer configuration node.

int snd_config_set_integer64 (snd_config_t *config, long long value)
 Changes the value of an integer64 configuration node.

int snd_config_set_real (snd_config_t *config, double value)
 Changes the value of a real configuration node.

int snd_config_set_string (snd_config_t *config, const char *value)
 Changes the value of a string configuration node.

int snd_config_set_pointer (snd_config_t *config, const void *value)
 Changes the value of a pointer configuration node.

int snd_config_set_ascii (snd_config_t *config, const char *ascii)
 Changes the value of a configuration node.

int snd_config_get_integer (const snd_config_t *config, long *ptr)
 Returns the value of an integer configuration node.

int snd_config_get_integer64 (const snd_config_t *config, long long *ptr)
 Returns the value of an integer64 configuration node.

int snd_config_get_real (const snd_config_t *config, double *ptr)
 Returns the value of a real configuration node.

int snd_config_get_ireal (const snd_config_t *config, double *ptr)
 Returns the value of a real or integer configuration node.

int snd_config_get_string (const snd_config_t *config, const char **ptr)
 Returns the value of a string configuration node.

int snd_config_get_pointer (const snd_config_t *config, const void **ptr)
 Returns the value of a pointer configuration node.

int snd_config_get_ascii (const snd_config_t *config, char **ascii)
 Returns the value of a configuration node as a string.

int snd_config_test_id (const snd_config_t *config, const char *id)
 Compares the id of a configuration node to a given string.

int snd_config_save (snd_config_t *config, snd_output_t *out)
 Dumps the contents of a configuration node or tree.

int snd_config_search (snd_config_t *config, const char *key, snd_config_t **result)
 Searches for a node in a configuration tree.

int snd_config_searcha (snd_config_t *root, snd_config_t *config, const char *key, snd_config_t **result)
 Searches for a node in a configuration tree, expanding aliases.

int snd_config_searchv (snd_config_t *config, snd_config_t **result,...)
 Searches for a node in a configuration tree.

int snd_config_searchva (snd_config_t *root, snd_config_t *config, snd_config_t **result,...)
 Searches for a node in a configuration tree, expanding aliases.

int snd_config_search_alias (snd_config_t *config, const char *base, const char *key, snd_config_t **result)
 Searches for a node in a configuration tree, using an alias.

int snd_config_search_hooks (snd_config_t *config, const char *key, snd_config_t **result)
 Searches for a node in a configuration tree and expands hooks.

int snd_config_searcha_hooks (snd_config_t *root, snd_config_t *config, const char *key, snd_config_t **result)
 Searches for a node in a configuration tree, expanding aliases and hooks.

int snd_config_searchva_hooks (snd_config_t *root, snd_config_t *config, snd_config_t **result,...)
 Searches for a node in a configuration tree, expanding aliases and hooks.

int snd_config_search_alias_hooks (snd_config_t *config, const char *base, const char *key, snd_config_t **result)
 Searches for a node in a configuration tree, using an alias and expanding hooks.

int snd_config_hook_load (snd_config_t *root, snd_config_t *config, snd_config_t **dst, snd_config_t *private_data)
 Loads and parses the given configurations files.

int snd_config_hook_load_for_all_cards (snd_config_t *root, snd_config_t *config, snd_config_t **dst, snd_config_t *private_data ATTRIBUTE_UNUSED)
 Loads and parses the given configurations files for each installed sound card.

int snd_config_update_r (snd_config_t **_top, snd_config_update_t **_update, const char *cfgs)
 Updates a configuration tree by rereading the configuration files (if needed).

int snd_config_update (void)
 Updates snd_config by rereading the global configuration files (if needed).

int snd_config_update_free (snd_config_update_t *update)
 Frees a private update structure.

int snd_config_update_free_global (void)
 Frees the global configuration tree in snd_config.

snd_config_iterator_t snd_config_iterator_first (const snd_config_t *node)
 Returns an iterator pointing to the first child of a compound configuration node.

snd_config_iterator_t snd_config_iterator_next (const snd_config_iterator_t iterator)
 Returns an iterator pointing to the next sibling.

snd_config_iterator_t snd_config_iterator_end (const snd_config_t *node)
 Returns an iterator pointing past the last child of a compound configuration node.

snd_config_tsnd_config_iterator_entry (const snd_config_iterator_t iterator)
 Returns the configuration node handle pointed to by an iterator.

int snd_config_copy (snd_config_t **dst, snd_config_t *src)
 Creates a copy of a configuration node.

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.

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.

int snd_config_search_definition (snd_config_t *config, const char *base, const char *name, snd_config_t **result)
 Searches for a definition in a configuration tree, using aliases and expanding hooks and arguments.


Variables

snd_config_tsnd_config = NULL


Detailed Description

Configuration helper functions.

Author:
Abramo Bagnara <abramo@alsa-project.org> , Jaroslav Kysela <perex@suse.cz>
Date:
2000-2001
Tree based, full nesting configuration functions.

See the Configuration files page for more details.


Define Documentation

#define ALSA_CONFIG_PATH_DEFAULT   DATADIR "/alsa/alsa.conf"
 

The name of the default files used by snd_config_update.

#define ALSA_CONFIG_PATH_VAR   "ALSA_CONFIG_PATH"
 

The name of the environment variable containing the files list for snd_config_update.


Function Documentation

int snd_config_add snd_config_t   father,
snd_config_t   leaf
 

Adds a child to a compound configuration node.

Parameters:
father  Handle to the compound configuration node.
leaf  Handle to the configuration node to be added to father.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_copy snd_config_t **    dst,
snd_config_t   src
 

Creates a copy of a configuration node.

Parameters:
dst  The function puts the handle to the new configuration node at the address specified by dst.
src  Handle to the source configuration node.
Returns:
A non-negative value if successful, otherwise a negative error code.

int snd_config_delete snd_config_t   config
 

Deletes a configuration node (freeing all its related resources).

Parameters:
config  Handle to the configuration node to be deleted.
Returns:
Zero if successful, otherwise a negative error code.
If the node is a child node, it is removed from the tree before being deleted. If the node is a compound node, all children are deleted recursively.

int snd_config_delete_compound_members const snd_config_t   config
 

Deletes the children of a compound configuration node (freeing all its related resources).

Parameters:
config  Handle to the compound configuration node.
Returns:
Zero if successful, otherwise a negative error code.
Any compound nodes among the children of config are deleted recursively.

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.

Parameters:
config  Handle to the source configuration node.
root  Handle to the root of the source configuration.
private_data  Handle to the private data node for runtime evaluation.
result  The function puts the handle to the result node at the address specified by result. result is NULL for in-place evaluation.
Returns:
A non-negative value if successful, otherwise a negative error code.
Note:
Only in-place evaluation is currently implemented.

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.

Parameters:
config  Handle to the configuration node.
root  Handle to the root configuration node.
args  Arguments string (optional).
private_data  Handle to the private data node for functions.
result  The function puts the handle to the result configuration node at the address specified by result.
Returns:
A non-negative value if successful, otherwise a negative error code.

int snd_config_get_ascii const snd_config_t   config,
char **    ascii
 

Returns the value of a configuration node as a string.

Parameters:
config  Handle to the configuration node.
ascii  The function puts the pointer to the returned string at the address specified by ascii.
Returns:
Zero if successful, otherwise a negative error code.
This function dynamically allocates the returned string. The application is responsible for deleting it with free() when it is no longer used.

int snd_config_get_id const snd_config_t   config,
const char **    id
 

Returns the id of a configuration node.

Parameters:
config  Handle to the configuration node.
id  The function puts the pointer to the id string at the address specified by id.
Returns:
Zero if successful, otherwise a negative error code.
The returned string is owned by the configuration node; the application must not modify or delete it.

int snd_config_get_integer const snd_config_t   config,
long *    ptr
 

Returns the value of an integer configuration node.

Parameters:
config  Handle to the configuration node.
ptr  The function puts the node's value at the address specified by ptr.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_get_integer64 const snd_config_t   config,
long long *    ptr
 

Returns the value of an integer64 configuration node.

Parameters:
config  Handle to the configuration node.
ptr  The function puts the node's value at the address specified by ptr.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_get_ireal const snd_config_t   config,
double *    ptr
 

Returns the value of a real or integer configuration node.

Parameters:
config  Handle to the configuration node.
ptr  The function puts the node's value at the address specified by ptr.
Returns:
Zero if successful, otherwise a negative error code.
If the node's type is integer or integer64, the value is converted to the double type on the fly.

int snd_config_get_pointer const snd_config_t   config,
const void **    ptr
 

Returns the value of a pointer configuration node.

Parameters:
config  Handle to the configuration node.
ptr  The function puts the node's value at the address specified by ptr.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_get_real const snd_config_t   config,
double *    ptr
 

Returns the value of a real configuration node.

Parameters:
config  Handle to the configuration node.
ptr  The function puts the node's value at the address specified by ptr.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_get_string const snd_config_t   config,
const char **    ptr
 

Returns the value of a string configuration node.

Parameters:
config  Handle to the configuration node.
ptr  The function puts the node's value at the address specified by ptr.
Returns:
Zero if successful, otherwise a negative error code.
The returned string is owned by the configuration node; the application must not modify or delete it.

snd_config_type_t snd_config_get_type const snd_config_t   config
 

Returns the type of a configuration node.

Parameters:
config  Handle to the configuration node.
Returns:
The node's type.

int snd_config_get_type_ascii const char *    ascii,
snd_config_type_t   type
 

Converts an ASCII string to a configuration node type.

Parameters:
ascii  A string containing a configuration node type.
type  The function puts the node type at the address specified by type.
Returns:
Zero if successgul, otherwise a negative error code.

int snd_config_hook_load snd_config_t   root,
snd_config_t   config,
snd_config_t **    dst,
snd_config_t   private_data
 

Loads and parses the given configurations files.

Parameters:
root  Handle to the root configuration node.
config  Handle to the configuration node for this hook.
dst  The function puts the handle to the configuration node loaded from the file(s) at the address specified by dst.
private_data  Handle to the private data configuration node.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_hook_load_for_all_cards snd_config_t   root,
snd_config_t   config,
snd_config_t **    dst,
snd_config_t *private_data    ATTRIBUTE_UNUSED
 

Loads and parses the given configurations files for each installed sound card.

Parameters:
root  Handle to the root configuration node.
config  Handle to the configuration node for this hook.
dst  The function puts the handle to the configuration node loaded from the file(s) at the address specified by dst.
private_data  Handle to the private data configuration node.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_imake_integer snd_config_t **    config,
const char *    id,
const long    value
 

Creates an integer configuration node with the given initial value.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
value  The initial value of the new node.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_imake_integer64 snd_config_t **    config,
const char *    id,
const long long    value
 

Creates an integer configuration node with the given initial value.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
value  The initial value of the new node.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_imake_pointer snd_config_t **    config,
const char *    id,
const void *    value
 

Creates a pointer configuration node with the given initial value.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
value  The initial value of the new node. May be NULL.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_imake_real snd_config_t **    config,
const char *    id,
const double    value
 

Creates a real configuration node with the given initial value.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
value  The initial value of the new node.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_imake_string snd_config_t **    config,
const char *    id,
const char *    value
 

Creates a string configuration node with the given initial value.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
value  The initial value of the new node. May be NULL.
Returns:
Zero if successful, otherwise a negative error code.
This function creates the new node with its own copy of the passed string.

snd_config_iterator_t snd_config_iterator_end const snd_config_t   node
 

Returns an iterator pointing past the last child of a compound configuration node.

Parameters:
node  Handle to the compound configuration node.
Returns:
An iterator pointing past the last child of node.

snd_config_t* snd_config_iterator_entry const snd_config_iterator_t    iterator
 

Returns the configuration node handle pointed to by an iterator.

Parameters:
iterator  A configuration node iterator.
Returns:
The configuration node handle pointed to by iterator.

snd_config_iterator_t snd_config_iterator_first const snd_config_t   node
 

Returns an iterator pointing to the first child of a compound configuration node.

Parameters:
node  Handle to the compound configuration node.
Returns:
An iterator pointing to the first child.

snd_config_iterator_t snd_config_iterator_next const snd_config_iterator_t    iterator
 

Returns an iterator pointing to the next sibling.

Parameters:
iterator  An iterator pointing to a child configuration node.
Returns:
An iterator pointing to the next sibling of iterator. If iterator is the last sibling, the returned value is the same as the result of calling snd_config_iterator_end on the father of the nodes.

int snd_config_load snd_config_t   config,
snd_input_t   in
 

Loads a configuration tree.

Parameters:
config  Handle to a top level configuration node.
in  Input handle to read the configuration from.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_load_override snd_config_t   config,
snd_input_t   in
 

Loads a configuration tree and overrides existing configuration nodes.

Parameters:
config  Handle to a top level configuration node.
in  Input handle to read the configuration from.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_make snd_config_t **    config,
const char *    id,
snd_config_type_t    type
 

Creates a configuration node.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
type  The type of the new node.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_make_compound snd_config_t **    config,
const char *    id,
int    join
 

Creates an empty compound configuration node.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
join  Join flag. This is checked in snd_config_save to change look. (Huh?)
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_make_integer snd_config_t **    config,
const char *    id
 

Creates an integer configuration node.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
Returns:
Zero if successful, otherwise a negative error code.
The value of the new node is 0.

int snd_config_make_integer64 snd_config_t **    config,
const char *    id
 

Creates an integer64 configuration node.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
Returns:
Zero if successful, otherwise a negative error code.
The value of the new node is 0.

int snd_config_make_pointer snd_config_t **    config,
const char *    id
 

Creates a pointer configuration node.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
Returns:
Zero if successful, otherwise a negative error code.
The value of the new node is NULL.

int snd_config_make_real snd_config_t **    config,
const char *    id
 

Creates a real configuration node.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
Returns:
Zero if successful, otherwise a negative error code.
The value of the new node is 0.0.

int snd_config_make_string snd_config_t **    config,
const char *    id
 

Creates a string configuration node.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
id  The id of the new node.
Returns:
Zero if successful, otherwise a negative error code.
The value of the new node is NULL.

int snd_config_remove snd_config_t   config
 

Removes a configuration node from its tree.

Parameters:
config  Handle to the configuration node to be removed.
Returns:
Zero if successful, otherwise a negative error code.
This functions does not delete the removed node.

int snd_config_save snd_config_t   config,
snd_output_t   out
 

Dumps the contents of a configuration node or tree.

Parameters:
config  Handle to the (root) configuration node.
out  Output handle.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_search snd_config_t   config,
const char *    key,
snd_config_t **    result
 

Searches for a node in a configuration tree.

Parameters:
config  Handle to the root of the configuration (sub)tree to search.
key  Search key: one or more node keys, separated with dots.
result  The function puts the handle to the node found at the address specified by result.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_search_alias snd_config_t   config,
const char *    base,
const char *    key,
snd_config_t **    result
 

Searches for a node in a configuration tree, using an alias.

Parameters:
config  Handle to the root of the configuration (sub)tree to search.
base  Search key base, or NULL.
key  Search key suffix.
result  The function puts the handle to the node found at the address specified by result.
Returns:
Zero if successful, otherwise a negative error code.
First key is tried, then, if nothing is found, base.key is tried. If the value found is a string, this is recursively tried in the same way.

int snd_config_search_alias_hooks snd_config_t   config,
const char *    base,
const char *    key,
snd_config_t **    result
 

Searches for a node in a configuration tree, using an alias and expanding hooks.

Parameters:
config  Handle to the root of the configuration (sub)tree to search.
base  Search key base, or NULL.
key  Search key suffix.
result  The function puts the handle to the node found at the address specified by result.
Returns:
Zero if successful, otherwise a negative error code.
First key is tried, then, if nothing is found, base.key is tried. If the value found is a string, this is recursively tried in the same way.

int snd_config_search_definition snd_config_t   config,
const char *    base,
const char *    name,
snd_config_t **    result
 

Searches for a definition in a configuration tree, using aliases and expanding hooks and arguments.

Parameters:
config  Handle to the configuration (sub)tree to search.
base  Implicit key base, or NULL for none.
key  Key suffix.
result  The function puts the handle to the expanded found node at the address specified by result.
Returns:
Zero if successful, otherwise a negative error code.
First the key is tried, then, if nothing is found, base.key is tried. If the value found is a string, this is recursively tried in the same way.

If key contains a dot (.), the implicit base is ignored and the key starts from the root given by config.

int snd_config_search_hooks snd_config_t   config,
const char *    key,
snd_config_t **    result
 

Searches for a node in a configuration tree and expands hooks.

Parameters:
config  Handle to the root of the configuration (sub)tree to search.
key  Search key: one or more node keys, separated with dots.
result  The function puts the handle to the node found at the address specified by result.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_searcha snd_config_t   root,
snd_config_t   config,
const char *    key,
snd_config_t **    result
 

Searches for a node in a configuration tree, expanding aliases.

Parameters:
root  Handle to the root configuration node containing alias definitions.
config  Handle to the root of the configuration (sub)tree to search.
key  Search key: one or more node keys, separated with dots.
result  The function puts the handle to the node found at the address specified by result.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_searcha_hooks snd_config_t   root,
snd_config_t   config,
const char *    key,
snd_config_t **    result
 

Searches for a node in a configuration tree, expanding aliases and hooks.

Parameters:
root  Handle to the root configuration node containing alias definitions.
config  Handle to the root of the configuration (sub)tree to search.
key  Search key: one or more node keys, separated with dots.
result  The function puts the handle to the node found at the address specified by result.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_searchv snd_config_t   config,
snd_config_t **    result,
...   
 

Searches for a node in a configuration tree.

Parameters:
config  Handle to the root of the configuration (sub)tree to search.
result  The function puts the handle to the node found at the address specified by result.
...  One or more concatenated dot separated search keys, terminated with NULL.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_searchva snd_config_t   root,
snd_config_t   config,
snd_config_t **    result,
...   
 

Searches for a node in a configuration tree, expanding aliases.

Parameters:
root  Handle to the root configuration node containing alias definitions.
config  Handle to the root of the configuration (sub)tree to search.
result  The function puts the handle to the node found at the address specified by result.
...  One or more concatenated dot separated search keys, terminated with NULL.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_searchva_hooks snd_config_t   root,
snd_config_t   config,
snd_config_t **    result,
...   
 

Searches for a node in a configuration tree, expanding aliases and hooks.

Parameters:
root  Handle to the root configuration node containing alias definitions.
config  Handle to the root of the configuration (sub)tree to search.
result  The function puts the handle to the node found at the address specified by result.
...  One or more concatenated dot separated search keys, terminated with NULL.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_set_ascii snd_config_t   config,
const char *    ascii
 

Changes the value of a configuration node.

Parameters:
config  Handle to the configuration node.
ascii  The new value for the node as an ASCII string. ascii must not be NULL, not even for a string node.
Returns:
Zero if successful, otherwise a negative error code.
The node must have a simple type, and the new value must have the same type.

Bug:
For string nodes, changing the length of the string doesn't work.

int snd_config_set_id snd_config_t   config,
const char *    id
 

Sets the id of a configuration node.

Parameters:
config  Handle to the configuration node.
id  The new node id.
Returns:
Zero if successful, otherwise a negative error code.
Bug:
id must not be a pointer to the node's current id.

int snd_config_set_integer snd_config_t   config,
long    value
 

Changes the value of an integer configuration node.

Parameters:
config  Handle to the configuration node.
value  The new value for the node.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_set_integer64 snd_config_t   config,
long long    value
 

Changes the value of an integer64 configuration node.

Parameters:
config  Handle to the configuration node.
value  The new value for the node.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_set_pointer snd_config_t   config,
const void *    value
 

Changes the value of a pointer configuration node.

Parameters:
config  Handle to the configuration node.
value  The new value for the node. May be NULL.
Returns:
Zero if successful, otherwise a negative error code.
This function does not free the old pointer in the node.

int snd_config_set_real snd_config_t   config,
double    value
 

Changes the value of a real configuration node.

Parameters:
config  Handle to the configuration node.
value  The new value for the node.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_set_string snd_config_t   config,
const char *    value
 

Changes the value of a string configuration node.

Parameters:
config  Handle to the configuration node.
value  The new value for the node. May be NULL.
Returns:
Zero if successful, otherwise a negative error code.
This function deletes the old string in the node and stores a copy of the passed string in the node.

Bug:
value must not be a pointer to the node's current value.

int snd_config_substitute snd_config_t   dst,
snd_config_t   src
 

Substitutes one configuration node to another.

Parameters:
dst  Handle to the destination node.
src  Handle to the source node. Must not be the same as dst.
Returns:
Zero if successful, otherwise a negative error code.
If both nodes are compounds, the source compound node members are appended to the destination compound node.

If the destination node is a compound and the source node is an ordinary type, the compound members are deleted (including their contents).

A successful call to this function invalidates the source node.

int snd_config_test_id const snd_config_t   config,
const char *    id
 

Compares the id of a configuration node to a given string.

Parameters:
config  Handle to the configuration node.
id  ASCII id.
Returns:
The same value as the result of the strcmp function.

int snd_config_top snd_config_t **    config
 

Creates a top level configuration node.

Parameters:
config  The function puts the handle to the new node at the address specified by config.
Returns:
Zero if successful, otherwise a negative error code.
The returned node is a compound node.

int snd_config_update void   
 

Updates snd_config by rereading the global configuration files (if needed).

Returns:
A non-negative value if successful, otherwise a negative error code.
Return values:
0  No action is needed.
1  The configuration tree has been rebuilt.
The global configuration files are specified in the environment variable ALSA_CONFIG_PATH. If this is not set, the default value is "/usr/share/alsa/alsa.conf".

Warning:
If the configuration tree is reread, all string pointers and configuration node handles previously obtained from this tree become invalid.

int snd_config_update_free snd_config_update_t   update
 

Frees a private update structure.

Parameters:
update  The private update structure to free.
Returns:
Zero if successful, otherwise a negative error code.

int snd_config_update_free_global void   
 

Frees the global configuration tree in snd_config.

Returns:
Zero if successful, otherwise a negative error code.

int snd_config_update_r snd_config_t **    _top,
snd_config_update_t **    _update,
const char *    cfgs
 

Updates a configuration tree by rereading the configuration files (if needed).

Parameters:
top  Address of the handle to the top level node.
update  Address of a pointer to private update information.
cfgs  A list of configuration file names, delimited with ':'. If cfgs is set to NULL, the default global configuration file is used ("/usr/share/alsa/alsa.conf").
Returns:
A non-negative value if successful, otherwise a negative error code.
Return values:
0  No action is needed.
1  The configuration tree has been rebuilt.
The global configuration files are specified in the environment variable ALSA_CONFIG_PATH.

Warning:
If the configuration tree is reread, all string pointers and configuration node handles previously obtained from this tree become invalid.


Variable Documentation

snd_config_t* snd_config = NULL
 

Configuration top level node (the global configuration).


Generated on Wed Feb 19 12:45:33 2003 for ALSA project - the C library reference by doxygen1.2.18