*参照元 [#x638428a]
#backlinks

*説明 [#t3ed43b8]
-パス: [[alsa-lib-1.0.27.2/src/conf.c]]

-FIXME: これは何?
--説明


**引数 [#cfd9445b]
-snd_config_t *config
--
--[[alsa-lib-1.0.27.2/snd_config_t]]
-const char *base
--
-const char *name
--
-snd_config_t **result
--


**返り値 [#b747c16e]
-int
--


**参考 [#a6917e35]


*実装 [#i569d7c4]
 /**
  * \brief Searches for a definition in a configuration tree, using
  *        aliases and expanding hooks and arguments.
  * \param[in] config Handle to the configuration (sub)tree to search.
  * \param[in] base Implicit key base, or \c NULL for none.
  * \param[in] name Key suffix, optionally with arguments.
  * \param[out] result The function puts the handle to the expanded found
  *                    node at the address specified by \a result.
  * \return A non-negative value if successful, otherwise a negative error code.
  *
  * This functions searches for a child node of \a config, allowing
  * aliases and expanding hooks, like #snd_config_search_alias_hooks.
  *
  * If \a name contains a colon (:), the rest of the string after the
  * colon contains arguments that are expanded as with
  * #snd_config_expand.
  *
  * In any case, \a result is a new node that must be freed by the
  * caller.
  *
  * \par Errors:
  * <dl>
  * <dt>-ENOENT<dd>An id in \a key or an alias id does not exist.
  * <dt>-ENOENT<dd>\a config or one of its child nodes to be searched is
  *                not a compound node.
  * </dl>
  * Additionally, any errors encountered when parsing the hook
  * definitions or arguments, or returned by (hook) functions.
  */
 int snd_config_search_definition(snd_config_t *config,
 				 const char *base, const char *name,
 				 snd_config_t **result)
 {
 	snd_config_t *conf;
 	char *key;
 	const char *args = strchr(name, ':');
 	int err;
 	if (args) {
 		args++;
 		key = alloca(args - name);
 		memcpy(key, name, args - name - 1);
 		key[args - name - 1] = '\0';
 	} else {
 		key = (char *) name;
 	}
 	/*
 	 *  if key contains dot (.), the implicit base is ignored
 	 *  and the key starts from root given by the 'config' parameter
 	 */
 	snd_config_lock();
-
--[[alsa-lib-1.0.27.2/snd_config_lock()]]

 	err = snd_config_search_alias_hooks(config, strchr(key, '.') ? NULL : base, key, &conf);
 	if (err < 0) {
 		snd_config_unlock();
 		return err;
 	}
-
--[[alsa-lib-1.0.27.2/snd_config_search_alias_hooks()]]
-
--[[alsa-lib-1.0.27.2/snd_config_unlock()]]

 	err = snd_config_expand(conf, config, args, NULL, result);
 	snd_config_unlock();
 	return err;
-
--[[alsa-lib-1.0.27.2/snd_config_expand()]]

 }

*コメント [#q47eef54]


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS