-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand.h
45 lines (35 loc) · 859 Bytes
/
command.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
45
#ifndef command_h
#define command_h
// Command Data Structure
struct SimpleCommand {
// Available space for arguments currently preallocated
int _numberOfAvailableArguments;
// Number of arguments
int _numberOfArguments;
char ** _arguments;
SimpleCommand();
void insertArgument( char * argument );
};
struct Command {
int _numberOfAvailableSimpleCommands;
int _numberOfSimpleCommands;
SimpleCommand ** _simpleCommands;
char * _outFile;
char * _inputFile;
char * _errFile;
bool _append;
int _background;
void prompt();
void print();
void execute();
void clear();
void leave();
void cd(char * dir);
void static sigIntIgnore(int sig);
void static handler (int sig);
Command();
void insertSimpleCommand( SimpleCommand * simpleCommand );
static Command _currentCommand;
static SimpleCommand *_currentSimpleCommand;
};
#endif