glob-basic.t, runenv.t fix-ups
[p5sagit/p5-mst-13.2.git] / miniperlmain.c
CommitLineData
a0d0e21e 1/*
2 * "The Road goes ever on and on, down from the door where it began."
3 */
4
60e4866f 5#ifdef OEMVS
6#pragma runopts(HEAP(1M,32K,ANYWHERE,KEEP,8K,4K))
7#endif
8
4633a7c4 9
ecfc5424 10#include "EXTERN.h"
864dbfa3 11#define PERL_IN_MINIPERLMAIN_C
2304df62 12#include "perl.h"
13
864dbfa3 14static void xs_init (pTHX);
a0d0e21e 15static PerlInterpreter *my_perl;
16
61ae2fbf 17#if defined (__MINT__) || defined (atarist)
18/* The Atari operating system doesn't have a dynamic stack. The
19 stack size is determined from this value. */
20long _stksize = 64 * 1024;
21#endif
22
c07a80fd 23int
dc6439a4 24main(int argc, char **argv, char **env)
2304df62 25{
26 int exitstatus;
2304df62 27
22239a37 28#ifdef PERL_GLOBAL_STRUCT
29#define PERLVAR(var,type) /**/
51371543 30#define PERLVARA(var,type) /**/
533c011a 31#define PERLVARI(var,type,init) PL_Vars.var = init;
32#define PERLVARIC(var,type,init) PL_Vars.var = init;
22239a37 33#include "perlvars.h"
34#undef PERLVAR
51371543 35#undef PERLVARA
22239a37 36#undef PERLVARI
0f3f18a6 37#undef PERLVARIC
22239a37 38#endif
39
ed344e4f 40 PERL_SYS_INIT3(&argc,&argv,&env);
4633a7c4 41
3280af22 42 if (!PL_do_undump) {
a0d0e21e 43 my_perl = perl_alloc();
44 if (!my_perl)
45 exit(1);
642f9deb 46 perl_construct(my_perl);
3280af22 47 PL_perl_destruct_level = 0;
a0d0e21e 48 }
2304df62 49
642f9deb 50 exitstatus = perl_parse(my_perl, xs_init, argc, argv, (char **)NULL);
b5dd7652 51 if (!exitstatus) {
642f9deb 52 exitstatus = perl_run(my_perl);
b5dd7652 53 }
2304df62 54
642f9deb 55 perl_destruct(my_perl);
56 perl_free(my_perl);
2304df62 57
a91be337 58 PERL_SYS_TERM();
59
642f9deb 60 exit(exitstatus);
4e35701f 61 return exitstatus;
2304df62 62}
63
64/* Register any extra external extensions */
65
4633a7c4 66/* Do not delete this line--writemain depends on it */
67
a0d0e21e 68static void
864dbfa3 69xs_init(pTHX)
2304df62 70{
642f9deb 71 dXSUB_SYS;
2304df62 72}