[inseparable changes from match from perl-5.003_93 to perl-5.003_94]
[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
4633a7c4 5#ifdef __cplusplus
6extern "C" {
7#endif
8
ecfc5424 9#include "EXTERN.h"
2304df62 10#include "perl.h"
11
4633a7c4 12#ifdef __cplusplus
13}
14# define EXTERN_C extern "C"
15#else
16# define EXTERN_C extern
17#endif
18
a0d0e21e 19static void xs_init _((void));
20static PerlInterpreter *my_perl;
21
c07a80fd 22int
dc6439a4 23#ifdef CAN_PROTOTYPE
24main(int argc, char **argv, char **env)
25#else
2304df62 26main(argc, argv, env)
27int argc;
28char **argv;
29char **env;
dc6439a4 30#endif
2304df62 31{
32 int exitstatus;
2304df62 33
c07a80fd 34 PERL_SYS_INIT(&argc,&argv);
4633a7c4 35
b5dd7652 36 perl_init_i18nl10n(1);
4633a7c4 37
a0d0e21e 38 if (!do_undump) {
39 my_perl = perl_alloc();
40 if (!my_perl)
41 exit(1);
42 perl_construct( my_perl );
5f05dabc 43 perl_destruct_level = 0;
a0d0e21e 44 }
2304df62 45
28e44ed9 46 exitstatus = perl_parse( my_perl, xs_init, argc, argv, (char **) NULL );
b5dd7652 47 if (!exitstatus) {
48 exitstatus = perl_run( my_perl );
49 }
2304df62 50
748a9306 51 perl_destruct( my_perl );
2304df62 52 perl_free( my_perl );
53
a91be337 54 PERL_SYS_TERM();
55
2304df62 56 exit( exitstatus );
57}
58
59/* Register any extra external extensions */
60
4633a7c4 61/* Do not delete this line--writemain depends on it */
62
a0d0e21e 63static void
64xs_init()
2304df62 65{
a91be337 66 dXSUB_SYS;
2304df62 67}