-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple_sh.h
More file actions
23 lines (21 loc) · 739 Bytes
/
simple_sh.h
File metadata and controls
23 lines (21 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include <sys/wait.h>
#include <errno.h>
#define COMMAND_ARGV_MAX 10
#define HISTORY_LIST_MAX 100
#define BUFFER_MAX 1024
void prompt();
int interpret_input(char *buf, char **parameters);
void run();
void add_history(int *counter, char **history, char *command);
int built_in(int *h_counter, char **history, char **parameters, int pipe, char **temp);
int s2i(char *parameter);
void clear_history(char **history);
void generate_pipe(char *line, int count_loop, char **history, int *h_counter);
int interpret_line(char *line, char *delimtor, char **items);
int builtin_pipe(char **history, char **item, int *h_counter);