-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.h
44 lines (31 loc) · 872 Bytes
/
shell.h
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
36
37
38
39
40
41
42
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/wait.h>
#include "shell.c"
//Handles signals like interruptions etc.
void signalhandler(int sig);
//Change Directory
void cd(char *args[]);
// If you do cd ../.. It appends them to prompt instead of removing files
//Subfunction of cd for reversal
char *cd_back(void);
//Lists items inside directory
void dir(char *args[]);
//To do: Add option of flags to do long list or recursive
//Exit shell
void quit(char *args[]);
//Clear terminal window
void clr(char *args[]);
//Print list of enviroment variables
void environf(char *args[]);
// Handles execution of scripts or C files etc.
void execute_file(char *args[], int flag);
//Gets prompt
char *getprompt(void);
//Lists enviroment variables
extern char **environ;