piscine-bsq/includes/parsing.h

46 lines
1.4 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parsing.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: apago <apago@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/04 18:22:11 by apago #+# #+# */
/* Updated: 2023/04/05 09:31:04 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PARSING_H
# define PARSING_H
# include "fcntl.h"
# include "stdio.h"
# include "stdlib.h"
# include "unistd.h"
typedef struct Meta
{
char empty;
char obstacle;
char full;
int height;
int width;
} t_meta;
typedef struct Map
{
t_meta meta;
char *data;
char *copy;
} t_map;
char *read_file(int file);
size_t read_uint(char *str);
int parse_valid_uint(char *str, size_t len);
int read_char(char *str, char *dst);
int printable(char c);
size_t count_first_line(char *line);
int read_fname(char *name, t_map *map);
#endif