1
0
cub3d/includes/parsing.h

101 lines
2.8 KiB
C
Raw Normal View History

2024-09-12 13:01:04 +02:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parsing.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: madumerg <madumerg@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/12 12:49:16 by madumerg #+# #+# */
/* Updated: 2024/09/28 17:54:07 by madumerg ### ########.fr */
2024-09-12 13:01:04 +02:00
/* */
/* ************************************************************************** */
#ifndef PARSING_H
# define PARSING_H
2024-09-12 17:00:27 +02:00
typedef struct s_coord
{
int x;
int y;
} t_coord;
typedef struct s_pars
{
2024-09-16 15:09:07 +02:00
int f_color;
int c_color;
int color;
char l_player;
2024-09-12 17:00:27 +02:00
t_coord coor;
2024-09-16 15:09:07 +02:00
char *no_png;
char *so_png;
char *we_png;
char *ea_png;
char **map;
2024-09-12 17:00:27 +02:00
} t_pars;
2024-09-12 13:01:04 +02:00
//check_arg.c
2024-09-16 15:09:07 +02:00
int check_err_arg(int ac, char **av);
int check_format_file(char *file);
//check_id_text.c
int detect_info(char **tab, t_pars *pars);
//check_image.c
int assign_img(char *sign, char *path, t_pars *pars);
2024-09-16 15:09:07 +02:00
int check_dup_img(t_pars *pars);
int check_texture(char *sign, char *path, t_pars *pars);
2024-09-12 13:01:04 +02:00
//check_map.c
2024-09-16 15:09:07 +02:00
int err_not_close(char after, char before, char down, char up);
int actual_char(char actual);
int check_map_close(char **map);
int check_char_map(char **map);
//check_rgb.c
int check_format_rgb(char *sign, char **tab, t_pars *pars);
//color_utils.c
int create_argb(int r, int g, int b);
char *ft_strndup_color(char *src, int start, int end);
int check_char_color(char *tab);
int check_dup_color(t_pars *pars);
//find_player.c
int search_letter(char **map, int i, char l);
int count_player(char **map, t_pars *pars, int ct);
2024-09-12 13:01:04 +02:00
//principal_pars.c
2024-09-16 15:09:07 +02:00
int verif_info_file(char *av, t_pars *pars);
int verif_all_map(char **map, t_pars *pars);
char **parse_file(char *map, int ct, int i);
2024-09-12 13:01:04 +02:00
//mess_error.c in utils
2024-09-16 15:09:07 +02:00
int err_mess(char *str);
2024-09-12 13:01:04 +02:00
//parse_utils.c
2024-09-12 17:00:27 +02:00
char **info_map(char **file);
2024-09-16 15:09:07 +02:00
int verif_char(char c);
int space_line(char *line);
//parse_utils_two.c
int ft_count_line_map(char **map, int y);
void replace_nl(char *l);
int recup_map(char **old_map, int i, t_pars *pars);
int all_skip(char **map, t_pars *pars);
//parse_utils_three.c
char **alloc_map(char **old_map, int size);
char *fill_line(char *l, int size);
int last_first_line(char **map);
//utils.c
int count_tab(char **tab);
void convert_white_s(char *str);
int longest_line(char **line);
int count_line_file(int fd);
//clear_free.c
void free_tab(char **tab);
void free_pars(t_pars *pars);
2024-09-12 13:01:04 +02:00
#endif