-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcommand.h
42 lines (37 loc) · 955 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
#ifndef COMMAND_H
#define COMMAND_H
#include <unistd.h>
#include <stdbool.h>
#include "astree.h"
struct CommandInternal
{
int argc;
char **argv;
bool stdin_pipe;
bool stdout_pipe;
int pipe_read;
int pipe_write;
char* redirect_in;
char* redirect_out;
bool asynchrnous;
};
typedef struct CommandInternal CommandInternal;
void set_prompt(char* str);
char* getprompt();
void ignore_signal_for_shell();
void execute_cd(CommandInternal* cmdinternal);
void execute_prompt(CommandInternal* cmdinternal);
void execute_pwd(CommandInternal* cmdinternal);
void execute_command_internal(CommandInternal* cmdinternal);
int init_command_internal(ASTreeNode* simplecmdNode,
CommandInternal* cmdinternal,
bool async,
bool stdin_pipe,
bool stdout_pipe,
int pipe_read,
int pipe_write,
char* redirect_in,
char* redirect_out
);
void destroy_command_internal(CommandInternal* cmdinternal);
#endif