Пример #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));
}
Пример #2
0
static int	ft_print_end(va_list ap, t_list *tmp, char *conv, int result)
{
	if (tmp->opt == 's' && *conv == '\0')
		result += ft_string(ap, tmp->flags, 0);
	/*else if (opt == 'S' || (opt == 's' && *conv = 'l'))
		result += ft_wchar();
	else if (opt == 'C' || (opt == 'c' && *conv = 'l')) 
		result += ft_wint();
	else if (opt == 'p' || opt == 'x' || opt == 'X')
		result += ft_hexa();
	else if ((opt == 'o' || opt == 'O') && *conv = '\0')
		result += ft_octal();
	else if (*conv == 'j')
		result += ft_intmax();
	else if (*conv == 'z')
		result += ft_sizet();
	else if ((opt == 'c' && *conv = '\0') || (*conv == 'h' && *(conv + 1) == 'h'))
		result += ft_char();
	else
		result += ft_int();*/
	return (result);
}