-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.h
More file actions
64 lines (38 loc) · 1.2 KB
/
Copy pathshell.h
File metadata and controls
64 lines (38 loc) · 1.2 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
57
58
59
60
61
62
63
64
#ifndef shell_h
#define shell_h
#define HOSTNAME_SIZE 100
#define CWD_SIZE 300
#define PATH_SIZE 300
#define COMMANDLINE_SIZE 1000
#define COMMAND_SIZE 100
#define NUM_OF_ARGS 30
#define ARG_SIZE 30
#define NUM_BUILT_IN 11
// Global root path for my shell
typedef struct Pair{
int pid;
char* name;
}pair;
pair* bgprocarr;
int pipedes[2], piping, prevpiping, GLOBALSTDIN, GLOBALSTDOUT, pipedeskjob[2], pipedesfg[2], pipedesbg[2];
char *homepath;
void allocationerror();
void prompt();
char* readcommandline();
char** splitcommands(char* commandline);
char** splitintoargs(char* singlecommnd);
char* catargs(char** args, int notreqind, int upperind, int lowerind, char* previouspipedoutput);
char* catflags(char** args, int notreqind, int upperind, int lowerind);
void cdcommand(char* args);
void echocommand(char** args, int notreqind, int lowerind, int upperind, char* previouspipedoutput);
void pwdcommand();
void lscommand(char* flags, char* path);
void remindmefn(char** args, int lowerind);
void clockfn(char** args, int lowerind);
void pinfocommand(char* args);
void jobscommand();
void kjobcommand(char* args1, char* args2);
void bg(char* args);
int fg(char* args);
void execute(char** args);
#endif