diff options
Diffstat (limited to 'cmd.h')
-rw-r--r-- | cmd.h | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1,6 +1,7 @@ | |||
1 | #ifndef CMD_H | 1 | #ifndef CMD_H |
2 | #define CMD_H | 2 | #define CMD_H |
3 | 3 | ||
4 | #include <fcntl.h> | ||
4 | #include <pwd.h> | 5 | #include <pwd.h> |
5 | #include <stdbool.h> | 6 | #include <stdbool.h> |
6 | #include <stdio.h> | 7 | #include <stdio.h> |
@@ -9,7 +10,6 @@ | |||
9 | #include <sys/types.h> | 10 | #include <sys/types.h> |
10 | #include <sys/wait.h> | 11 | #include <sys/wait.h> |
11 | #include <unistd.h> | 12 | #include <unistd.h> |
12 | #include <fcntl.h> | ||
13 | 13 | ||
14 | typedef enum { | 14 | typedef enum { |
15 | CMD_NORMAL, | 15 | CMD_NORMAL, |
@@ -31,9 +31,15 @@ typedef struct Command { | |||
31 | } Command; | 31 | } Command; |
32 | 32 | ||
33 | void showPrompt(); | 33 | void showPrompt(); |
34 | Command *newcmd(); | 34 | Command *newCmd(); |
35 | int runcmd(Command *cmd); | 35 | |
36 | void freecmd(Command *cmd); | 36 | int runCmd(Command *cmd); |
37 | void printcmd(Command *cmd); | 37 | int runNormalCmd(Command *cmd); |
38 | int runPipeCmd(Command *cmd); | ||
39 | int runAndOrCmd(Command *cmd); | ||
40 | |||
41 | void freeCmd(Command *cmd); | ||
42 | |||
43 | void redirect(Command *cur); | ||
38 | 44 | ||
39 | #endif \ No newline at end of file | 45 | #endif \ No newline at end of file |