-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.h
43 lines (37 loc) · 993 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
#ifndef _SHELL_H_
#define _SHELL_H_
#include <dirent.h>
#include <limits.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <string.h>
#define MAXLEN 100
#define STDIN 0
#define STAT_FAILURE 1
#define EXEC_FAILURE 2
#define PROMPT "#cmd$ "
#define LOGFILE ".simple_shell_history"
#define MAXLOGSIZE 4096
#define MAXBUFREAD 1024
int fetch_token(void);
int switch_mode(int ac, char **av, char **env);
int stat_exec(char **str, int i);
int which_command(char *command);
int search_paths(char **path_list, char *command);
int _scandir(char *command, char *dir);
int cmd(int ac, char **av, char **env);
void exit_handle(char **u_tokns, char *line);
char *_strtok(char *s, const char *delim);
unsigned int _strlen(char *s);
int _strcmp(char *s1, char *s2);
int _atoi(char *s);
#endif /* _SHELL_H_ */