char *getenv (char *); /* Usually in <stdlib.h> */
#endif
+static I32 read_e_script(pTHXo_ int idx, SV *buf_sv, int maxlen);
+
#ifdef I_FCNTL
#include <fcntl.h>
#endif
#endif /* PERL_OBJECT */
void
-perl_construct(register PerlInterpreter *my_perl)
+perl_construct(pTHXx)
{
#ifdef USE_THREADS
int i;
#endif
#ifdef MULTIPLICITY
- ++PL_ninterps;
Zero(my_perl, 1, PerlInterpreter);
#endif
}
void
-perl_destruct(register PerlInterpreter *my_perl)
+perl_destruct(pTHXx)
{
dTHR;
int destruct_level; /* 0=none, 1=full, 2=full with checks */
LEAVE;
FREETMPS;
-#ifdef MULTIPLICITY
- --PL_ninterps;
-#endif
-
/* We must account for everything. */
/* Destroy the main CV and syntax tree */
/* call exit list functions */
while (PL_exitlistlen-- > 0)
- PL_exitlist[PL_exitlistlen].fn(aTHX_ PL_exitlist[PL_exitlistlen].ptr);
+ PL_exitlist[PL_exitlistlen].fn(aTHXo_ PL_exitlist[PL_exitlistlen].ptr);
Safefree(PL_exitlist);
}
void
-perl_free(PerlInterpreter *my_perl)
+perl_free(pTHXx)
{
#ifdef PERL_OBJECT
Safefree(this);
}
int
-perl_parse(PerlInterpreter *my_perl, XSINIT_t xsinit, int argc, char **argv, char **env)
+perl_parse(pTHXx_ XSINIT_t xsinit, int argc, char **argv, char **env)
{
dTHR;
I32 oldscope;
Perl_croak(aTHX_ "No -e allowed in setuid scripts");
if (!PL_e_script) {
PL_e_script = newSVpvn("",0);
- filter_add(S_read_e_script, NULL);
+ filter_add(read_e_script, NULL);
}
if (*++s)
sv_catpv(PL_e_script, s);
boot_core_UNIVERSAL();
if (xsinit)
- (*xsinit)(aTHX); /* in case linked C routines want magical variables */
+ (*xsinit)(aTHXo); /* in case linked C routines want magical variables */
#if defined(VMS) || defined(WIN32) || defined(DJGPP)
init_os_extras(aTHX);
#endif
+#ifdef USE_SOCKS
+ SOCKSinit(argv[0]);
+#endif
+
init_predump_symbols();
/* init_postdump_symbols not currently designed to be called */
/* more than once (ENV isn't cleared first, for example) */
Perl_croak(aTHX_ "%s had compilation errors.\n", PL_origfilename);
else {
Perl_croak(aTHX_ "Execution of %s aborted due to compilation errors.\n",
- PL_origfilename);
+ PL_origfilename);
}
}
PL_curcop->cop_line = 0;
}
int
-perl_run(PerlInterpreter *my_perl)
+perl_run(pTHXx)
{
dTHR;
I32 oldscope;
CALLRUNOPS(aTHX);
}
+ my_exit(0);
+ /* NOTREACHED */
return NULL;
}
GvMULTI_on(PL_envgv);
hv = GvHVn(PL_envgv);
hv_magic(hv, PL_envgv, 'E');
-#ifndef VMS /* VMS doesn't have environ array */
+#if !defined( VMS) && !defined(EPOC) /* VMS doesn't have environ array */
/* Note that if the supplied env parameter is actually a copy
of the global environ then it may now point to free'd memory
if the environment has been modified since. To avoid this
#include "XSUB.h"
-STATIC I32
-S_read_e_script(pTHX_ int idx, SV *buf_sv, int maxlen)
+static I32
+read_e_script(pTHXo_ int idx, SV *buf_sv, int maxlen)
{
char *p, *nl;
p = SvPVX(PL_e_script);
nl = strchr(p, '\n');
nl = (nl) ? nl+1 : SvEND(PL_e_script);
if (nl-p == 0) {
- filter_del(S_read_e_script);
+ filter_del(read_e_script);
return 0;
}
sv_catpvn(buf_sv, p, nl-p);