-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.h
44 lines (36 loc) · 867 Bytes
/
shell.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
#ifndef SHELL_H
#define SHELL_H
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#define TOK_DELIM " \t\r\n\a\""
#define BUFSIZE 1024
extern char **environ;
int _atoi(char *s);
int _strcmp(char *s1, char *s2);
char *read_line(void);
char **split_line(char *line);
int execute(char **args);
int new_process(char **args);
char *read_stream(void);
int sh_cd(char **args);
int sh_help(__attribute__((unused))char **args);
int sh_exit(char **args);
int sh_env(char **args);
int sh_setenv(char **args);
int sh_unsetenv(char **args);
/**
* struct builtin - Struct builtin
*
* @builtin_str: The command entered
* @builtin_func: The function called to handle the command
*/
typedef struct builtin
{
char *builtin_str;
int (*builtin_func)(char **);
} builtin;
int (*get_function(char *s))(char **args);
#endif