48 #define REDIRECT_IN (0x01) 49 #define REDIRECT_OUT (0x04) 50 #define REDIRECT_APPEND (0x08) 51 #define PIPE_IN (0x10) 52 #define PIPE_OUT (0x20) 53 #define BACKGROUND (0x40) char * dir
Definition: command.h:133
JobsCommand jobs
Definition: command.h:196
char * env_var
Definition: command.h:121
CommandType
All possible types of commands.
Definition: command.h:63
CommandType get_command_holder_type(CommandHolder holder)
Get the type of the Command in the CommandHolder.
Definition: command.c:139
Contains information about the properties of the command.
Definition: command.h:207
Command cmd
Definition: command.h:221
Command mk_echo_command(char **args)
Create a EchoCommand structure and return a copy.
Definition: command.c:39
CommandType type
Definition: command.h:120
char flags
Definition: command.h:212
Command to set environment variables.
Definition: command.h:119
SimpleCommand simple
Definition: command.h:189
GenericCommand EchoCommand
Alias for GenericCommand to denote a command to print strings.
Definition: command.h:112
char * job_str
Definition: command.h:146
union Command Command
Make all command types the same size and interchangeable.
Command to kill a process based on it's job id.
Definition: command.h:141
struct SimpleCommand SimpleCommand
A command which has no arguments.
ExportCommand export
Definition: command.h:192
SimpleCommand PWDCommand
Alias for SimpleCommand to denote a print working directory command.
Definition: command.h:154
A command which has no arguments.
Definition: command.h:89
char * redirect_out
Definition: command.h:210
struct CDCommand CDCommand
Command to change directories.
Command mk_exit_command()
Create a ExitCommand structure and return a copy.
Definition: command.c:113
char * redirect_in
Definition: command.h:208
Command mk_kill_command(char *sig, char *job)
Create a KillCommand structure and return a copy.
Definition: command.c:76
void debug_print_script(const CommandHolder *holders)
Print all commands in the script with print_command()
Definition: command.c:270
Make all command types the same size and interchangeable.
Definition: command.h:188
int job
Definition: command.h:144
CommandHolder mk_command_holder(char *redirect_in, char *redirect_out, char flags, Command cmd)
Create a CommandHolder structure and return a copy.
Definition: command.c:14
CommandType type
Definition: command.h:132
Command to change directories.
Definition: command.h:131
struct CommandHolder CommandHolder
Contains information about the properties of the command.
Command mk_export_command(char *env_var, char *val)
Create a ExportCommand structure and return a copy.
Definition: command.c:51
Command mk_cd_command(char *dir)
Create a CDCommand structure and return a copy.
Definition: command.c:64
Command mk_pwd_command()
Create a PWDCommand structure and return a copy.
Definition: command.c:91
char * val
Definition: command.h:122
Command mk_jobs_command()
Create a JobsCommand structure and return a copy.
Definition: command.c:102
SimpleCommand ExitCommand
Alias for SimpleCommand to denote a termination of the program.
Definition: command.h:168
KillCommand kill
Definition: command.h:194
PWDCommand pwd
Definition: command.h:195
struct KillCommand KillCommand
Command to kill a process based on it's job id.
SimpleCommand JobsCommand
Alias for SimpleCommand to denote a print jobs list.
Definition: command.h:161
EOCCommand eoc
Definition: command.h:198
int sig
Definition: command.h:143
CommandType type
Definition: command.h:142
struct GenericCommand GenericCommand
Commands that take any number of arguments and are not built into Quash.
Command mk_generic_command(char **args)
Create a GenericCommand structure and return a copy.
Definition: command.c:27
CommandType get_command_type(Command cmd)
Get the type of the command.
Definition: command.c:135
EchoCommand echo
Definition: command.h:191
char * sig_str
Definition: command.h:145
struct ExportCommand ExportCommand
Command to set environment variables.
CommandType type
Definition: command.h:90
ExitCommand exit
Definition: command.h:197
CDCommand cd
Definition: command.h:193
char ** args
Definition: command.h:101
SimpleCommand EOCCommand
Alias for SimpleCommand to denote the end of a command.
Definition: command.h:175
CommandType type
Definition: command.h:100
Commands that take any number of arguments and are not built into Quash.
Definition: command.h:99
Command mk_eoc()
Create a EOCCommand structure and return a copy.
Definition: command.c:124