-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.h
42 lines (38 loc) · 890 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
#ifndef SHELL_H
#define SHELL_H
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <dirent.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#define MAX_ARGS 1024
#define READ 0
#define WRITE 1
typedef struct parseInfo {
char *command;
char **arguments;
} parseInfo;
// Function declarations
char *readline(char*);
parseInfo *parse(char *cmdLine);
void executeCommand(parseInfo *info);
void pwd();
int ifcd(parseInfo *info);
void nano(char* filename);
void cat(parseInfo *info);
void wc(char **arguments);
void cp(char **arguments);
void clear();
void grep(char **arguments);
void executePipe(parseInfo* info);
void ls(char **arguments);
int isPipe(char **arguments);
void printCurrentPath();
void printTree(char* path, int depth);
#endif // SHELL_FUNCTIONS_H