-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
57 lines (53 loc) · 1021 Bytes
/
main.c
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef HEAD
#define HEAD
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include<signal.h>
#include"del.h"
#endif // head
new_table table;
obj_ptr headp = NULL;
obj_ptr tailp = NULL;
int bg;
int main()
{
table.size = 0;
table.num = 0;
table.begin = NULL;
while(1)
{
int error = 0;
bg = 0;
char notation = '$';
char* input = (char*)malloc(sizeof(char)*128);
printf("%c ",notation);
fflush(stdin);
if(!fgets(input,128,stdin))
{
printf("error: fgets");
continue;
}
push(input);
error = parser(input);
bg = is_bg();
if(error)
{
set_free(headp);
continue;
}
if(is_builtin_cmd(&error))
{
if(error) continue;
}
else
solve();
set_free(headp);
}
return 0;
}