12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #ifndef SH_H
- # define SH_H
- # include "../libft/libft.h"
- # include "struct.h"
- # include "term.h"
- # include <stdlib.h>
- # include <unistd.h>
- # include <sys/types.h>
- # include <sys/wait.h>
- # include <dirent.h>
- # include <signal.h>
- # define PROMPT "21sh}-> "
- # define STDIN 0
- # define STDOUT 1
- # define STDERR 2
- char **g_tenv;
- char *g_home;
- char **g_path;
- /*
- ** main.c
- */
- void shell_script(t_e *e, char *script_name);
- void comma_split(t_e *e, char *cmd);
- /*
- ** redirect.c
- */
- void parse_redirection(t_e *e, char *str);
- int check_before_after_chevron(char *chev);
- void redirections(t_e *e, char *cmd, char *operator, char *file);
- void right_redirections(int *fd, char *operator, char *file);
- /*
- ** heredoc.c
- */
- void prompt_redirection(t_e *e, char *cmd, char *file);
- char *prompt_heredoc(t_e *e, char *txt, char *eof);
- /*
- ** herething.c
- */
- void herething(t_e *e);
- void pipe_herething(t_e *e, int pos, char *fc);
- char *prompt_herething(t_e *e, int pos, char *fc);
- /*
- ** pipe.c
- */
- void launch_pipe(char *all_cmd);
- void pipe_parsing(int **fd, int pipe_nbr, char **cmd_pipe, int i);
- void handle_multi_piping(int **fd, int pipe_nbr, char ***cmd_opt, int i);
- /*
- ** cmd_split.c
- */
- char **cmd_split(char const *str, char c, char d);
- int count_words(char const *s, char c, char d);
- /*
- ** exec.c
- */
- int manage_cmd_1(char **cmdt);
- void manage_cmd_2(char **cmdt);
- void execute(char **cmdt);
- void check_file_exist_exec_rights(char *path, char **cmd);
- /*
- ** env.c
- */
- char *get_tenv(char *var);
- void ft_setenv(char *namevalue);
- void ft_unsetenv(char *name);
- int isenv(char *str);
- /*
- ** tabenv.c
- */
- void add_env(char *nenv);
- void del_env(char *old_env);
- /*
- ** cd.c
- */
- void cd(char **path);
- char *get_pwd();
- /*
- ** tools.c
- */
- void sighandler();
- void error_message(char *one, char *two, char *three);
- char **change_tilde_to_home(char **cmd);
- int check_cmd_presence(char *cmd);
- #endif
|