15static bool is_map_line(
const char *str)
17 const char *identifier =
" 10NWES";
23 len = ft_strlen(identifier);
24 while (*str !=
'\n' && *str !=
'\0')
29 if (ft_strncmp(str, identifier + i, (
size_t)1) == 0)
40static int check_continue_of_map(
bool is_map_line,
const char *line)
42 if (is_map_line ==
true && *line !=
'\n')
44 ft_eprintf(
"%s%s\nNG line: [", ERR_PROMPT, EMSG_MAP_CHAR);
45 print_until_ch(STDOUT_FILENO, line,
'\n');
47 return (EXIT_FAILURE);
49 if (is_map_line ==
false && *line !=
'\n')
51 ft_eprintf(
"%s%s\n", ERR_PROMPT, EMSG_MAP_NOT_LAST);
52 return (EXIT_FAILURE);
54 return (EXIT_SUCCESS);
57int check_last_map(
const char *line,
t_parse *parse)
64 while (is_map_line(line) ==
true)
67 line = find_next_line(line);
69 return (EXIT_SUCCESS);
71 if (check_continue_of_map(is_find_map, line) != EXIT_SUCCESS)
72 return (EXIT_FAILURE);
73 line = find_next_line(line);
76 return (EXIT_SUCCESS);