-
Notifications
You must be signed in to change notification settings - Fork 17
/
minishell.h
73 lines (63 loc) · 2.06 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jrameau <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/04/24 17:40:04 by jrameau #+# #+# */
/* Updated: 2017/05/21 15:04:50 by jrameau ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINISHELL_H
# define MINISHELL_H
# include <sys/types.h>
# include <sys/stat.h>
# include <sys/wait.h>
# include <unistd.h>
# include <stdlib.h>
# include <signal.h>
# include <dirent.h>
# include "libft.h"
# define IS_QUOTE(x) (x == '"' || x == '\'')
char **g_envv;
/*
** src/cd_builtin.c
*/
void change_dir(char *path, int print_path);
int cd_builtin(char **command);
/*
** src/display_prompt_msg.c
*/
void exit_shell(void);
char *parse_home_path(char *path, int reverse_parse);
void display_prompt_msg(void);
/*
** src/echo_builtin.c
*/
int echo_builtin(char **command);
/*
** src/exec_command.c
*/
int exec_command(char **command);
/*
** src/setenv_builtin.c
*/
int find_env_var(char *var);
char *get_env_var(char *var);
char **realloc_envv(int new_size);
void set_env_var(char *key, char *value);
int setenv_builtin(char **command);
int setenv_builtin(char **args);
/*
** src/signal_handler.c
*/
void signal_handler(int signo);
void proc_signal_handler(int signo);
/*
** src/unsetenv_builtin.c
*/
void print_env(void);
void init_envv(int ac, char **av, char **envv);
int unsetenv_builtin(char **command);
#endif