int get_next_line(int const fd, char **line) { if (fd < 0 || BUFF_SIZE <= 0) return (-1); else return (get_next_line_2(fd, line)); }
int ark_check_map(t_ark_ctx *ctx, int fd) { char *line; while (get_next_line_2(fd, &line) > 0) { if (!ark_check_line(ctx, line)) { free(line); return (0); } free(line); } return (1); }
void ark_read_lines(int fd, char *map) { char *line; unsigned int i; char *tmp; i = 0; while (get_next_line_2(fd, &line) > 0) { tmp = line; while (*line) { map[i++] = *line; if (*(line + 1)) line += 2; else line++; } free(tmp); } map[i] = 0; }