You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.4 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* optionals.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hroussea <hroussea@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/22 21:41:45 by hroussea #+# #+# */
/* Updated: 2021/09/22 21:41:47 by hroussea ### ########lyon.fr */
/* */
/* ************************************************************************** */
#ifndef OPTIONALS_H
# define OPTIONALS_H
# include "parsing.h"
# include <stdio.h>
# include "result.h"
char *token_to_str(t_token_type type);
void print_token(t_token *token);
void print_mandatory_error(void);
void display_error_msg(t_tokenizer *tknz, char *filename);
void display_error_msg2(t_tokenizer *tknz, t_token *token,
char *filename, char *error);
t_result_i32 get_cub_fd(const char *path);
t_result_i32 load_cub_file(const char *path);
t_vector *read_all(int fd);
t_vector *create_error_str(char *expected);
int assert_token_type(t_token *tok, t_token_type equ, int tknz_ret,
void *tab[2]);
void dispatch_by_id(t_tokenizer *tknz, t_cubheader *header,
t_token *token, char *path);
void parse_expression(t_tokenizer *tknz, t_cubheader *header,
char *path);
void parse_resolution(t_tokenizer *tknz, t_cubheader *header,
t_token *token, char *path);
void parse_north(t_tokenizer *tknz, t_cubheader *header,
t_token *token, char *path);
void parse_south(t_tokenizer *tknz, t_cubheader *header,
t_token *token, char *path);
void parse_east(t_tokenizer *tknz, t_cubheader *header,
t_token *token, char *path);
void parse_west(t_tokenizer *tknz, t_cubheader *header,
t_token *token, char *path);
void parse_sprite(t_tokenizer *tknz, t_cubheader *header,
t_token *token, char *path);
void parse_floor(t_tokenizer *tknz, t_cubheader *header,
t_token *token, char *path);
void parse_ceil(t_tokenizer *tknz, t_cubheader *header,
t_token *token, char *path);
#endif