void parse_file(int fd, char *str, int arg) { t_header header; t_list *lbls; t_list *cmds; lbls = NULL; cmds = NULL; g_data.cmds = &cmds; g_data.lbls = &lbls; ft_head(fd, &header); ft_body(fd, &header, &lbls, &cmds); if (cmds == NULL) ft_tok_error(END, ft_strdup("(null)"), NULL, 0); if (arg > 0) print_information(&header, lbls, cmds); else binary(&header, cmds, str); ft_lstdel(&lbls, free_lbl); ft_lstdel(&cmds, free_cmd); }
int colle(int x, int y) { int ct; if (x > 0 && y > 0) { ct = 0; ft_head(x); while (y - 2 > ct) { ft_putchar('*'); if (x != 1) { ft_nputchar(' ', x - 2); ft_putchar('*'); } ft_putchar('\n'); ct++; } ft_tail(x, y); } return (0); }