summaryrefslogtreecommitdiff
path: root/miniperlmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'miniperlmain.c')
-rw-r--r--miniperlmain.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/miniperlmain.c b/miniperlmain.c
index 0e1b0f990e..44c3d71874 100644
--- a/miniperlmain.c
+++ b/miniperlmain.c
@@ -1,26 +1,42 @@
+/*
+ * "The Road goes ever on and on, down from the door where it began."
+ */
+
#include "INTERN.h"
#include "perl.h"
+static void xs_init _((void));
+static PerlInterpreter *my_perl;
+
+/* This value may be raised by extensions for testing purposes */
+int perl_destruct_level = 0; /* 0=none, 1=full, 2=full with checks */
+
+int
main(argc, argv, env)
int argc;
char **argv;
char **env;
{
int exitstatus;
- PerlInterpreter *my_perl;
- my_perl = perl_alloc();
- if (!my_perl)
- exit(1);
- perl_construct( my_perl );
+#ifdef VMS
+ getredirection(&argc,&argv);
+#endif
+
+ if (!do_undump) {
+ my_perl = perl_alloc();
+ if (!my_perl)
+ exit(1);
+ perl_construct( my_perl );
+ }
- exitstatus = perl_parse( my_perl, argc, argv, env );
+ exitstatus = perl_parse( my_perl, xs_init, argc, argv, env );
if (exitstatus)
exit( exitstatus );
exitstatus = perl_run( my_perl );
- perl_destruct( my_perl );
+ perl_destruct( my_perl, perl_destruct_level );
perl_free( my_perl );
exit( exitstatus );
@@ -28,9 +44,8 @@ char **env;
/* Register any extra external extensions */
-void
-perl_init_ext()
+static void
+xs_init()
{
- char *file = __FILE__;
/* Do not delete this line--writemain depends on it */
}