Merge from vendor branch OPENSSH:
[dragonfly.git] / contrib / perl5 / miniperlmain.c
1 /*
2  * "The Road goes ever on and on, down from the door where it began."
3  */
4
5 #ifdef OEMVS
6 #pragma runopts(HEAP(1M,32K,ANYWHERE,KEEP,8K,4K))
7 #endif
8
9
10 #include "EXTERN.h"
11 #include "perl.h"
12
13 static void xs_init _((void));
14 static PerlInterpreter *my_perl;
15
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.  */
19 long _stksize = 64 * 1024;
20 #endif
21
22 int
23 main(int argc, char **argv, char **env)
24 {
25     int exitstatus;
26
27 #ifdef PERL_GLOBAL_STRUCT
28 #define PERLVAR(var,type) /**/
29 #define PERLVARI(var,type,init) PL_Vars.var = init;
30 #define PERLVARIC(var,type,init) PL_Vars.var = init;
31 #include "perlvars.h"
32 #undef PERLVAR
33 #undef PERLVARI
34 #undef PERLVARIC
35 #endif
36
37     PERL_SYS_INIT(&argc,&argv);
38
39     perl_init_i18nl10n(1);
40
41     if (!PL_do_undump) {
42         my_perl = perl_alloc();
43         if (!my_perl)
44             exit(1);
45         perl_construct( my_perl );
46         PL_perl_destruct_level = 0;
47     }
48
49     exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
50     if (!exitstatus) {
51         exitstatus = perl_run( my_perl );
52     }
53
54     perl_destruct( my_perl );
55     perl_free( my_perl );
56
57     PERL_SYS_TERM();
58
59     exit( exitstatus );
60     return exitstatus;
61 }
62
63 /* Register any extra external extensions */
64
65 /* Do not delete this line--writemain depends on it */
66
67 static void
68 xs_init(void)
69 {
70   dXSUB_SYS;
71 }