-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminishell.h
91 lines (82 loc) · 3.31 KB
/
minishell.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mtacnet <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/08/18 10:54:43 by mtacnet #+# #+# */
/* Updated: 2017/08/29 14:01:40 by mtacnet ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINISHELL_H
# define MINISHELL_H
# include "./libft/libft.h"
typedef struct s_elem
{
char *content;
struct s_elem *next;
} t_elem;
/*
** LIST_FUNCTIONS
*/
t_elem *new_list(void);
t_elem *init_element(t_elem *element);
int is_empty(t_elem **lst);
void push_elem(t_elem **lst, char *content);
void supp_elem(t_elem **lst, char *arg);
void push_back(t_elem **lst, char *content);
void freelst(t_elem **lst);
void view_list(t_elem **lst);
void cpy_lst(t_elem **lst_dest, t_elem **lst_src);
/*
** MAIN_FUNCTIONS
*/
void error(int value, char *bad_cmd, char *bad_flag);
void get_line(char **env);
void process_core(char *line, char **tab_arg, t_elem **lst_env,
char **env);
void get_elem(t_elem **lst_path, char **env, char *elem);
void free_tab(char **tab);
void tab_to_list(t_elem **lst, char **tab);
void modif_line(char **line);
void recup_param(t_elem **lst_path, char **tab_arg, char **env);
void if_path(char *valid_path, char **tab_arg, char **env);
void process_flag_i(t_elem **lst_path, char **tab_arg);
void supp_elem_tab(char **tab, int value);
void change_dir(char *path, t_elem **lst_env);
void add_old_pwd(t_elem **lst_env);
void go_path(t_elem **lst_env, char **tab);
void process_cd2(t_elem **lst_env);
void go_bin(t_elem **lst_path, t_elem **lst_env, char **tab_arg);
void view_tab(char **tab);
int check_access(char *path);
int verif_line(char *line);
int parsing_cmd(char *command);
void check_cmd(int val, t_elem **lst_env, char **tab_arg,
t_elem **lst_path);
char **list_to_tab(t_elem **lst);
int verif_tab(char *tab);
int verif_list(t_elem **lst, char *tab_arg);
int modif_list(t_elem **lst, char *arg);
int check_old_pwd(t_elem **lst_env);
char *go_home(t_elem **lst_env);
char *go_old_pwd(t_elem **lst_env);
/*
** BULTINS_FUNCTIONS
*/
void process_env(t_elem **lst_env, int val, char **tab_arg,
t_elem **lst_path);
void env_error(char *bad_cmd, char *bad_flag);
void process_tmp_env(char **tab_arg, t_elem **lst_env,
t_elem **lst_path);
void process_f_env(t_elem **lst_env, char **tab_arg,
t_elem **lst_path);
void process_bin(char **tab_arg, t_elem **lst_env,
t_elem **lst_path);
void process_exit(t_elem **lst_env, t_elem **lst_path,
char **tab_arg);
void process_echo(char **tab);
void process_cd(t_elem **lst_env, char **tab_arg);
void process_unset(t_elem **lst_env, char **tab_arg);
#endif