minishell/inc/typedef.h

57 lines
1.5 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* typedef.h :+: :+: */
/* +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/02/05 12:36:08 by whaffman #+# #+# */
/* Updated: 2025/02/05 15:25:40 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef TYPEDEF_H
# define TYPEDEF_H
typedef enum e_token_type
{
T_WORD,
T_PIPE,
T_REDIRECT_IN,
T_REDIRECT_OUT,
T_APPEND_OUT,
T_EOF,
T_ERROR
} t_token_type;
typedef struct s_enviroment
{
char *name;
char *value;
struct s_enviroment *next;
} t_enviroment;
typedef struct s_token
{
t_token_type type;
char *value;
int position;
} t_token;
typedef struct s_lexer
{
char *input;
int pos;
int n_pos;
char current_char;
} t_lexer;
typedef struct s_minishell
{
t_enviroment *enviroment;
char *line;
t_lexer *lexer;
t_list *tokens;
} t_minishell;
#endif // TYPEDEF_H