-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.h
More file actions
35 lines (33 loc) · 1.11 KB
/
shell.h
File metadata and controls
35 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
#include "history.h"
#include "alias.h"
#define TOO_FEW_ARGS "Too few arguments: "
#define TOO_MANY_ARGS "Too many arguments: "
#define BUFFER_SIZE 512
#define ARG_LIMIT 50
void display_prompt();
void invoke_history(History* history, char* user_input);
void exec_cmd(char** args, bool stop);
void get_new_path(char* user_input);
void set_dir(char* user_input);
void set_new_path(char* new_path);
void replacetilde(char* path);
void changedir_cmd(char** args);
void getpath_cmd(char** args);
void setpath_cmd(char** args);
void history_cmd(char** args, History* history);
void alias_cmd(char** args, Alias_List alias_list);
void unalias_cmd(char** args, Alias_List alias_list);
char* reconstruct_args(char** args, int start, int end);
char* get_input(char* user_input);
char* get_last_word(char* user_input);
int split_str(char** array, char* user_input, char* seperators);
bool handle_cmd(char** args, History* history, Alias_List alias_list);