Signed-off-by: Jaroslav Kysela <perex@perex.cz>
snd_config_type_t snd_config_get_type(const snd_config_t *config);
int snd_config_is_array(const snd_config_t *config);
+int snd_config_is_empty(const snd_config_t *config);
int snd_config_set_id(snd_config_t *config, const char *id);
int snd_config_set_integer(snd_config_t *config, long value);
}
/**
+ * \brief Returns if the compound has no fields (is empty).
+ * \param config Handle to the configuration node.
+ * \return A positive value when true, zero when false, otherwise a negative error code.
+ */
+int snd_config_is_empty(const snd_config_t *config)
+{
+ assert(config);
+ if (config->type != SND_CONFIG_TYPE_COMPOUND)
+ return -EINVAL;
+ return list_empty(&config->u.compound.fields);
+}
+
+/**
* \brief Returns the id of a configuration node.
* \param[in] config Handle to the configuration node.
* \param[out] id The function puts the pointer to the id string at the