#include #include #include #include static int8_t ft_check_line(char *line, uint8_t l, t_cub *clist) { size_t i; i = 0; while (line[i]) { if (l != 1) { if (!ft_ischarset("012NSEW ", line[i])) return (-1); if (ft_ischarset("NSEW", line[i])) clist->nsew += 1; if (clist->nsew > 1) return (-1); } else { if (!ft_ischarset("1 ", line[i])) return (-1); } i++; } if (line[0] != '1' || line[i - 1] != '1') return (-1); return (0); } int ft_get_map_first_line(char *line, t_cub *clist) { if (!line[0]) { ft_memdel(line); return (-1); } if (ft_check_line(line, 1, clist) < 0) { ft_memdel(line); return (-1); } return (1); } int ft_get_map_core(int fd, t_cub *clist) { int ret; (void)fd; (void)ret; (void)clist; return (0); }