1
0
cub3d/includes/parsing.h

115 lines
3.1 KiB
C
Raw Permalink 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 #+# #+# */
2024-11-11 15:20:51 +01:00
/* Updated: 2024/11/11 15:12:35 by madumerg ### ########.fr */
2024-09-12 13:01:04 +02:00
/* */
/* ************************************************************************** */
#ifndef PARSING_H
# define PARSING_H
2024-09-29 20:40:33 +02:00
# include "libft.h"
# include "ft_printf.h"
# include "mess_err.h"
# include <stdlib.h>
# include <unistd.h>
# include <fcntl.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-10-05 18:59:47 +02:00
//start.c
t_pars init_pars(void);
int basics_check(int ac, char **av, t_pars *pars);
//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);
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);
2024-11-11 15:20:51 +01:00
int check_char_color(char *str);
//color_utils_two.c
int total_len(char **tab);
char *multi_join(char **tab, int ct);
//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-29 20:40:33 +02:00
void info_map(char **file, char ***f_part);
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);
2024-10-24 14:31:15 +02:00
int 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);
2024-11-11 15:20:51 +01:00
char *ft_strcat(char *dest, char *src);
//clear_free.c
void free_tab(char **tab);
void free_pars(t_pars *pars);
2024-09-12 13:01:04 +02:00
#endif