-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsh_header.h
40 lines (36 loc) · 855 Bytes
/
sh_header.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
#include<stdio.h>
#include<string.h>
#include<unistd.h>
#include<stdlib.h>
#include<stdint.h>
#include<sys/wait.h>
#include<sys/types.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<signal.h>
typedef struct flag{
uint8_t exit_flag:1;/*flag to check exit status of shell; 0:indicates exit*/
uint8_t unused1:1;
uint8_t unused2:1;
uint8_t unused3:1;
uint8_t unused4:1;
uint8_t unused5:1;
uint8_t unused6:1;
uint8_t unused7:1;
}FLAG;
typedef struct q_node{
unsigned int serial_no;
char stored_command[130];
struct q_node* next;
}Q_NODE;
/*Queue Operation <queue.c>*/
void enqueue(Q_NODE **,char* );
void dequeue(Q_NODE **);
void show_command_history(Q_NODE *);
int count_node(Q_NODE *);
/*string based operations<string_op.c>*/
int command_not_null(char*);
void arrange(char*);
/*execution*/
void execute(char*);
int execute_command(char*);