Adjusted comments and added temporary tests for functions
This commit is contained in:
parent
7cfdc280cf
commit
f3f0a2cbf2
21
src/Pish.c
21
src/Pish.c
@ -2,28 +2,31 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/wait.h>
|
||||
#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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user