예제 #1
0
파일: has_checks.c 프로젝트: WTC-Bat/ft_ls
int		haswidth(char *fstr)
{
	while (isprecision(*fstr) == 0 && islength(*fstr) == 0 &&
			istype(*fstr) == 0 && *fstr != '\0')
	{
		if (*fstr == '*' || ft_isdigit(*fstr))
			return (1);
		fstr++;
	}
	return (0);
}
예제 #2
0
파일: mod_ops.c 프로젝트: WTC-Bat/ft_ls
int		get_width(va_list vlst, char *fstr)
{
	char	width[5];
	int		cnt;

	cnt = 0;
	while (isprecision(*fstr) == 0 && islength(*fstr) == 0 &&
			istype(*fstr) == 0)
	{
		if (ft_isdigit(*fstr))
		{
			width[cnt] = *fstr;
			cnt++;
		}
		else if (*fstr == '*')
			return (va_arg(vlst, int));
		fstr++;
	}
	width[cnt] = '\0';
	return (ft_atoi(width));
}
예제 #3
0
void	putprecision(const char **str, t_flag *flag)
{
	if (isprecision(**str))
		flag->precision = getprecision(str);
}