コード例 #1
0
ファイル: lvm_base.c プロジェクト: Distrotech/LVM2
int lvm_config_find_bool(lvm_t libh, const char *config_path, int fail)
{
	int rc = 0;
	struct cmd_context *cmd = (struct cmd_context *)libh;
	struct saved_env e = store_user_env((struct cmd_context *)libh);

	rc = dm_config_tree_find_bool(cmd->cft, config_path, fail);
	restore_user_env(&e);
	return rc;
}
コード例 #2
0
ファイル: config.c プロジェクト: Find7s/Lvm_for_Android
int find_config_tree_bool(struct cmd_context *cmd, int id, struct profile *profile)
{
	cfg_def_item_t *item = cfg_def_get_item_p(id);
	const char *path = cfg_def_get_path(item);
	int profile_applied = 0;
	int b;

	if (profile && !cmd->profile_params->global_profile)
		profile_applied = override_config_tree_from_profile(cmd, profile);

	path = cfg_def_get_path(item);

	if (item->type != CFG_TYPE_BOOL)
		log_error(INTERNAL_ERROR "%s cfg tree element not declared as boolean.", path);

	b = dm_config_tree_find_bool(cmd->cft, path, cfg_def_get_default_value(item, CFG_TYPE_BOOL));

	if (profile_applied)
		remove_config_tree_by_source(cmd, CONFIG_PROFILE);

	return b;
}
コード例 #3
0
ファイル: lvm_base.c プロジェクト: Roppofon/Lvm_for_Android
int lvm_config_find_bool(lvm_t libh, const char *config_path, int fail)
{
    struct cmd_context *cmd = (struct cmd_context *)libh;

    return dm_config_tree_find_bool(cmd->cft, config_path, fail);
}
コード例 #4
0
ファイル: config.c プロジェクト: andyvand/cyglvm2
int find_config_tree_bool(struct cmd_context *cmd, const char *path, int fail)
{
	return dm_config_tree_find_bool(cmd->cft, path, fail);
}