back to scratko.xyz
summaryrefslogtreecommitdiff
path: root/shell.h
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2024-11-23 01:24:26 +0300
committerscratko <m@scratko.xyz>2024-11-23 01:24:26 +0300
commit3920a406c4161f6874d14ca8a78eca3c2b9fd9db (patch)
treeae4245f18ecd71c779c7d4cfbaec97db37725e61 /shell.h
parent821b146c54330cecba3ed2cc03a0f71ad83e540f (diff)
downloadshell-3920a406c4161f6874d14ca8a78eca3c2b9fd9db.tar.gz
shell-3920a406c4161f6874d14ca8a78eca3c2b9fd9db.tar.bz2
shell-3920a406c4161f6874d14ca8a78eca3c2b9fd9db.zip
Shell-VII release
Diffstat (limited to 'shell.h')
-rw-r--r--shell.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/shell.h b/shell.h
index b3dd93d..c92d68d 100644
--- a/shell.h
+++ b/shell.h
@@ -4,6 +4,8 @@
#include "dynamic_array.h"
#include "queue.h"
+#include <signal.h>
+
enum {
/* CTRL-D */
end_of_file = 4,
@@ -19,7 +21,10 @@ enum {
enum {
append = '>' + 1,
and = '&' + 1,
- or = '|' + 1
+ or = '|' + 1,
+ next_command = ';',
+ start_subshell = '(',
+ end_subshell = ')'
};
/* error codes */
@@ -30,7 +35,10 @@ enum {
err_bg_process = 4,
err_empty_command = 5,
err_extra_chars_after_filename = 6,
- err_odd_double_quotes = 7
+ err_odd_double_quotes = 7,
+ err_set_failure = 8,
+ err_missing_closing_bracket = 9,
+ err_repeated_background_ch = 10
};
/* storing file names to redirect standard input/output streams */
@@ -49,12 +57,19 @@ struct param_type {
int tokens;
int wrong_command;
struct io_type streams;
- int last_execution_status;
int pipeline;
int new_readline;
+ int general_pipe_pgid;
+ int general_subshell_pgid;
int general_pgid;
+ int subshell;
+ int fd_read_for_channel;
+ int fd_read_for_subshell;
+ int background_process;
};
+extern volatile sig_atomic_t last_execution_status;
+
int filename_waiting(struct param_type *params);
void add_filename(struct dynamic_array *tmp_word, struct param_type *params);
void add_word(struct w_queue *word_chain, struct dynamic_array *tmp_word,