mirror of
https://github.com/Comp211-SP24/project-Rushilwiz.git
synced 2025-04-03 20:20:17 -04:00
added shell.c
This commit is contained in:
parent
01aaa805d1
commit
7fbefbfefa
18
shell.c
18
shell.c
|
@ -1,20 +1,26 @@
|
|||
// PID: 9DigitPidNoSpacesOrDashes
|
||||
// PID: 730677144
|
||||
// I pledge the COMP 211 honor code.
|
||||
|
||||
// All necessary libraries are included in shell.h
|
||||
#include "shell.h"
|
||||
|
||||
void alloc_mem_for_argv(command_t* p_cmd) {
|
||||
// TODO:
|
||||
p_cmd->argv = (char**)malloc((p_cmd->argc + 1) * sizeof(char*));
|
||||
for (int i = 0; i < p_cmd->argc; i++) {
|
||||
p_cmd->argv[i] = (char*)malloc(MAX_ARG_LEN * sizeof(char));
|
||||
}
|
||||
|
||||
p_cmd->argv[p_cmd->argc] = NULL;
|
||||
}
|
||||
|
||||
void cleanup(command_t* p_cmd) {
|
||||
// TODO:
|
||||
for (int i = 0; i < p_cmd->argc; i++) {
|
||||
free(p_cmd->argv[i]);
|
||||
p_cmd->argv[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void parse(char* line, command_t* p_cmd) {
|
||||
// TODO:
|
||||
}
|
||||
void parse(char* line, command_t* p_cmd) {}
|
||||
|
||||
bool find_full_path(command_t* p_cmd) {
|
||||
// TODO:
|
||||
|
|
Loading…
Reference in New Issue
Block a user