Big commit: Setup outline for piping, piping has errors still, cleaned code

This commit is contained in:
2022-10-29 05:14:23 -05:00
parent 4b3f4c1433
commit b33abaf517
6 changed files with 143 additions and 65 deletions
+3
View File
@@ -1,11 +1,14 @@
#ifndef COMMON_H
#define COMMON_H
const char* GetHomeDir(void);
typedef struct CommandStruct {
char* argv[100]; // Max 100 commands
int argc;
} CommandStruct;
void CopyCommandStruct(CommandStruct* oldCommand, CommandStruct* newCommand, int start, int end);
void ResetCommandStruct(CommandStruct* command);
#endif
+4 -4
View File
@@ -3,16 +3,16 @@
#include "Common.h"
const char* GetHomeDir(void);
void CheckRedirection(CommandStruct* command);
int CheckSymbol(CommandStruct* command, char symbol, int start);
int IntegratedCheck(CommandStruct* command);
void GetInput(char* inputString);
void append(char *input, char *file);
void input(char *command);
void ExecPipe();
int ExecPipe(CommandStruct* commandParent, CommandStruct* commandChild, int* pipefd);
void output(char *command);
void SplitInput(char* inputString, CommandStruct* command);
void ParseInput(char* inputString, CommandStruct* command, char *symbol);
void ReadPishrc(CommandStruct* command, char* inputString);
void ParseInput(char* inputString, CommandStruct* command, char* symbol);
void RunChild(CommandStruct* commandChild, int* pipefd);
void ioRedirection(CommandStruct* command);
#endif
+1
View File
@@ -4,5 +4,6 @@
#include "Common.h"
void Pish(void);
void ReadPishrc(CommandStruct* commandParent, CommandStruct *commandChild, char* inputString);
#endif