cub3d/src/parse.c

29 lines
1.2 KiB
C
Raw Normal View History

/* ************************************************************************** */
/* */
/* :::::::: */
/* parse.c :+: :+: */
/* +:+ */
/* By: houtworm <codam@houtworm.net> +#+ */
/* +#+ */
/* Created: 2023/10/26 16:48:55 by houtworm #+# #+# */
2023-10-26 17:40:01 +02:00
/* Updated: 2023/10/26 17:33:49 by houtworm ######## odam.nl */
/* */
/* ************************************************************************** */
#include "../cub3d.h"
2023-10-26 17:40:01 +02:00
t_varlist ft_parseconfigfile(t_varlist vl, char *filename)
{
2023-10-26 17:40:01 +02:00
int fd;
char *line;
fd = open(filename, O_RDONLY);
if (fd == -1)
ft_errorexit("file does not exist", "parseconfigfile", 1);
while (get_next_line(fd, &line))
{
2023-10-26 17:40:01 +02:00
free(line);
}
2023-10-26 17:40:01 +02:00
return (vl);
}