|
@ -46,16 +46,18 @@ typedef struct s_datas |
|
|
char **envp; |
|
|
char **envp; |
|
|
int exit_code; |
|
|
int exit_code; |
|
|
} t_datas; |
|
|
} t_datas; |
|
|
// ----------------------------------Errors.c
|
|
|
|
|
|
int file_error(char *cmd, char *file, char *msg); |
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------Utils.c
|
|
|
// ----------------------------------Utils.c
|
|
|
int is_empty(char *line); |
|
|
int is_empty(char *line); |
|
|
void halt(int ret_code); |
|
|
|
|
|
void sigs_handler(int sig_num); |
|
|
|
|
|
void nothing(int sig_num); |
|
|
|
|
|
void handle_status(t_datas *datas, int status); |
|
|
void handle_status(t_datas *datas, int status); |
|
|
|
|
|
void nothing(int sig_num); |
|
|
|
|
|
void sigs_handler(int sig_num); |
|
|
|
|
|
void halt(int ret_code); |
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------Utils_2.c
|
|
|
|
|
|
int replace_var(t_datas *datas, char **line, \ |
|
|
|
|
|
char *tmp, int tmp_i); |
|
|
|
|
|
int file_error(char *cmd, char *file, char *msg); |
|
|
// ----------------------------------Builtins.c
|
|
|
// ----------------------------------Builtins.c
|
|
|
int close_minishell(int exit_code); |
|
|
int close_minishell(int exit_code); |
|
|
int ft_echo(t_command *cmd); |
|
|
int ft_echo(t_command *cmd); |
|
@ -92,10 +94,13 @@ typedef struct s_token |
|
|
t_type type; |
|
|
t_type type; |
|
|
struct s_token *next; |
|
|
struct s_token *next; |
|
|
} t_token; |
|
|
} t_token; |
|
|
|
|
|
|
|
|
char *expend_str(t_datas *datas, char *line); |
|
|
char *expend_str(t_datas *datas, char *line); |
|
|
size_t count_arguments(t_token *tok); |
|
|
size_t count_arguments(t_token *tok); |
|
|
void update_redir(t_datas *datas, t_command *cmd, t_token *tok); |
|
|
void update_redir(t_datas *datas, t_command *cmd,\ |
|
|
t_command *parser(t_datas *datas, t_token *tok, t_command *prev); |
|
|
t_token *tok); |
|
|
|
|
|
t_command *parser(t_datas *datas, t_token *tok,\ |
|
|
|
|
|
t_command *prev); |
|
|
|
|
|
|
|
|
// ----------------------------------Lexer.c
|
|
|
// ----------------------------------Lexer.c
|
|
|
typedef enum e_state |
|
|
typedef enum e_state |
|
@ -117,7 +122,6 @@ typedef struct s_lex |
|
|
|
|
|
|
|
|
int create_token(t_lexer *lex, char str[]); |
|
|
int create_token(t_lexer *lex, char str[]); |
|
|
int check_register(t_lexer *lex, char **line, char *tmp); |
|
|
int check_register(t_lexer *lex, char **line, char *tmp); |
|
|
int replace_var(t_datas *datas, char **line, char *tmp, int tmp_i); |
|
|
|
|
|
int check_state(t_lexer *lex, char **line); |
|
|
int check_state(t_lexer *lex, char **line); |
|
|
t_token *lexer(t_datas *datas, char *line); |
|
|
t_token *lexer(t_datas *datas, char *line); |
|
|
|
|
|
|
|
|