diff options
Diffstat (limited to 'src/ft_get_tex.c')
-rw-r--r-- | src/ft_get_tex.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/ft_get_tex.c b/src/ft_get_tex.c index 4c80c89..1a936bd 100644 --- a/src/ft_get_tex.c +++ b/src/ft_get_tex.c @@ -3,7 +3,7 @@ #include <stdlib.h> static int -ft_get_tex_no(int fd, t_win *wlist) +ft_get_tex_no(int fd, t_cub *clist) { char *line; char **words; @@ -11,16 +11,16 @@ ft_get_tex_no(int fd, t_win *wlist) if (get_next_line(fd, &line) <= 0 || !(words = ft_split(line, ' '))) { ft_memdel(line); - return (ft_map_error(2, wlist)); + return (ft_map_error(2, clist)); } if (!(*words) || ft_strcmp(*words, "NO") || !(*(words + 1)) || (*(words + 2))) { ft_free_words(words, line); - return (ft_map_error(2, wlist)); + return (ft_map_error(2, clist)); } - ft_memdel(wlist->clist->no_tex_path); - if (!(wlist->clist->no_tex_path = ft_strdup(*(words + 1)))) + ft_memdel(clist->no_tex_path); + if (!(clist->no_tex_path = ft_strdup(*(words + 1)))) { ft_free_words(words, line); return (-1); @@ -30,7 +30,7 @@ ft_get_tex_no(int fd, t_win *wlist) } static int -ft_get_tex_so(int fd, t_win *wlist) +ft_get_tex_so(int fd, t_cub *clist) { char *line; char **words; @@ -38,16 +38,16 @@ ft_get_tex_so(int fd, t_win *wlist) if (get_next_line(fd, &line) <= 0 || !(words = ft_split(line, ' '))) { ft_memdel(line); - return (ft_map_error(3, wlist)); + return (ft_map_error(3, clist)); } if (!(*words) || ft_strcmp(*words, "SO") || !(*(words + 1)) || (*(words + 2))) { ft_free_words(words, line); - return (ft_map_error(3, wlist)); + return (ft_map_error(3, clist)); } - ft_memdel(wlist->clist->so_tex_path); - if (!(wlist->clist->so_tex_path = ft_strdup(*(words + 1)))) + ft_memdel(clist->so_tex_path); + if (!(clist->so_tex_path = ft_strdup(*(words + 1)))) { ft_free_words(words, line); return (-1); @@ -57,7 +57,7 @@ ft_get_tex_so(int fd, t_win *wlist) } static int -ft_get_tex_we(int fd, t_win *wlist) +ft_get_tex_we(int fd, t_cub *clist) { char *line; char **words; @@ -65,16 +65,16 @@ ft_get_tex_we(int fd, t_win *wlist) if (get_next_line(fd, &line) <= 0 || !(words = ft_split(line, ' '))) { ft_memdel(line); - return (ft_map_error(4, wlist)); + return (ft_map_error(4, clist)); } if (!(*words) || ft_strcmp(*words, "WE") || !(*(words + 1)) || (*(words + 2))) { ft_free_words(words, line); - return (ft_map_error(4, wlist)); + return (ft_map_error(4, clist)); } - ft_memdel(wlist->clist->we_tex_path); - if (!(wlist->clist->we_tex_path = ft_strdup(*(words + 1)))) + ft_memdel(clist->we_tex_path); + if (!(clist->we_tex_path = ft_strdup(*(words + 1)))) { ft_free_words(words, line); return (-1); @@ -84,7 +84,7 @@ ft_get_tex_we(int fd, t_win *wlist) } static int -ft_get_tex_ea(int fd, t_win *wlist) +ft_get_tex_ea(int fd, t_cub *clist) { char *line; char **words; @@ -92,16 +92,16 @@ ft_get_tex_ea(int fd, t_win *wlist) if (get_next_line(fd, &line) <= 0 || !(words = ft_split(line, ' '))) { ft_memdel(line); - return (ft_map_error(5, wlist)); + return (ft_map_error(5, clist)); } if (!(*words) || ft_strcmp(*words, "EA") || !(*(words + 1)) || (*(words + 2))) { ft_free_words(words, line); - return (ft_map_error(5, wlist)); + return (ft_map_error(5, clist)); } - ft_memdel(wlist->clist->ea_tex_path); - if (!(wlist->clist->ea_tex_path = ft_strdup(*(words + 1)))) + ft_memdel(clist->ea_tex_path); + if (!(clist->ea_tex_path = ft_strdup(*(words + 1)))) { ft_free_words(words, line); return (-1); @@ -111,12 +111,12 @@ ft_get_tex_ea(int fd, t_win *wlist) } int -ft_get_tex(int fd, t_win *wlist) +ft_get_tex(int fd, t_cub *clist) { - if (ft_get_tex_no(fd, wlist) < 0 || - ft_get_tex_so(fd, wlist) < 0 || - ft_get_tex_we(fd, wlist) < 0 || - ft_get_tex_ea(fd, wlist) < 0) + if (ft_get_tex_no(fd, clist) < 0 || + ft_get_tex_so(fd, clist) < 0 || + ft_get_tex_we(fd, clist) < 0 || + ft_get_tex_ea(fd, clist) < 0) return (-1); return (0); } |