diff --git a/include/conf.h b/include/conf.h index cf88f1bd..e729fb05 100644 --- a/include/conf.h +++ b/include/conf.h @@ -121,6 +121,7 @@ int snd_config_remove(snd_config_t *config); int snd_config_delete(snd_config_t *config); int snd_config_delete_compound_members(const snd_config_t *config); int snd_config_copy(snd_config_t **dst, snd_config_t *src); +int snd_config_merge(snd_config_t *dst, snd_config_t *src, int override); int snd_config_make(snd_config_t **config, const char *key, snd_config_type_t type); diff --git a/src/conf.c b/src/conf.c index a2d4d068..941662ca 100644 --- a/src/conf.c +++ b/src/conf.c @@ -2158,6 +2158,61 @@ int snd_config_add_before(snd_config_t *before, snd_config_t *child) return 0; } +/** + * \brief In-place merge of two compounds + * \param dst[out] Compound handle for the merged contents + * \param src[in] Compound handle to merge into dst (may be NULL) + * \param override[in] Override flag + * \return Zero if successful, otherwise a negative error code. + * + * This function merges all fields from the source compound to the destination compound. + * When the overwrite flag is set, the related subtree in dst is replaced from src. + * + * The src compound is deleted. + * + * \par Errors: + *