Repository navigation
Expand file tree
/
Copy pathminishell.h
More file actions
56 lines (46 loc) · 1.87 KB
/
Copy pathminishell.h
File metadata and controls
56 lines (46 loc) · 1.87 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: htaheri <htaheri@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/15 14:11:18 by mmomeni #+# #+# */
/* Updated: 2023/12/24 18:54:31 by mmomeni ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINISHELL_H
# define MINISHELL_H
# include "./libft/libft.h"
# include <errno.h>
# include <fcntl.h>
# include <signal.h>
# include <stdio.h>
# include <stdlib.h>
# include <sys/wait.h>
# include <termios.h>
# include <unistd.h>
# include <readline/history.h>
# include <readline/readline.h>
# define ERR_HD "syntax error near unexpected token `newline'"
void process(char *line, char **tokens, char ***env);
void run_pipes(char **commands, int n, char ***env);
void terminate(char *cmd, char *reason);
char *get_env(char **env, char *key);
void set_env(char ***env, char *key, char *value);
char *get_path(char *program);
char *parse(char *s, char **env);
void print_vec(char **vec);
char *here_doc(char *end);
typedef struct s_quote_parsed
{
char *str;
char end;
} t_quote_parsed;
t_quote_parsed parse_quotes(const char *s);
/* Builtins */
void ft_echo(char **v);
void ft_cd(char **v, char ***env);
void ft_export(char **v, char ***env);
void ft_exit(char **v);
#endif