-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
38 lines (35 loc) · 680 Bytes
/
main.c
File metadata and controls
38 lines (35 loc) · 680 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
#include "list.h"
#include "tree.h"
#include "exec.h"
#include "io.h"
#include <sys/signal.h>
#include <sys/types.h>
#include <unistd.h>
/* Отладка */
#define DEBUG 0
int main()
{
list lst;
tree t;
pid_table * pt;
signal(SIGINT, SIG_IGN);
print_str(">>> ");
pt = init_back();
while(!build_list(&lst))
{
subst(lst);
if (DEBUG)
print_list(lst);
t = build_tree(lst);
clear_list(lst);
if (DEBUG)
print_tree(t, 0);
execute(t, pt);
check_back(pt);
clear_tree(t);
print_str(">>> ");
}
print_str("\n");
clean_back(pt, 1);
return 0;
}