This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[win32] Revert to keeping (some) constant strings as globals
[perl5.git] / miniperlmain.c
CommitLineData
a0d0e21e
LW
1/*
2 * "The Road goes ever on and on, down from the door where it began."
3 */
4
60e4866f
LJ
5#ifdef OEMVS
6#pragma runopts(HEAP(1M,32K,ANYWHERE,KEEP,8K,4K))
7#endif
8
4633a7c4 9
ecfc5424 10#include "EXTERN.h"
2304df62
AD
11#include "perl.h"
12
a0d0e21e
LW
13static void xs_init _((void));
14static PerlInterpreter *my_perl;
15
c07a80fd 16int
dc6439a4
PP
17#ifdef CAN_PROTOTYPE
18main(int argc, char **argv, char **env)
19#else
2304df62
AD
20main(argc, argv, env)
21int argc;
22char **argv;
23char **env;
dc6439a4 24#endif
2304df62
AD
25{
26 int exitstatus;
2304df62 27
22239a37
NIS
28#ifdef PERL_GLOBAL_STRUCT
29#define PERLVAR(var,type) /**/
30#define PERLVARI(var,type,init) Perl_Vars.var = init;
3fe35a81 31#define PERLVARIC(var,type,init) Perl_Vars.var = init;
22239a37
NIS
32#include "perlvars.h"
33#undef PERLVAR
34#undef PERLVARI
3fe35a81 35#undef PERLVARC
22239a37
NIS
36#endif
37
c07a80fd 38 PERL_SYS_INIT(&argc,&argv);
4633a7c4 39
b5dd7652 40 perl_init_i18nl10n(1);
4633a7c4 41
a0d0e21e
LW
42 if (!do_undump) {
43 my_perl = perl_alloc();
44 if (!my_perl)
45 exit(1);
46 perl_construct( my_perl );
5f05dabc 47 perl_destruct_level = 0;
a0d0e21e 48 }
2304df62 49
28e44ed9 50 exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
b5dd7652
PP
51 if (!exitstatus) {
52 exitstatus = perl_run( my_perl );
53 }
2304df62 54
748a9306 55 perl_destruct( my_perl );
2304df62
AD
56 perl_free( my_perl );
57
a91be337
PP
58 PERL_SYS_TERM();
59
2304df62 60 exit( exitstatus );
4e35701f 61 return exitstatus;
2304df62
AD
62}
63
64/* Register any extra external extensions */
65
4633a7c4
LW
66/* Do not delete this line--writemain depends on it */
67
a0d0e21e 68static void
8ac85365 69xs_init(void)
2304df62 70{
a91be337 71 dXSUB_SYS;
2304df62 72}