Esempio n. 1
0
int		ft_form2(t_format *tmp, va_list ap)
{
	if (tmp->type == 's')
		return (ft_string(tmp, ap));
	else if (tmp->type == 'C' || (tmp->type == 'c' &&
				ft_strcmp(tmp->lenght, "l") == 0))
		return (ft_wint(tmp, ap));
	else if (tmp->type == 'c')
		return (ft_char(tmp, ap));
	else if (tmp->type == 'd' || tmp->type == 'i' || tmp->type == 'D')
		return (ft_int(tmp, ap));
	else if (tmp->type == 'f' || tmp->type == 'F')
		return (ft_float(tmp, ap));
	else if (tmp->type == 'u' || tmp->type == 'U')
		return (ft_unint(tmp, ap));
	else if (tmp->type == 'o' || tmp->type == 'O')
		return (ft_octal(tmp, ap));
	else if (tmp->type == 'b' || tmp->type == 'B')
		return (ft_binaire(tmp, ap));
	else if (tmp->type == 'e' || tmp->type == 'E')
		return (ft_scienti(tmp, ap));
	else if (tmp->type == 'x' || tmp->type == 'X')
		return (ft_hexa(tmp, ap));
	else if (tmp->type == 'p')
		return (ft_adrpoint(tmp, ap));
	else
		return (ft_char(tmp, ap));
}
Esempio n. 2
0
char	*ft_recog(va_list ap, char c)
{
	int	i;

	if (c == 's' || c == 'S')
		ft_strings(ap, c);
	else if (c == 'x' || c == 'X')
		ft_hexadec(ap, c);
	else if (c == 'c' || c == 'C')
		ft_character(ap, c);
	else if (c == 'i')
		ft_number(ap, c);
	else if (c == 'd' || c == 'D')
		ft_putunsi(ap, c);
	else if (c == 'o' || c == 'O')
		ft_octal(ap, c);
	else if (c == 'u' || c == 'U')
		ft_number(ap, c);
	else if (c == 'p')
		ft_ptradr(ap, c);
	return (0);
}