int valid_purcent(char *str, int opt) { int i; i = 0; while (ft_check_flag(str[i]) || ft_check_length(str[i]) || ft_isdigit(str[i])) i++; if (opt == 1) return (ft_check_type(str[i])) ? 1 : 0; else return (ft_check_type(str[i])) ? i + 1 : i; }
void ft_parse_flags(char *fmt, t_var *e) { ft_construct_struct(e); e->i++; if (fmt[e->i] == '#') flags_effect(fmt, e); flags_left(fmt, e); flags_positive(fmt, e); flags_effect(fmt, e); flags_zero(fmt, e); flags_space(fmt, e); flags_width(fmt, e); flags_precis(fmt, e); flags_h(fmt, e); if (e->error == 0) { if (fmt[e->i] == 'U' || fmt[e->i] == 'D' || fmt[e->i] == 'O') e->u_exep = 1; ft_check_type(fmt, e); } }