16# include "../lib/libft/inc/libft.h"
21# include <readline/readline.h>
22# include <readline/history.h>
27# define HISTORY_PATH "./src/utils/.maxishell_history"
80void parse_loop(
char **input,
char **tokens,
int *pos,
int *bufsize);
t_ast * manage_pipe(t_token **tokens, t_ms_data *data)
int valid_operator(const char **str)
t_token * new_token(char *value, t_token_type type)
void free_ast(t_ast *node)
t_ast * new_ast_node(void)
void skip_delimiters(char **input, char *delim)
char * heredoc(char *eof)
void print_ast_root(t_ast *root)
int toggle_quotes(int in_quotes, char current_char)
char ** finalize_result_array(char **result, int count)
void loop_cleanup(t_loop_data *loop_data, t_token *tokens_head)
char * expand_env_var(char *arg, t_ms_data *data)
char ** ft_split_preserve_quotes(char *str, char delimiter)
char ** initialize_result_array(int *count)
char * str_start_adj(char *arg)
t_ast * parse_tokens(t_token **tokens, t_ms_data *data)
int cmd_arg_len(t_token *current)
void initialise(int argc, char **argv)
void execute_command(char **parsed_text, t_token **tokens)
char * check_heredoc(char *line)
void print_maxishell(void)
int arg_len(t_token *current)
t_token * tokenise(char *str)
void free_all_tokens(t_token *tokens)
t_ast * create_redir_node(t_token *token)
void execute_tree(t_ast *node, t_ms_data *data)
int input_error_checks(t_loop_data *loop_data)
void append_token(t_token **tokens, t_token *new_token)
void handle_local_vars(t_ms_data *data, char *arg)
void append_word_if_valid(char *start, char *str, t_token **tokens)
char * append_literal(char **start, char *processed_arg)
char * handle_special_chars(char *str, t_token **tokens)
char * exit_status_adj(char *arg)
void reallocate_tokens(char ***tokens, int *bufsize)
void handle_quotes(char **tokens, int *pos, char **input)
t_ast * create_redir(t_token **tokens, t_token *tmp, t_ms_data *data)
void make_history(char *line)
char ** list_to_array(t_token *head)
int calc_stack_size(t_token *stack)
int is_redir_node(t_token *tokens)
char ** add_segment_on_delimiter(char **result, char **start, char *str, int *count)
t_ast * manage_redirs(t_token **tokens, t_ms_data *data)
void parse_loop(char **input, char **tokens, int *pos, int *bufsize)
char * generate_prompt(t_ms_data *data)
void init_ms_data(t_ms_data *data, char **argv, char **envp)
char * expand_variable(char **start, t_ms_data *data)
char * expand_env_and_loc_var(char *arg, t_ms_data *data)
void print_tokens(t_token *tokens, char *name)
enum e_token_type t_token_type
struct s_loop_data t_loop_data
void set_command_args(t_ast *command_node, t_token **tokens, int arg_count)
char * tmp_adj(char *arg)
int is_in_single_quotes(char *arg)
char ** parse_input(char *input)
void build_linked_list(t_token **tokens, char **argv)
void add_node(t_token **head, char *str)
char * trim_input(char *str)
void print_ast_args(t_ast *node)
t_ast * manage_commands(t_token **tokens, t_ms_data *data)
void final_quote_removal(int arg_count, t_ast *command_node)
void clear_history_file(void)
void post_process_command_args(t_ast *command_node, int arg_count, t_ms_data *data)
void visualize_ast(t_ast *root)
void free_stack(t_token **stack)
void free_ms_data(t_ms_data *data)
char * process_argument(char *arg, t_ms_data *data)
void print_stack(t_token **stack)
char ** ft_add_segment(char **result, char *start, size_t length, int *count)