forked from jacobbrown72/jShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.h
More file actions
85 lines (66 loc) · 1.3 KB
/
Copy pathshell.h
File metadata and controls
85 lines (66 loc) · 1.3 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef SHELL_H
#define SHELL_H
#include <stdlib.h>
/*Built in function defines*/
#define SET 1
#define PRINT 2
#define UNSET 3
#define CHANGE 4
#define AL 5
#define UNAL 6
#define BY 7
/*shell error declerations*/
#define CLOSE -1 //close terminal
#define SYSERR 0 //error occured
#define OK 1 //command is ok
#define NUMARGSERR 2 //number of args error
#define ILLPIPE 3 //illegal pipe error
#define ILLIORED 4 //illegal I/O red error
#define FILEDNE 5 //file does not exist
#define CMDNOTREC 6 //command not recognized
char errorMsg[100];
char temp[100];
char* str;
int str_length;
/*command variables*/
#define MAXCMDS 50
#define MAXARGS 50
int arg_counter;
int cmd_counter;
int bi;
typedef struct command{
char cmdname[20];
int bi_type;
char arguments[MAXARGS][100];
int num_args;
int infd;
int outfd;
} Cmd;
Cmd cmd_table[MAXCMDS];
int ret;
/*io variables*/
int inFile_red;
int outFile_red;
int errFile_red;
int append;
char inFile[100];
char outFile[100];
char errFile[100];
int amp;
/*environment variables*/
#define MAXENV 100
typedef struct env{
char variable[100];
char path[100];
int used;
} Env;
Env env_table[MAXENV];
/*alias variables*/
#define MAXALI 100
typedef struct alias{
char name[100];
char value[100];
int used;
} Alias;
Alias alias_table[MAXALI];
#endif