From f3f0a2cbf21d0ab01e9d7b1ce056bfb689327764 Mon Sep 17 00:00:00 2001 From: TriantaTV Date: Wed, 19 Oct 2022 21:46:44 -0500 Subject: [PATCH] Adjusted comments and added temporary tests for functions --- src/Pish.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/Pish.c b/src/Pish.c index a1f5d20..cac9605 100644 --- a/src/Pish.c +++ b/src/Pish.c @@ -2,28 +2,31 @@ #include #include #include +#include "Integrated.h" #include "Pish.h" -// Dummy function for Pish to run +// Prints a prompt and then reads a command from the terminal char* getInput(void) { - ; + return "echo hello world"; } -// Dummy function for Pish to run +// Executes a command to the system void exec(char* command) { - ; + system(command); } - - +// Main function for Pish program void Pish(void) { + char* command; + int retval; while (1) { - char* command = getInput(); - int retval = fork(); + command = getInput(); + IntegratedCheck(command); + retval = fork(); // Child if (retval == 0) { @@ -42,5 +45,7 @@ void Pish(void) int pid = retval; wait(pid); } + // TODO: Remove break when while loop doesn't break program + break; } }