-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.h
More file actions
42 lines (33 loc) · 924 Bytes
/
Copy pathheader.h
File metadata and controls
42 lines (33 loc) · 924 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef HEADER_H
#define HEADER_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <signal.h>
#include <termios.h>
#define MAX_COMMAND_LENGTH 1024
#define BUFFER_SIZE 1024
#define HISTORY_SIZE 3
#define TOKEN_DELIMITER " \t\r\n\a"
extern char **history;
extern int history_index , h_ptr ,history_size;
// Function declarations
void execute_commands_from_file(const char *filename);
char **parse_line(char *line);
void execute_command(char **args);
int shell_cd(char **args);// for cd
int contains_redirect(char **args);
void handle_redirect(char **args);
int contains_pipe(char **args);
void pipe_commands(char **args);
char *replace_env_var(char *);
void add_to_history(char *line);
char *get_previous_command();
char *get_next_command();
void exe_prev_cmd();
int contains_chain(char ** args);
void handle_chain(char ** args);
#endif