forked from mohamedamine456/MiniShell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
minishell.h
60 lines (53 loc) · 2.01 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mlachheb <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/06/02 14:47:36 by mlachheb #+# #+# */
/* Updated: 2021/06/29 13:27:29 by mlachheb ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINISHELL_H
# define MINISHELL_H
# define TRUE 1
# define _POSIX_SOURCE
# include <unistd.h>
# undef _POSIX_SOURCE
# include <stdlib.h>
# include <fcntl.h>
# include <stdio.h>
# include <errno.h>
# include <string.h>
# include <sys/types.h>
# include <sys/wait.h>
# include <sys/stat.h>
# include <fcntl.h>
# include <readline/readline.h>
# include <readline/history.h>
# include "structs.h"
# include "get_next_line/get_next_line.h"
# include "parse/parse.h"
# include "terminal/terminal.h"
# include "execution/built_in/built_in.h"
# include "open_files/open_files.h"
# include "execution/execution.h"
int open_history(void);
void write_hist(t_general_data *hist, char *line);
t_general_data init_general_data(void);
t_history *read_hists(int fd);
/*
* prototypes for parse_execute.c file
*/
int parse_execute(char *line, char ***envp, int retv);
int read_heredocs(char **cmd_tab);
/*
* prototypes for hist_functions.c file
*/
void add_back_hist(t_history **hists, t_history *new);
void clear_hist(t_history **hists);
t_history *last_hist(t_history *hist);
t_history *first_hist(t_history *hist);
t_history *new_hist(void);
#endif