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