diff --git a/doc/doxygen.cfg.in b/doc/doxygen.cfg.in index 1a5dbf56..5333f6da 100644 --- a/doc/doxygen.cfg.in +++ b/doc/doxygen.cfg.in @@ -36,6 +36,7 @@ INPUT = @top_srcdir@/doc/index.doxygen \ @top_srcdir@/src/input.c \ @top_srcdir@/src/output.c \ @top_srcdir@/src/conf.c \ + @top_srcdir@/src/confeval.c \ @top_srcdir@/src/confmisc.c \ @top_srcdir@/src/names.c \ @top_srcdir@/src/shmarea.c \ diff --git a/include/conf.h b/include/conf.h index 800707d9..09da0e9a 100644 --- a/include/conf.h +++ b/include/conf.h @@ -33,7 +33,7 @@ extern "C" { #endif /** - * \defgroup Config Configuration Interface + * \defgroup Configuration Configuration Interface * The configuration functions and types allow you to read, enumerate, * modify and write the contents of ALSA configuration files. * \{ @@ -109,6 +109,16 @@ int snd_config_search_definition(snd_config_t *config, const char *base, const char *key, snd_config_t **result); +/** + * \brief custom expansion callback + * \param[out] dst The function puts the handle to the new configuration + * node at the address specified by \a dst. + * \param[in] s string the string to be expanded + * \param[in] private_data Handle to the \c private_data node. + * \return A non-negative value if successful, otherwise a negative error code. + * + * Use a function of this type to define a custom expansion + */ typedef int (*snd_config_expand_fcn_t)(snd_config_t **dst, const char *s, void *private_data); int snd_config_expand_custom(snd_config_t *config, snd_config_t *root, diff --git a/src/conf.c b/src/conf.c index 9887d0e9..eca44c03 100644 --- a/src/conf.c +++ b/src/conf.c @@ -527,7 +527,7 @@ static inline void snd_config_unlock(void) { } #endif /* - * Add a diretory to the paths to search included files. + * Add a directory to the paths to search included files. * param fd - File object that owns these paths to search files included by it. * param dir - Path of the directory to add. Allocated externally and need to * be freed manually later. @@ -584,6 +584,8 @@ static void free_include_paths(struct filedesc *fd) } } +#endif /* DOC_HIDDEN */ + /** * \brief Returns the default top-level config directory * \return The top-level config directory path string @@ -605,6 +607,8 @@ const char *snd_config_topdir(void) return topdir; } +#ifndef DOC_HIDDEN + static char *_snd_config_path(const char *name) { const char *root = snd_config_topdir(); @@ -1700,7 +1704,7 @@ static int _snd_config_save_children(snd_config_t *config, snd_output_t *out, } return 0; } -#endif +#endif /* DOC_HIDDEN */ /** @@ -2873,6 +2877,26 @@ int snd_config_imake_string(snd_config_t **config, const char *id, const char *v return 0; } +/** + * \brief Creates a string configuration node with the given initial value. + * \param[out] config The function puts the handle to the new node at + * the address specified by \a config. + * \param[in] id The id of the new node. + * \param[in] value The initial value of the new node. May be \c NULL. + * \return Zero if successful, otherwise a negative error code. + * + * This function creates a new node of type #SND_CONFIG_TYPE_STRING. The node + * contains with a copy of the string \c value, replacing any character other + * than alphanumeric, space, or '-' with the character '_'. + * + * \par Errors: + *