aboutsummaryrefslogtreecommitdiff
path: root/include/minishell.h
diff options
context:
space:
mode:
authorChristopher Uhlig2025-01-22 02:40:27 +0100
committerChristopher Uhlig2025-01-22 02:40:27 +0100
commitf6e474d27a1398c6d4f2e88c7f2d3797b85217da (patch)
tree7dd7bd5f2a151b39498991b567ae51cff8242782 /include/minishell.h
parent78dc50a2bce3c6e31405437189e2990d8fc720ac (diff)
downloadminishell-f6e474d27a1398c6d4f2e88c7f2d3797b85217da.tar.gz
minishell-f6e474d27a1398c6d4f2e88c7f2d3797b85217da.zip
kinda fix for pipe error and again.vs for you db just chnage workfolder gn
Diffstat (limited to 'include/minishell.h')
-rw-r--r--include/minishell.h36
1 files changed, 30 insertions, 6 deletions
diff --git a/include/minishell.h b/include/minishell.h
index 028a4fc..06abb04 100644
--- a/include/minishell.h
+++ b/include/minishell.h
@@ -6,7 +6,7 @@
/* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/22 17:14:49 by dkaiser #+# #+# */
-/* Updated: 2025/01/11 16:05:11 by chuhlig ### ########.fr */
+/* Updated: 2025/01/21 20:20:09 by chuhlig ### ########.fr */
/* */
/* ************************************************************************** */
@@ -25,21 +25,45 @@
# include <stdlib.h>
# include <termios.h>
# include <unistd.h>
+# include <fcntl.h>
int init(void);
int init_signal_handling(void);
-void repl(const char *prompt, t_env **env);
+void repl(const char *prompt, t_env **env, int *promptflag);
-t_list *parse(t_token *tokens, t_env **env);
+t_node *parse(t_token *tokens, t_env **env);
t_node *parse_cmd(t_token *tokens, t_env **env);
-t_redirection *collect_redirs(t_token **tokens);
+t_redirection *collect_redirs(t_token **tokens, t_env *env, t_list **cf);
void print_ast(t_node *ast);
+
int eval(t_node *node, t_env **env);
-char *get_cmd_path(char *cmd, t_env *env);
+char *get_cmd_path(char *cmd, t_env *env, int *return_code);
int execute_cmd(t_cmd *cmd, t_env **env);
-char *format_string(char *str, t_env *env);
+char *format_string(char *str, t_env *env, int is_literal);
+void set_return_code(int return_code, t_env **env);
+int handle_redirections(t_redirection *redirs);
+void *error(int err_code, char *err_text, int exit_code,
+ int *ret_code);
+void command_not_found_error(char *cmd);
+char *read_heredoc(char *delimiter);
+int handle_input_redirection(t_redirection *redir);
+int handle_output_redirection(t_redirection *redir);
+int handle_redirections(t_redirection *redirs);
+int handle_pipe_parent(int p[2], t_node *node, t_env **env);
+int handle_pipe_child(int p[2], t_node *node, t_env **env,
+ int in_fd);
+int open_file(char *path, int flags, int mode);
+int eval_rec(t_node *node, t_env **env, int in_fd);
+int create_files(t_list *files);
+void q4fc(t_list **queue, t_redirection *redir);
+void i_love_the_norme(t_token **cur, t_token **tokens);
+typedef struct s_minidata
+{
+ t_env *env;
+ t_list **create_files;
+} t_minidata;
#endif