From 06a02a3a50baf261a0f1c998bfd02269c3ed45de Mon Sep 17 00:00:00 2001 From: "Douglas B. Rumbaugh" Date: Fri, 31 Oct 2025 23:41:32 -0400 Subject: Initial commit --- include/command.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 include/command.h (limited to 'include/command.h') diff --git a/include/command.h b/include/command.h new file mode 100644 index 0000000..3df724b --- /dev/null +++ b/include/command.h @@ -0,0 +1,35 @@ +/* + * + */ + +#ifndef H_HUSH_COMMAND +#define H_HUSH_COMMAND + +#include + +#include "lexer.h" +#include "config.h" + +typedef struct command { + char *command; + char *infile; + char *outfile; + struct command *next; + pid_t pid; + + int pipe[2]; + int *read_pipe; + + char *args[MAX_ARGUMENT_CNT + 2]; +} command; + + +command *commands_from_tokens(token *parsed_cmdstr, size_t *cnt); + +void print_commands(FILE *file, command *cmds); + +void destroy_commands(command *cmds); + +int execute_command(command *cmd); + +#endif -- cgit v1.2.3