예제 #1
0
파일: config.c 프로젝트: helloandre/cr48
int git_config_maybe_bool(const char *name, const char *value)
{
	long v = git_config_maybe_bool_text(name, value);
	if (0 <= v)
		return v;
	if (git_parse_long(value, &v))
		return !!v;
	return -1;
}
예제 #2
0
파일: config.c 프로젝트: SRabbelier/git
int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
{
	int v = git_config_maybe_bool_text(name, value);
	if (0 <= v) {
		*is_bool = 1;
		return v;
	}
	*is_bool = 0;
	return git_config_int(name, value);
}
예제 #3
0
파일: config.c 프로젝트: SRabbelier/git
int git_config_maybe_bool(const char *name, const char *value)
{
	int v = git_config_maybe_bool_text(name, value);
	if (0 <= v)
		return v;
	if (!strcmp(value, "0"))
		return 0;
	if (!strcmp(value, "1"))
		return 1;
	return -1;
}