forked from Martell0x1/PosPosShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.h
More file actions
28 lines (27 loc) · 721 Bytes
/
Copy pathshell.h
File metadata and controls
28 lines (27 loc) · 721 Bytes
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
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <signal.h>
#ifndef MAX_INPUT
#define MAX_INPUT 2048
#endif
#define MAX_ARGS 64
#define MAX_HISTORY 100
#define HISTORY_FILE ".myShell_history"
extern char history[MAX_HISTORY][MAX_INPUT];
extern int history_count;
void init_shell();
void print_prompt();
void execute_command(char* input);
int parse_args(char* input , char** args);
int handle_commands(int args_count,char** args);
void execute_a_fork_family(char** args , int background);
void add_history(char *input);
void print_history();
void load_history();
void save_history(char *command);