do_sv_dump does dump (core) on IO handles
[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"
2304df62 11#include "perl.h"
12
a0d0e21e 13static void xs_init _((void));
14static PerlInterpreter *my_perl;
15
61ae2fbf 16#if defined (__MINT__) || defined (atarist)
17/* The Atari operating system doesn't have a dynamic stack. The
18 stack size is determined from this value. */
19long _stksize = 64 * 1024;
20#endif
21
c07a80fd 22int
dc6439a4 23main(int argc, char **argv, char **env)
2304df62 24{
25 int exitstatus;
2304df62 26
22239a37 27#ifdef PERL_GLOBAL_STRUCT
28#define PERLVAR(var,type) /**/
533c011a 29#define PERLVARI(var,type,init) PL_Vars.var = init;
30#define PERLVARIC(var,type,init) PL_Vars.var = init;
22239a37 31#include "perlvars.h"
32#undef PERLVAR
33#undef PERLVARI
0f3f18a6 34#undef PERLVARIC
22239a37 35#endif
36
c07a80fd 37 PERL_SYS_INIT(&argc,&argv);
4633a7c4 38
b5dd7652 39 perl_init_i18nl10n(1);
4633a7c4 40
3280af22 41 if (!PL_do_undump) {
a0d0e21e 42 my_perl = perl_alloc();
43 if (!my_perl)
44 exit(1);
45 perl_construct( my_perl );
3280af22 46 PL_perl_destruct_level = 0;
a0d0e21e 47 }
2304df62 48
28e44ed9 49 exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
b5dd7652 50 if (!exitstatus) {
51 exitstatus = perl_run( my_perl );
52 }
2304df62 53
748a9306 54 perl_destruct( my_perl );
2304df62 55 perl_free( my_perl );
56
a91be337 57 PERL_SYS_TERM();
58
2304df62 59 exit( exitstatus );
4e35701f 60 return exitstatus;
2304df62 61}
62
63/* Register any extra external extensions */
64
4633a7c4 65/* Do not delete this line--writemain depends on it */
66
a0d0e21e 67static void
8ac85365 68xs_init(void)
2304df62 69{
a91be337 70 dXSUB_SYS;
2304df62 71}