#include "Common.h" #include #include #include #include #include // Gets home directory location of user const char* GetHomeDir(void) { char *homeDir = (getpwuid(getuid()))->pw_dir; return homeDir; } // Copies a range of an old command object to new command object void CopyCommandStruct(CommandStruct* oldCommand, CommandStruct* newCommand, int start, int end) { newCommand->argc = end - start; for (int i = 0; i < newCommand->argc; i++) newCommand->argv[i] = oldCommand->argv[i + start]; return; } // Resets entire command object void ResetCommandStruct(CommandStruct* command) { for (int i = 0; i < command->argc; i++) command->argv[i] = NULL; command->argc = 0; return; }