This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make evals' lexicals visible to nested evals
[perl5.git] / miniperlmain.c
1 /*
2  * "The Road goes ever on and on, down from the door where it began."
3  */
4
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8
9 #include "EXTERN.h"
10 #include "perl.h"
11
12 #ifdef __cplusplus
13 }
14 #  define EXTERN_C extern "C"
15 #else
16 #  define EXTERN_C extern
17 #endif
18
19 static void xs_init _((void));
20 static PerlInterpreter *my_perl;
21
22 int
23 #ifdef CAN_PROTOTYPE
24 main(int argc, char **argv, char **env)
25 #else
26 main(argc, argv, env)
27 int argc;
28 char **argv;
29 char **env;
30 #endif
31 {
32     int exitstatus;
33
34     PERL_SYS_INIT(&argc,&argv);
35
36     perl_init_i18nl10n(1);
37
38     if (!do_undump) {
39         my_perl = perl_alloc();
40         if (!my_perl)
41             exit(1);
42         perl_construct( my_perl );
43         perl_destruct_level = 0;
44     }
45
46     exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
47     if (!exitstatus) {
48         exitstatus = perl_run( my_perl );
49     }
50
51     perl_destruct( my_perl );
52     perl_free( my_perl );
53
54     PERL_SYS_TERM();
55
56     exit( exitstatus );
57 }
58
59 /* Register any extra external extensions */
60
61 /* Do not delete this line--writemain depends on it */
62
63 static void
64 xs_init()
65 {
66   dXSUB_SYS;
67 }