-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
48 lines (36 loc) · 907 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
/********************************************
main.c
copyright 1991,2014-2016 Michael D. Brennan
This is a source file for mawk, an implementation of
the AWK programming language.
Mawk is distributed without warranty under the terms of
the GNU General Public License, version 3, 2007.
If you import elements of this code into another product,
you agree to not name that product mawk.
********************************************/
/* main.c */
#include "mawk.h"
#include "init.h"
#include "code.h"
#include "files.h"
int exit_code;
INST * execution_start = 0;
int
main( int argc, char ** argv )
{
initialize( argc, argv );
parse();
mawk_execute( execution_start, eval_stack - 1, 0 );
/* never returns */
return 0;
}
void
mawk_exit( int x )
{
if ( mawk_state == EXECUTION ) {
if ( close_all_output() < 0 ) {
x = 2;
}
}
exit( x );
}