#ifndef COMMAND_H
#define COMMAND_H
enum {RT_REDIRECT_INPUT, RT_REDIRECT_OUTPUT, RT_REDIRECT_OUTPUT_FORCE, RT_REDIRECT_OUTPUT_APPEND, RT_DUPLICATE_INPUT, RT_DUPLICATE_OUTPUT, RT_READ_WRITE};
enum {CT_SIMPLE, CT_COMPOUND};
enum {CC_SUBSHELL};
enum {AO_AND, AO_OR};
struct argument_struct {
char *word;
struct argument_struct *next;
};
struct redirect_struct {
int fd;
int type;
char *filename;
struct redirect_struct *next;
};
struct simple_command_struct {
char *command_name;
struct argument_struct *first_argument;
struct redirect_struct *first_redirect;
};
struct compound_command_struct {
int type;
union {
struct list_struct *list;
};
struct redirect_struct *first_redirect;
};
struct command_struct {
int line_number;
int type;
union {
struct simple_command_struct simple_command;
struct compound_command_struct compound_command;
};
struct command_struct *next;
};
struct pipeline_struct {
int line_number;
struct command_struct *first_command;
struct pipeline_struct *next;
int operator;
};
struct and_or_list_struct {
int line_number;
struct pipeline_struct *first_pipeline;
int asynchronous;
struct and_or_list_struct *next;
};
struct list_struct {
int line_number;
struct and_or_list_struct *first_and_or_list;
};
#endif