Quash Shell  0.1
A simple yet powerfull shell program
execute.h
Go to the documentation of this file.
1 
7 #ifndef SRC_EXECUTE_H
8 #define SRC_EXECUTE_H
9 
10 #include <stdbool.h>
11 #include <unistd.h>
12 
13 #include "command.h"
14 
22 const char* lookup_env(const char* env_var);
23 
31 void write_env(const char* env_var, const char* val);
32 
44 char* get_current_directory(bool* should_free);
45 
50 
64 void print_job(int job_id, pid_t pid, const char* cmd);
65 
78 void print_job_bg_start(int job_id, pid_t pid, const char* cmd);
79 
92 void print_job_bg_complete(int job_id, pid_t pid, const char* cmd);
93 
101 void run_generic(GenericCommand cmd);
102 
110 void run_echo(EchoCommand cmd);
111 
119 void run_export(ExportCommand cmd);
120 
128 void run_cd(CDCommand cmd);
129 
137 void run_kill(KillCommand cmd);
138 
144 void run_pwd();
145 
151 void run_jobs();
152 
163 void run_script(CommandHolder* holders);
164 
165 #endif
void run_cd(CDCommand cmd)
Run the builtin cd (change directory) command.
Definition: execute.c:137
Command structures and functions for defining and managing commands.
void run_export(ExportCommand cmd)
Run the builtin export command.
Definition: execute.c:122
Contains information about the properties of the command.
Definition: command.h:207
Command to set environment variables.
Definition: command.h:119
char * get_current_directory(bool *should_free)
Get the real current working directory.
Definition: execute.c:28
void run_generic(GenericCommand cmd)
Run a generic (non-builtin) command.
Definition: execute.c:88
Command to kill a process based on it&#39;s job id.
Definition: command.h:141
void run_jobs()
Run the builtin jobs command to show the jobs list.
Definition: execute.c:179
void print_job_bg_complete(int job_id, pid_t pid, const char *cmd)
Print the completion of a background job to standard out.
Definition: execute.c:78
void print_job(int job_id, pid_t pid, const char *cmd)
Print a job to standard out.
Definition: execute.c:66
const char * lookup_env(const char *env_var)
Function to get environment variable values.
Definition: execute.c:40
void run_script(CommandHolder *holders)
Common entry point for all commands.
Definition: execute.c:314
void check_jobs_bg_status()
Check on background jobs to see if they have exited.
Definition: execute.c:54
void write_env(const char *env_var, const char *val)
Function to set and define environment variable values.
Command to change directories.
Definition: command.h:131
void run_kill(KillCommand cmd)
Run the builtin kill command.
Definition: execute.c:156
void run_echo(EchoCommand cmd)
Run the builtin echo command.
Definition: execute.c:106
void print_job_bg_start(int job_id, pid_t pid, const char *cmd)
Print the start up of a background job to standard out.
Definition: execute.c:72
void run_pwd()
Run the builtin pwd (print working directory) command.
Definition: execute.c:170
Commands that take any number of arguments and are not built into Quash.
Definition: command.h:99