-
Notifications
You must be signed in to change notification settings - Fork 2
/
minishell.h
83 lines (73 loc) · 2.43 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: smischni <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/08/10 18:14:03 by smischni #+# #+# */
/* Updated: 2022/08/10 18:50:24 by smischni ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINISHELL_H
# define MINISHELL_H
# include <unistd.h>
# include <stdlib.h>
# include <stdio.h>
# include <fcntl.h> /// For Open
# include <signal.h> /// For Signals
# include <sys/wait.h> /// For Wait
# include \
</Users/smischni/goinfre/.brew/opt/readline/include/readline/readline.h>
# include \
</Users/smischni/goinfre/.brew/opt/readline/include/readline/history.h>
# include <sys/stat.h> /// For Using WEXITSTATUS
# include <limits.h> //for PATH_MAX
/* Libft Library */
# include "libft/libft.h"
/* 1 Module ENV Builder */
# include "1_module_env_builder/env_builder.h"
/* 2 Module Lexar */
# include "2_module_parser/parser.h"
/* 3 Module Builtins */
# include "3_module_builtins/builtins.h"
/* 4 Module Executor */
# include "4_module_executor/executor.h"
/* 5 Module Signals */
# include "5_module_signals/signals.h"
/* Global Variable */
extern int g_exit_status;
/* ENV Builder Standalone */
typedef struct s_env
{
char *bash_variable;
char *bash_v_content;
struct s_env *next;
} t_env;
/* Parsed Command List */
typedef struct s_parser
{
t_list **sections;
int input_fd;
int output_fd;
int store_stdin;
int store_stdout;
int pipe_fd[2];
char **paths;
char **command;
t_list *pipe;
} t_parser;
/* Main Struct Containing all other Structs */
typedef struct s_data
{
t_parser par;
t_env *to_env_list;
t_list *lexar;
char *line;
} t_data;
/* Free */
void ft_lstclear_env(t_env **lst, void (*del)(void *));
void ft_lstdelone_env(t_env *lst, void (*del)(void *));
/* Main */
t_data *initialiser(char **envp);
#endif