perl5.000 patch.0g: [various portability fixes, and use latest metaconfig for Configure]
[p5sagit/p5-mst-13.2.git] / miniperlmain.c
1 /*
2  * "The Road goes ever on and on, down from the door where it began."
3  */
4
5 #include "EXTERN.h"
6 #include "perl.h"
7
8 static void xs_init _((void));
9 static PerlInterpreter *my_perl;
10
11 /* This value may be raised by extensions for testing purposes */
12 int perl_destruct_level = 0; /* 0=none, 1=full, 2=full with checks */
13
14 int
15 main(argc, argv, env)
16 int argc;
17 char **argv;
18 char **env;
19 {
20     int exitstatus;
21
22 #ifdef VMS
23     getredirection(&argc,&argv);
24 #endif
25
26     if (!do_undump) {
27         my_perl = perl_alloc();
28         if (!my_perl)
29             exit(1);
30         perl_construct( my_perl );
31     }
32
33     exitstatus = perl_parse( my_perl, xs_init, argc, argv, env );
34     if (exitstatus)
35         exit( exitstatus );
36
37     exitstatus = perl_run( my_perl );
38
39     perl_destruct( my_perl, perl_destruct_level );
40     perl_free( my_perl );
41
42     exit( exitstatus );
43 }
44
45 /* Register any extra external extensions */
46
47 static void
48 xs_init()
49 {
50     /* Do not delete this line--writemain depends on it */
51 }