forked from 42-shell/minishell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuiltins.h
40 lines (32 loc) · 1.69 KB
/
builtins.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* builtins.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jkong <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/23 23:11:16 by jkong #+# #+# */
/* Updated: 2022/06/23 23:38:34 by jkong ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef BUILTINS_H
# define BUILTINS_H
# include "minishell.h"
typedef int t_builtin_res;
typedef char **t_builtin_argv;
typedef t_list_var **t_builtin_envp;
typedef t_builtin_res (*t_builtin_func)(t_builtin_argv, t_builtin_envp);
typedef struct s_builtin_info
{
const char *key;
t_builtin_func pfn;
} t_builtin_info;
t_builtin_func get_builtin(char *name);
t_builtin_res ft_echo(t_builtin_argv argv, t_builtin_envp envp);
t_builtin_res ft_cd(t_builtin_argv argv, t_builtin_envp envp);
t_builtin_res ft_pwd(t_builtin_argv argv, t_builtin_envp envp);
t_builtin_res ft_export(t_builtin_argv argv, t_builtin_envp envp);
t_builtin_res ft_unset(t_builtin_argv argv, t_builtin_envp envp);
t_builtin_res ft_env(t_builtin_argv argv, t_builtin_envp envp);
t_builtin_res ft_exit(t_builtin_argv argv, t_builtin_envp envp);
#endif