summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--XSLock.h2
-rw-r--r--XSUB.h21
-rw-r--r--bytecode.h2
-rw-r--r--bytecode.pl36
-rw-r--r--byterun.c2
-rw-r--r--cc_runtime.h20
-rw-r--r--djgpp/djgpp.c22
-rwxr-xr-xembed.pl2
-rw-r--r--ext/B/B.xs2
-rw-r--r--ext/B/B/Asmdata.pm22
-rw-r--r--ext/B/byteperl.c10
-rw-r--r--ext/DB_File/DB_File.xs28
-rw-r--r--ext/DB_File/typemap8
-rw-r--r--ext/DynaLoader/dl_dld.xs4
-rw-r--r--ext/DynaLoader/dl_next.xs2
-rw-r--r--ext/DynaLoader/dl_vms.xs10
-rw-r--r--ext/GDBM_File/typemap4
-rw-r--r--ext/IO/IO.xs8
-rw-r--r--ext/IPC/SysV/SysV.xs36
-rw-r--r--ext/NDBM_File/typemap4
-rw-r--r--ext/ODBM_File/ODBM_File.xs2
-rw-r--r--ext/ODBM_File/typemap4
-rw-r--r--ext/Opcode/Opcode.xs6
-rw-r--r--ext/POSIX/POSIX.xs36
-rw-r--r--ext/SDBM_File/typemap4
-rw-r--r--ext/Thread/Thread.xs34
-rw-r--r--ext/attrs/attrs.xs4
-rw-r--r--fakethr.h2
-rw-r--r--gv.c2
-rw-r--r--hv.c8
-rw-r--r--lib/ExtUtils/typemap6
-rw-r--r--malloc.c2
-rw-r--r--mg.c22
-rw-r--r--op.c24
-rw-r--r--os2/OS2/PrfDB/PrfDB.xs6
-rw-r--r--os2/OS2/PrfDB/typemap2
-rw-r--r--os2/OS2/REXX/REXX.xs10
-rw-r--r--os2/os2.c138
-rw-r--r--os2/os2ish.h2
-rw-r--r--perl.c126
-rw-r--r--perl.h26
-rw-r--r--pp.c2
-rw-r--r--pp_ctl.c28
-rw-r--r--pp_hot.c2
-rw-r--r--pp_sys.c30
-rw-r--r--regcomp.c4
-rw-r--r--regcomp.h2
-rw-r--r--regexec.c2
-rw-r--r--scope.c2
-rw-r--r--scope.h4
-rw-r--r--sv.h22
-rw-r--r--taint.c4
-rw-r--r--toke.c4
-rw-r--r--util.c18
-rw-r--r--vms/ext/DCLsym/DCLsym.xs2
-rw-r--r--vms/ext/Stdio/Stdio.xs50
-rw-r--r--vms/vms.c90
-rw-r--r--vms/vmsish.h4
-rw-r--r--win32/win32.c14
-rw-r--r--win32/win32thread.c6
60 files changed, 473 insertions, 528 deletions
diff --git a/XSLock.h b/XSLock.h
index 652f4929f1..43c610904b 100644
--- a/XSLock.h
+++ b/XSLock.h
@@ -26,7 +26,7 @@ CPerlObj* pPerl;
#undef dXSARGS
#define dXSARGS \
dSP; dMARK; \
- I32 ax = mark - stack_base + 1; \
+ I32 ax = mark - PL_stack_base + 1; \
I32 items = sp - mark; \
XSLock localLock; \
::pPerl = pPerl
diff --git a/XSUB.h b/XSUB.h
index 8edefcf8ed..48cf876346 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -10,11 +10,6 @@
#define XS(name) void name(cv) CV* cv;
#endif
-#define na PL_na
-#define sv_undef PL_sv_undef
-#define sv_yes PL_sv_yes
-#define sv_no PL_sv_no
-
#define dXSARGS \
dSP; dMARK; \
I32 ax = mark - PL_stack_base + 1; \
@@ -62,23 +57,23 @@
#ifdef XS_VERSION
# define XS_VERSION_BOOTCHECK \
STMT_START { \
- SV *Sv; \
- char *vn = Nullch, *module = SvPV(ST(0),na); \
+ SV *tmpsv; \
+ char *vn = Nullch, *module = SvPV(ST(0),PL_na); \
if (items >= 2) /* version supplied as bootstrap arg */ \
- Sv = ST(1); \
+ tmpsv = ST(1); \
else { \
/* XXX GV_ADDWARN */ \
- Sv = perl_get_sv(form("%s::%s", module, \
+ tmpsv = perl_get_sv(form("%s::%s", module, \
vn = "XS_VERSION"), FALSE); \
- if (!Sv || !SvOK(Sv)) \
- Sv = perl_get_sv(form("%s::%s", module, \
+ if (!tmpsv || !SvOK(tmpsv)) \
+ tmpsv = perl_get_sv(form("%s::%s", module, \
vn = "VERSION"), FALSE); \
} \
- if (Sv && (!SvOK(Sv) || strNE(XS_VERSION, SvPV(Sv, na)))) \
+ if (tmpsv && (!SvOK(tmpsv) || strNE(XS_VERSION, SvPV(tmpsv, PL_na)))) \
croak("%s object version %s does not match %s%s%s%s %_", \
module, XS_VERSION, \
vn ? "$" : "", vn ? module : "", vn ? "::" : "", \
- vn ? vn : "bootstrap parameter", Sv); \
+ vn ? vn : "bootstrap parameter", tmpsv); \
} STMT_END
#else
# define XS_VERSION_BOOTCHECK
diff --git a/bytecode.h b/bytecode.h
index 67f0819644..6b8206216d 100644
--- a/bytecode.h
+++ b/bytecode.h
@@ -11,7 +11,7 @@ EXT int iv_overflows INIT(0);
EXT SV *sv;
#ifndef USE_THREADS
-EXT OP *op;
+EXT OP *PL_op;
#endif
EXT XPV pv;
diff --git a/bytecode.pl b/bytecode.pl
index 91d6bf1804..a7e3fa3510 100644
--- a/bytecode.pl
+++ b/bytecode.pl
@@ -10,7 +10,7 @@ my @optype= qw(OP UNOP BINOP LOGOP CONDOP LISTOP PMOP SVOP GVOP PVOP LOOP COP);
# Nullsv *must* come first in the following so that the condition
# ($$sv == 0) can continue to be used to test (sv == Nullsv).
-my @specialsv = qw(Nullsv &sv_undef &sv_yes &sv_no);
+my @specialsv = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no);
my (%alias_from, $from, $tos);
while (($from, $tos) = each %alias_to) {
@@ -215,7 +215,7 @@ print BYTERUN_H <<'EOT';
#define INIT_SPECIALSV_LIST STMT_START { \
EOT
for ($i = 0; $i < @specialsv; $i++) {
- print BYTERUN_H "\tspecialsv_list[$i] = $specialsv[$i]; \\\n";
+ print BYTERUN_H "\tPL_specialsv_list[$i] = $specialsv[$i]; \\\n";
}
print BYTERUN_H <<'EOT';
} STMT_END
@@ -251,13 +251,13 @@ nop none none
#
ret none none x
ldsv sv svindex
-ldop op opindex
+ldop PL_op opindex
stsv sv U32 s
-stop op U32 s
+stop PL_op U32 s
ldspecsv sv U8 x
newsv sv U8 x
-newop op U8 x
-newopn op U8 x
+newop PL_op U8 x
+newopn PL_op U8 x
newpv none PV
pv_cur pv.xpv_cur STRLEN
pv_free pv none x
@@ -329,14 +329,14 @@ gp_cvgen GvCVGEN(sv) U32
gp_line GvLINE(sv) line_t
gp_share sv svindex x
xgv_flags GvFLAGS(sv) U8
-op_next op->op_next opindex
-op_sibling op->op_sibling opindex
-op_ppaddr op->op_ppaddr strconst x
-op_targ op->op_targ PADOFFSET
-op_type op OPCODE x
-op_seq op->op_seq U16
-op_flags op->op_flags U8
-op_private op->op_private U8
+op_next PL_op->op_next opindex
+op_sibling PL_op->op_sibling opindex
+op_ppaddr PL_op->op_ppaddr strconst x
+op_targ PL_op->op_targ PADOFFSET
+op_type PL_op OPCODE x
+op_seq PL_op->op_seq U16
+op_flags PL_op->op_flags U8
+op_private PL_op->op_private U8
op_first cUNOP->op_first opindex
op_last cBINOP->op_last opindex
op_other cLOGOP->op_other opindex
@@ -347,7 +347,7 @@ op_pmreplroot cPMOP->op_pmreplroot opindex
op_pmreplrootgv *(SV**)&cPMOP->op_pmreplroot svindex
op_pmreplstart cPMOP->op_pmreplstart opindex
op_pmnext *(OP**)&cPMOP->op_pmnext opindex
-pregcomp op pvcontents x
+pregcomp PL_op pvcontents x
op_pmflags cPMOP->op_pmflags U16
op_pmpermflags cPMOP->op_pmpermflags U16
op_sv cSVOP->op_sv svindex
@@ -363,6 +363,6 @@ cop_filegv *(SV**)&cCOP->cop_filegv svindex
cop_seq cCOP->cop_seq U32
cop_arybase cCOP->cop_arybase I32
cop_line cCOP->cop_line line_t
-main_start main_start opindex
-main_root main_root opindex
-curpad curpad svindex x
+main_start PL_main_start opindex
+main_root PL_main_root opindex
+curpad PL_curpad svindex x
diff --git a/byterun.c b/byterun.c
index c67859a886..cfb7eb40fd 100644
--- a/byterun.c
+++ b/byterun.c
@@ -618,7 +618,7 @@ void byterun(PerlIO *fp)
{
strconst arg;
BGET_strconst(arg);
- BSET_op_ppaddr(op->op_ppaddr, arg);
+ BSET_op_ppaddr(PL_op->op_ppaddr, arg);
break;
}
case INSN_OP_TARG: /* 85 */
diff --git a/cc_runtime.h b/cc_runtime.h
index fe830c0bde..18e3ba2c08 100644
--- a/cc_runtime.h
+++ b/cc_runtime.h
@@ -1,4 +1,4 @@
-#define DOOP(ppname) PUTBACK; op = ppname(ARGS); SPAGAIN
+#define DOOP(ppname) PUTBACK; PL_op = ppname(ARGS); SPAGAIN
#define PP_LIST(g) do { \
dMARK; \
@@ -6,13 +6,13 @@
if (++MARK <= SP) \
*MARK = *SP; \
else \
- *MARK = &sv_undef; \
+ *MARK = &PL_sv_undef; \
SP = MARK; \
} \
} while (0)
#define MAYBE_TAINT_SASSIGN_SRC(sv) \
- if (tainting && tainted && (!SvGMAGICAL(left) || !SvSMAGICAL(left) || \
+ if (PL_tainting && PL_tainted && (!SvGMAGICAL(left) || !SvSMAGICAL(left) || \
!((mg=mg_find(left, 't')) && mg->mg_len & 1)))\
TAINT_NOT
@@ -28,9 +28,9 @@
#define PP_UNSTACK do { \
TAINT_NOT; \
- stack_sp = stack_base + cxstack[cxstack_ix].blk_oldsp; \
+ PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp; \
FREETMPS; \
- oldsave = scopestack[scopestack_ix - 1]; \
+ oldsave = PL_scopestack[PL_scopestack_ix - 1]; \
LEAVE_SCOPE(oldsave); \
SPAGAIN; \
} while(0)
@@ -43,19 +43,19 @@
JMPENV_PUSH(ret); \
switch (ret) { \
case 0: \
- op = ppaddr(ARGS); \
- retstack[retstack_ix - 1] = Nullop; \
- if (op != nxt) runops(); \
+ PL_op = ppaddr(ARGS); \
+ PL_retstack[PL_retstack_ix - 1] = Nullop; \
+ if (PL_op != nxt) runops(); \
JMPENV_POP; \
break; \
case 1: JMPENV_POP; JMPENV_JUMP(1); \
case 2: JMPENV_POP; JMPENV_JUMP(2); \
case 3: \
JMPENV_POP; \
- if (restartop != nxt) \
+ if (PL_restartop != nxt) \
JMPENV_JUMP(3); \
} \
- op = nxt; \
+ PL_op = nxt; \
SPAGAIN; \
} while (0)
diff --git a/djgpp/djgpp.c b/djgpp/djgpp.c
index 466b4abc60..4d0d9fd0a1 100644
--- a/djgpp/djgpp.c
+++ b/djgpp/djgpp.c
@@ -119,7 +119,7 @@ pclose (FILE *pp)
static int
convretcode (int rc,char *prog,int fl)
{
- if (rc < 0 && dowarn)
+ if (rc < 0 && PL_dowarn)
warn ("Can't %s \"%s\": %s",fl ? "exec" : "spawn",prog,Strerror (errno));
if (rc > 0)
return rc <<= 8;
@@ -141,7 +141,7 @@ do_aspawn (SV *really,SV **mark,SV **sp)
while (++mark <= sp)
if (*mark)
- *a++ = SvPVx(*mark, na);
+ *a++ = SvPVx(*mark, PL_na);
else
*a++ = "";
*a = Nullch;
@@ -152,7 +152,7 @@ do_aspawn (SV *really,SV **mark,SV **sp)
) /* will swawnvp use PATH? */
TAINT_ENV(); /* testing IFS here is overkill, probably */
- if (really && *(tmps = SvPV(really, na)))
+ if (really && *(tmps = SvPV(really, PL_na)))
rc=spawnvp (P_WAIT,tmps,argv);
else
rc=spawnvp (P_WAIT,argv[0],argv);
@@ -208,10 +208,10 @@ doshell:
return convretcode (system (cmd),cmd,execf);
}
- New (1303,Argv,(s-cmd)/2+2,char*);
- Cmd=savepvn (cmd,s-cmd);
- a=Argv;
- for (s=Cmd; *s;) {
+ New (1303,PL_Argv,(s-cmd)/2+2,char*);
+ PL_Cmd=savepvn (cmd,s-cmd);
+ a=PL_Argv;
+ for (s=PL_Cmd; *s;) {
while (*s && isSPACE (*s)) s++;
if (*s)
*(a++)=s;
@@ -220,14 +220,14 @@ doshell:
*s++='\0';
}
*a=Nullch;
- if (!Argv[0])
+ if (!PL_Argv[0])
return -1;
if (execf==EXECF_EXEC)
- rc=execvp (Argv[0],Argv);
+ rc=execvp (PL_Argv[0],PL_Argv);
else
- rc=spawnvp (P_WAIT,Argv[0],Argv);
- return convretcode (rc,Argv[0],execf);
+ rc=spawnvp (P_WAIT,PL_Argv[0],PL_Argv);
+ return convretcode (rc,PL_Argv[0],execf);
}
int
diff --git a/embed.pl b/embed.pl
index ac7f94e5c6..b764e86e3b 100755
--- a/embed.pl
+++ b/embed.pl
@@ -8,6 +8,8 @@ my @extvars = qw(sv_undef sv_yes sv_no na dowarn
curstash DBsub DBsingle debstash
rsfp
stdingv
+ defgv
+ errgv
);
sub readsyms (\%$) {
diff --git a/ext/B/B.xs b/ext/B/B.xs
index 6bc421b2f7..8dbc915f92 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -267,7 +267,7 @@ static SV *
cchar(SV *sv)
{
SV *sstr = newSVpv("'", 0);
- char *s = SvPV(sv, na);
+ char *s = SvPV(sv, PL_na);
if (*s == '\'')
sv_catpv(sstr, "\\'");
diff --git a/ext/B/B/Asmdata.pm b/ext/B/B/Asmdata.pm
index 340876b71b..247c5ae975 100644
--- a/ext/B/B/Asmdata.pm
+++ b/ext/B/B/Asmdata.pm
@@ -15,7 +15,7 @@ use Exporter;
use vars qw(%insn_data @insn_name @optype @specialsv_name);
@optype = qw(OP UNOP BINOP LOGOP CONDOP LISTOP PMOP SVOP GVOP PVOP LOOP COP);
-@specialsv_name = qw(Nullsv &sv_undef &sv_yes &sv_no);
+@specialsv_name = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no);
# XXX insn_data is initialised this way because with a large
# %insn_data = (foo => [...], bar => [...], ...) initialiser
@@ -148,23 +148,3 @@ while (($insn_name, $insn_data) = each %insn_data) {
@insn_name = map($_ || "unused", @insn_name);
1;
-
-__END__
-
-=head1 NAME
-
-B::Asmdata - Autogenerated data about Perl ops, used to generate bytecode
-
-=head1 SYNOPSIS
-
- use Asmdata;
-
-=head1 DESCRIPTION
-
-See F<ext/B/B/Asmdata.pm>.
-
-=head1 AUTHOR
-
-Malcolm Beattie, C<mbeattie@sable.ox.ac.uk>
-
-=cut
diff --git a/ext/B/byteperl.c b/ext/B/byteperl.c
index 323d63a809..6b53e3b174 100644
--- a/ext/B/byteperl.c
+++ b/ext/B/byteperl.c
@@ -34,7 +34,7 @@ main(int argc, char **argv, char **env)
perl_init_i18nl14n(1);
#endif
- if (!do_undump) {
+ if (!PL_do_undump) {
my_perl = perl_alloc();
if (!my_perl)
#ifdef VMS
@@ -46,8 +46,8 @@ main(int argc, char **argv, char **env)
}
#ifdef CSH
- if (!cshlen)
- cshlen = strlen(cshname);
+ if (!PL_cshlen)
+ PL_cshlen = strlen(PL_cshname);
#endif
if (argc < 2)
@@ -83,8 +83,8 @@ main(int argc, char **argv, char **env)
exit( exitstatus );
sv_setpv(GvSV(gv_fetchpv("0", TRUE, SVt_PV)), argv[0]);
- main_cv = compcv;
- compcv = 0;
+ PL_main_cv = PL_compcv;
+ PL_compcv = 0;
#ifdef INDIRECT_BGET_MACROS
bs.data = fp;
diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs
index 237f2e4e7a..c661023a33 100644
--- a/ext/DB_File/DB_File.xs
+++ b/ext/DB_File/DB_File.xs
@@ -718,11 +718,11 @@ SV * sv ;
#endif
svp = hv_fetch(action, "bfname", 6, FALSE);
if (svp && SvOK(*svp)) {
- char * ptr = SvPV(*svp,na) ;
+ char * ptr = SvPV(*svp,PL_na) ;
#ifdef DB_VERSION_MAJOR
- name = (char*) na ? ptr : NULL ;
+ name = (char*) PL_na ? ptr : NULL ;
#else
- info->db_RE_bfname = (char*) (na ? ptr : NULL) ;
+ info->db_RE_bfname = (char*) (PL_na ? ptr : NULL) ;
#endif
}
else
@@ -738,7 +738,7 @@ SV * sv ;
{
int value ;
if (SvPOK(*svp))
- value = (int)*SvPV(*svp, na) ;
+ value = (int)*SvPV(*svp, PL_na) ;
else
value = SvIV(*svp) ;
@@ -756,7 +756,7 @@ SV * sv ;
if (svp && SvOK(*svp))
{
if (SvPOK(*svp))
- info->db_RE_bval = (u_char)*SvPV(*svp, na) ;
+ info->db_RE_bval = (u_char)*SvPV(*svp, PL_na) ;
else
info->db_RE_bval = (u_char)(unsigned long) SvIV(*svp) ;
DB_flags(info->flags, DB_DELIMITER) ;
@@ -1102,7 +1102,7 @@ db_DoTie_(isHASH, dbtype, name=undef, flags=O_CREAT|O_RDWR, mode=0666, type=DB_H
SV * sv = (SV *) NULL ;
if (items >= 3 && SvOK(ST(2)))
- name = (char*) SvPV(ST(2), na) ;
+ name = (char*) SvPV(ST(2), PL_na) ;
if (items == 6)
sv = ST(5) ;
@@ -1245,8 +1245,8 @@ unshift(db, ...)
#endif
for (i = items-1 ; i > 0 ; --i)
{
- value.data = SvPV(ST(i), na) ;
- value.size = na ;
+ value.data = SvPV(ST(i), PL_na) ;
+ value.size = PL_na ;
One = 1 ;
key.data = &One ;
key.size = sizeof(int) ;
@@ -1286,7 +1286,7 @@ pop(db)
OutputValue(ST(0), value) ;
RETVAL = db_del(db, key, R_CURSOR) ;
if (RETVAL != 0)
- sv_setsv(ST(0), &sv_undef);
+ sv_setsv(ST(0), &PL_sv_undef);
}
}
@@ -1313,7 +1313,7 @@ shift(db)
OutputValue(ST(0), value) ;
RETVAL = db_del(db, key, R_CURSOR) ;
if (RETVAL != 0)
- sv_setsv (ST(0), &sv_undef) ;
+ sv_setsv (ST(0), &PL_sv_undef) ;
}
}
@@ -1344,8 +1344,8 @@ push(db, ...)
{
++ (* (int*)key.data) ;
- value.data = SvPV(ST(i), na) ;
- value.size = na ;
+ value.data = SvPV(ST(i), PL_na) ;
+ value.size = PL_na ;
RETVAL = (Db->put)(Db, NULL, &key, &value, 0) ;
if (RETVAL != 0)
break;
@@ -1353,8 +1353,8 @@ push(db, ...)
#else
for (i = items - 1 ; i > 0 ; --i)
{
- value.data = SvPV(ST(i), na) ;
- value.size = na ;
+ value.data = SvPV(ST(i), PL_na) ;
+ value.size = PL_na ;
RETVAL = (Db->put)(Db, keyptr, &value, R_IAFTER) ;
if (RETVAL != 0)
break;
diff --git a/ext/DB_File/typemap b/ext/DB_File/typemap
index 42c49d7dd1..7af55aec21 100644
--- a/ext/DB_File/typemap
+++ b/ext/DB_File/typemap
@@ -16,8 +16,8 @@ DBTKEY T_dbtkeydatum
INPUT
T_dbtkeydatum
if (db->type != DB_RECNO) {
- $var.data = SvPV($arg, na);
- $var.size = (int)na;
+ $var.data = SvPV($arg, PL_na);
+ $var.size = (int)PL_na;
DBT_flags($var);
}
else {
@@ -27,8 +27,8 @@ T_dbtkeydatum
DBT_flags($var);
}
T_dbtdatum
- $var.data = SvPV($arg, na);
- $var.size = (int)na;
+ $var.data = SvPV($arg, PL_na);
+ $var.size = (int)PL_na;
DBT_flags($var);
OUTPUT
diff --git a/ext/DynaLoader/dl_dld.xs b/ext/DynaLoader/dl_dld.xs
index a0bdcc8de1..2443ab0d69 100644
--- a/ext/DynaLoader/dl_dld.xs
+++ b/ext/DynaLoader/dl_dld.xs
@@ -58,10 +58,10 @@ dl_private_init()
dlderr = dld_init("/proc/self/exe");
if (dlderr) {
#endif
- dlderr = dld_init(dld_find_executable(origargv[0]));
+ dlderr = dld_init(dld_find_executable(PL_origargv[0]));
if (dlderr) {
char *msg = dld_strerror(dlderr);
- SaveError("dld_init(%s) failed: %s", origargv[0], msg);
+ SaveError("dld_init(%s) failed: %s", PL_origargv[0], msg);
DLDEBUG(1,PerlIO_printf(PerlIO_stderr(), "%s", LastError));
}
#ifdef __linux__
diff --git a/ext/DynaLoader/dl_next.xs b/ext/DynaLoader/dl_next.xs
index 48ec49cd82..2b547f0f00 100644
--- a/ext/DynaLoader/dl_next.xs
+++ b/ext/DynaLoader/dl_next.xs
@@ -182,7 +182,7 @@ static char *dlopen(char *path, int mode /* mode is ignored */)
p = (char **) safemalloc(psize * sizeof(char*));
p[0] = path;
for(i=1; i<psize-1; i++) {
- p[i] = SvPVx(*av_fetch(dl_resolve_using, i-1, TRUE), na);
+ p[i] = SvPVx(*av_fetch(dl_resolve_using, i-1, TRUE), PL_na);
}
p[psize-1] = 0;
rld_success = rld_load(nxerr, (struct mach_header **)0, p,
diff --git a/ext/DynaLoader/dl_vms.xs b/ext/DynaLoader/dl_vms.xs
index 2ed718dfd7..974fd58b52 100644
--- a/ext/DynaLoader/dl_vms.xs
+++ b/ext/DynaLoader/dl_vms.xs
@@ -184,7 +184,7 @@ dl_expandspec(filespec)
DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tSYNCHK sys$parse = %d\n",sts));
if (!(sts & 1)) {
dl_set_error(dlfab.fab$l_sts,dlfab.fab$l_stv);
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
}
else {
/* Now set up a default spec - everything but the name */
@@ -205,7 +205,7 @@ dl_expandspec(filespec)
DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tname/default sys$parse = %d\n",sts));
if (!(sts & 1)) {
dl_set_error(dlfab.fab$l_sts,dlfab.fab$l_stv);
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
}
else {
/* Now find the actual file */
@@ -213,7 +213,7 @@ dl_expandspec(filespec)
DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "\tsys$search = %d\n",sts));
if (!(sts & 1)) {
dl_set_error(dlfab.fab$l_sts,dlfab.fab$l_stv);
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
}
else {
ST(0) = sv_2mortal(newSVpv(dlnam.nam$l_rsa,dlnam.nam$b_rsl));
@@ -295,7 +295,7 @@ dl_load_file(filespec, flags)
Safefree(dlptr->name.dsc$a_pointer);
Safefree(dlptr->defspec.dsc$a_pointer);
Safefree(dlptr);
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
}
else {
ST(0) = sv_2mortal(newSViv((IV) dlptr));
@@ -323,7 +323,7 @@ dl_find_symbol(librefptr,symname)
(unsigned long int) entry));
if (!(sts & 1)) {
/* error message already saved by findsym_handler */
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
}
else ST(0) = sv_2mortal(newSViv((IV) entry));
diff --git a/ext/GDBM_File/typemap b/ext/GDBM_File/typemap
index a9b73d8b81..317a8f3886 100644
--- a/ext/GDBM_File/typemap
+++ b/ext/GDBM_File/typemap
@@ -14,8 +14,8 @@ FATALFUNC T_OPAQUEPTR
INPUT
T_DATUM
- $var.dptr = SvPV($arg, na);
- $var.dsize = (int)na;
+ $var.dptr = SvPV($arg, PL_na);
+ $var.dsize = (int)PL_na;
T_GDATUM
UNIMPLEMENTED
OUTPUT
diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs
index f226a79a9f..afe7f7775b 100644
--- a/ext/IO/IO.xs
+++ b/ext/IO/IO.xs
@@ -94,7 +94,7 @@ fgetpos(handle)
ST(0) = sv_2mortal(newSVpv((char*)&pos, sizeof(Fpos_t)));
}
else {
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
errno = EINVAL;
}
@@ -104,7 +104,7 @@ fsetpos(handle, pos)
SV * pos
CODE:
char *p;
- if (handle && (p = SvPVx(pos, na)) && na == sizeof(Fpos_t))
+ if (handle && (p = SvPVx(pos, PL_na)) && PL_na == sizeof(Fpos_t))
#ifdef PerlIO
RETVAL = PerlIO_setpos(handle, (Fpos_t*)p);
#else
@@ -139,7 +139,7 @@ new_tmpfile(packname = "IO::File")
SvREFCNT_dec(gv); /* undo increment in newRV() */
}
else {
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
SvREFCNT_dec(gv);
}
@@ -153,7 +153,7 @@ constant(name)
if (constant(name, &i))
ST(0) = sv_2mortal(newSViv(i));
else
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
int
ungetc(handle, c)
diff --git a/ext/IPC/SysV/SysV.xs b/ext/IPC/SysV/SysV.xs
index b97e9e5893..3503ad92b1 100644
--- a/ext/IPC/SysV/SysV.xs
+++ b/ext/IPC/SysV/SysV.xs
@@ -32,40 +32,6 @@
# include <vm/vm_param.h>
#endif
-#ifndef newCONSTSUB
-static void
-newCONSTSUB(stash,name,sv)
- HV *stash;
- char *name;
- SV *sv;
-{
-#ifdef dTHR
- dTHR;
-#endif
- U32 oldhints = hints;
- HV *old_cop_stash = curcop->cop_stash;
- HV *old_curstash = curstash;
- line_t oldline = curcop->cop_line;
- curcop->cop_line = copline;
-
- hints &= ~HINT_BLOCK_SCOPE;
- if(stash)
- curstash = curcop->cop_stash = stash;
-
- newSUB(
- start_subparse(FALSE, 0),
- newSVOP(OP_CONST, 0, newSVpv(name,0)),
- newSVOP(OP_CONST, 0, &sv_no), /* SvPV(&sv_no) == "" -- GMB */
- newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
- );
-
- hints = oldhints;
- curcop->cop_stash = old_cop_stash;
- curstash = old_curstash;
- curcop->cop_line = oldline;
-}
-#endif
-
MODULE=IPC::SysV PACKAGE=IPC::Msg::stat
PROTOTYPES: ENABLE
@@ -199,7 +165,7 @@ ftok(path, id)
CODE:
#if defined(HAS_SEM) || defined(HAS_SHM)
key_t k = ftok(path, id);
- ST(0) = k == (key_t) -1 ? &sv_undef : sv_2mortal(newSViv(k));
+ ST(0) = k == (key_t) -1 ? &PL_sv_undef : sv_2mortal(newSViv(k));
#else
DIE(no_func, "ftok");
#endif
diff --git a/ext/NDBM_File/typemap b/ext/NDBM_File/typemap
index a9b73d8b81..317a8f3886 100644
--- a/ext/NDBM_File/typemap
+++ b/ext/NDBM_File/typemap
@@ -14,8 +14,8 @@ FATALFUNC T_OPAQUEPTR
INPUT
T_DATUM
- $var.dptr = SvPV($arg, na);
- $var.dsize = (int)na;
+ $var.dptr = SvPV($arg, PL_na);
+ $var.dsize = (int)PL_na;
T_GDATUM
UNIMPLEMENTED
OUTPUT
diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs
index 5127ea52a3..892c038a9c 100644
--- a/ext/ODBM_File/ODBM_File.xs
+++ b/ext/ODBM_File/ODBM_File.xs
@@ -76,7 +76,7 @@ odbm_TIEHASH(dbtype, filename, flags, mode)
croak("ODBM_FILE: Can't open %s", filename);
}
RETVAL = (void*)(dbminit(filename) >= 0 ? &dbmrefcnt : 0);
- ST(0) = sv_mortalcopy(&sv_undef);
+ ST(0) = sv_mortalcopy(&PL_sv_undef);
sv_setptrobj(ST(0), RETVAL, dbtype);
}
diff --git a/ext/ODBM_File/typemap b/ext/ODBM_File/typemap
index a6b0e5faa8..5e12e73933 100644
--- a/ext/ODBM_File/typemap
+++ b/ext/ODBM_File/typemap
@@ -14,8 +14,8 @@ FATALFUNC T_OPAQUEPTR
INPUT
T_DATUM
- $var.dptr = SvPV($arg, na);
- $var.dsize = (int)na;
+ $var.dptr = SvPV($arg, PL_na);
+ $var.dsize = (int)PL_na;
T_GDATUM
UNIMPLEMENTED
OUTPUT
diff --git a/ext/Opcode/Opcode.xs b/ext/Opcode/Opcode.xs
index 63743a5ce0..1da7794577 100644
--- a/ext/Opcode/Opcode.xs
+++ b/ext/Opcode/Opcode.xs
@@ -375,7 +375,7 @@ CODE:
}
set_opset_bits(bitmap, bitspec, on, opname);
}
- ST(0) = &sv_yes;
+ ST(0) = &PL_sv_yes;
@@ -400,7 +400,7 @@ PPCODE:
}
else if (SvPOK(bitspec) && SvCUR(bitspec) == opset_len) {
int b, j;
- char *bitmap = SvPV(bitspec,na);
+ char *bitmap = SvPV(bitspec,PL_na);
myopcode = 0;
for (b=0; b < opset_len; b++) {
U16 bits = bitmap[b];
@@ -423,7 +423,7 @@ CODE:
STRLEN len;
char *optag = SvPV(optagsv, len);
put_op_bitspec(optag, len, mask); /* croaks */
- ST(0) = &sv_yes;
+ ST(0) = &PL_sv_yes;
void
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 0a5212d0b3..b86fbdce1a 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -78,7 +78,7 @@
/* The non-POSIX CRTL times() has void return type, so we just get the
current time directly */
- clock_t vms_times(struct tms *bufptr) {
+ clock_t vms_times(struct tms *PL_bufptr) {
clock_t retval;
/* Get wall time and convert to 10 ms intervals to
* produce the return value that the POSIX standard expects */
@@ -98,7 +98,7 @@
_ckvmssts(lib$ediv(&divisor,vmstime,(long int *)&retval,&remainder));
# endif
/* Fill in the struct tms using the CRTL routine . . .*/
- times((tbuffer_t *)bufptr);
+ times((tbuffer_t *)PL_bufptr);
return (clock_t) retval;
}
# define times(t) vms_times(t)
@@ -2807,7 +2807,7 @@ isalnum(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!isalnum(*s))
RETVAL = 0;
@@ -2819,7 +2819,7 @@ isalpha(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!isalpha(*s))
RETVAL = 0;
@@ -2831,7 +2831,7 @@ iscntrl(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!iscntrl(*s))
RETVAL = 0;
@@ -2843,7 +2843,7 @@ isdigit(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!isdigit(*s))
RETVAL = 0;
@@ -2855,7 +2855,7 @@ isgraph(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!isgraph(*s))
RETVAL = 0;
@@ -2867,7 +2867,7 @@ islower(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!islower(*s))
RETVAL = 0;
@@ -2879,7 +2879,7 @@ isprint(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!isprint(*s))
RETVAL = 0;
@@ -2891,7 +2891,7 @@ ispunct(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!ispunct(*s))
RETVAL = 0;
@@ -2903,7 +2903,7 @@ isspace(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!isspace(*s))
RETVAL = 0;
@@ -2915,7 +2915,7 @@ isupper(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!isupper(*s))
RETVAL = 0;
@@ -2927,7 +2927,7 @@ isxdigit(charstring)
unsigned char * charstring
CODE:
unsigned char *s = charstring;
- unsigned char *e = s + na; /* "na" set by typemap side effect */
+ unsigned char *e = s + PL_na; /* "PL_na" set by typemap side effect */
for (RETVAL = 1; RETVAL && s < e; s++)
if (!isxdigit(*s))
RETVAL = 0;
@@ -3182,7 +3182,7 @@ sigaction(sig, action, oldaction = 0)
/* Remember old handler name if desired. */
if (oldaction) {
- char *hand = SvPVx(*sigsvp, na);
+ char *hand = SvPVx(*sigsvp, PL_na);
svp = hv_fetch(oldaction, "HANDLER", 7, TRUE);
sv_setpv(*svp, *hand ? hand : "DEFAULT");
}
@@ -3193,7 +3193,7 @@ sigaction(sig, action, oldaction = 0)
svp = hv_fetch(action, "HANDLER", 7, FALSE);
if (!svp)
croak("Can't supply an action without a HANDLER");
- sv_setpv(*sigsvp, SvPV(*svp, na));
+ sv_setpv(*sigsvp, SvPV(*svp, PL_na));
mg_set(*sigsvp); /* handles DEFAULT and IGNORE */
act.sa_handler = sighandler;
@@ -3408,7 +3408,7 @@ strtod(str)
if (unparsed)
PUSHs(sv_2mortal(newSViv(strlen(unparsed))));
else
- PUSHs(&sv_undef);
+ PUSHs(&PL_sv_undef);
}
void
@@ -3429,7 +3429,7 @@ strtol(str, base = 0)
if (unparsed)
PUSHs(sv_2mortal(newSViv(strlen(unparsed))));
else
- PUSHs(&sv_undef);
+ PUSHs(&PL_sv_undef);
}
void
@@ -3450,7 +3450,7 @@ strtoul(str, base = 0)
if (unparsed)
PUSHs(sv_2mortal(newSViv(strlen(unparsed))));
else
- PUSHs(&sv_undef);
+ PUSHs(&PL_sv_undef);
}
SV *
diff --git a/ext/SDBM_File/typemap b/ext/SDBM_File/typemap
index a9b73d8b81..317a8f3886 100644
--- a/ext/SDBM_File/typemap
+++ b/ext/SDBM_File/typemap
@@ -14,8 +14,8 @@ FATALFUNC T_OPAQUEPTR
INPUT
T_DATUM
- $var.dptr = SvPV($arg, na);
- $var.dsize = (int)na;
+ $var.dptr = SvPV($arg, PL_na);
+ $var.dsize = (int)PL_na;
T_GDATUM
UNIMPLEMENTED
OUTPUT
diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs
index 20a16e9247..9bf52855ef 100644
--- a/ext/Thread/Thread.xs
+++ b/ext/Thread/Thread.xs
@@ -43,7 +43,7 @@ threadstart(void *arg)
Thread savethread = thr;
LOGOP myop;
dSP;
- I32 oldscope = scopestack_ix;
+ I32 oldscope = PL_scopestack_ix;
I32 retval;
AV *av;
int i;
@@ -60,14 +60,14 @@ threadstart(void *arg)
thr->private = 0;
/* Now duplicate most of perl_call_sv but with a few twists */
- op = (OP*)&myop;
- Zero(op, 1, LOGOP);
+ PL_op = (OP*)&myop;
+ Zero(PL_op, 1, LOGOP);
myop.op_flags = OPf_STACKED;
myop.op_next = Nullop;
myop.op_flags |= OPf_KNOW;
myop.op_flags |= OPf_WANT_LIST;
- op = pp_entersub(ARGS);
- DEBUG_L(if (!op)
+ PL_op = pp_entersub(ARGS);
+ DEBUG_L(if (!PL_op)
PerlIO_printf(PerlIO_stderr(), "thread starts at Nullop\n"));
/*
* When this thread is next scheduled, we start in the right
@@ -123,10 +123,10 @@ threadstart(void *arg)
MUTEX_LOCK(&thr->mutex);
thr->flags |= THRf_DID_DIE;
MUTEX_UNLOCK(&thr->mutex);
- av_store(av, 0, &sv_no);
+ av_store(av, 0, &PL_sv_no);
av_store(av, 1, newSVsv(thr->errsv));
DEBUG_L(PerlIO_printf(PerlIO_stderr(), "%p died: %s\n",
- thr, SvPV(thr->errsv, na)));
+ thr, SvPV(thr->errsv, PL_na)));
} else {
DEBUG_L(STMT_START {
for (i = 1; i <= retval; i++) {
@@ -134,7 +134,7 @@ threadstart(void *arg)
thr, i, SvPEEK(SP[i - 1]));
}
} STMT_END);
- av_store(av, 0, &sv_yes);
+ av_store(av, 0, &PL_sv_yes);
for (i = 1; i <= retval; i++, SP++)
sv_setsv(*av_fetch(av, i, TRUE), SvREFCNT_inc(*SP));
}
@@ -142,7 +142,7 @@ threadstart(void *arg)
finishoff:
#if 0
/* removed for debug */
- SvREFCNT_dec(curstack);
+ SvREFCNT_dec(PL_curstack);
#endif
SvREFCNT_dec(thr->cvcache);
SvREFCNT_dec(thr->threadsv);
@@ -174,7 +174,7 @@ threadstart(void *arg)
Safefree(PL_screamnext);
Safefree(PL_reg_start_tmp);
SvREFCNT_dec(PL_lastscream);
- /*SvREFCNT_dec(defoutgv);*/
+ /*SvREFCNT_dec(PL_defoutgv);*/
MUTEX_LOCK(&thr->mutex);
DEBUG_L(PerlIO_printf(PerlIO_stderr(),
@@ -290,7 +290,7 @@ newthread (SV *startsv, AV *initargs, char *classname)
return sv_bless(newRV_noinc(sv), gv_stashpv(classname, TRUE));
#else
croak("No threads in this perl");
- return &sv_undef;
+ return &PL_sv_undef;
#endif
}
@@ -354,7 +354,7 @@ join(t)
for (i = 1; i <= AvFILL(av); i++)
XPUSHs(sv_2mortal(*av_fetch(av, i, FALSE)));
} else {
- char *mess = SvPV(*av_fetch(av, 1, FALSE), na);
+ char *mess = SvPV(*av_fetch(av, 1, FALSE), PL_na);
DEBUG_L(PerlIO_printf(PerlIO_stderr(),
"%p: join propagating die message: %s\n",
thr, mess));
@@ -396,7 +396,7 @@ equal(t1, t2)
Thread t1
Thread t2
PPCODE:
- PUSHs((t1 == t2) ? &sv_yes : &sv_no);
+ PUSHs((t1 == t2) ? &PL_sv_yes : &PL_sv_no);
void
flags(t)
@@ -438,7 +438,7 @@ void
DESTROY(t)
SV * t
PPCODE:
- PUSHs(&sv_yes);
+ PUSHs(&PL_sv_yes);
void
yield()
@@ -582,7 +582,7 @@ void
kill_sighandler_thread()
PPCODE:
write(sig_pipe[1], "\0", 1);
- PUSHs(&sv_yes);
+ PUSHs(&PL_sv_yes);
void
init_thread_signals()
@@ -590,7 +590,7 @@ init_thread_signals()
PL_sighandlerp = handle_thread_signal;
if (pipe(sig_pipe) == -1)
XSRETURN_UNDEF;
- PUSHs(&sv_yes);
+ PUSHs(&PL_sv_yes);
void
await_signal()
@@ -605,7 +605,7 @@ await_signal()
croak("panic: await_signal");
ST(0) = sv_newmortal();
if (ret)
- sv_setsv(ST(0), c ? psig_ptr[c] : &sv_no);
+ sv_setsv(ST(0), c ? psig_ptr[c] : &PL_sv_no);
DEBUG_L(PerlIO_printf(PerlIO_stderr(),
"await_signal returning %s\n", SvPEEK(ST(0))););
diff --git a/ext/attrs/attrs.xs b/ext/attrs/attrs.xs
index bc0df7082b..da952d5a3f 100644
--- a/ext/attrs/attrs.xs
+++ b/ext/attrs/attrs.xs
@@ -27,7 +27,7 @@ char * Class
if (!PL_compcv || !(cv = CvOUTSIDE(PL_compcv)))
croak("can't set attributes outside a subroutine scope");
for (i = 1; i < items; i++) {
- char *attr = SvPV(ST(i), na);
+ char *attr = SvPV(ST(i), PL_na);
cv_flags_t flag = get_flag(attr);
if (!flag)
croak("invalid attribute name %s", attr);
@@ -47,7 +47,7 @@ SV * sub
sub = Nullsv;
}
else {
- char *name = SvPV(sub, na);
+ char *name = SvPV(sub, PL_na);
sub = (SV*)perl_get_cv(name, FALSE);
}
if (!sub)
diff --git a/fakethr.h b/fakethr.h
index 8b1e76ff9b..098fefea9e 100644
--- a/fakethr.h
+++ b/fakethr.h
@@ -34,7 +34,7 @@ struct thread_intern {
* something a bit different for XS code.
*/
-#define SCHEDULE() return schedule(), op
+#define SCHEDULE() return schedule(), PL_op
#define MUTEX_LOCK(m)
#define MUTEX_UNLOCK(m)
diff --git a/gv.c b/gv.c
index a8ae6bd69c..e8a2f9d82e 100644
--- a/gv.c
+++ b/gv.c
@@ -1046,7 +1046,7 @@ Gv_AMupdate(HV *stash)
default:
if (!SvROK(sv)) {
if (!SvOK(sv)) break;
- gv = gv_fetchmethod(stash, SvPV(sv, na));
+ gv = gv_fetchmethod(stash, SvPV(sv, PL_na));
if (gv) cv = GvCV(gv);
break;
}
diff --git a/hv.c b/hv.c
index 61e406ef1f..40bb9b8e73 100644
--- a/hv.c
+++ b/hv.c
@@ -1143,9 +1143,9 @@ unsharepvn(char *str, I32 len, U32 hash)
I32 found = 0;
/* what follows is the moral equivalent of:
- if ((Svp = hv_fetch(strtab, tmpsv, FALSE, hash))) {
+ if ((Svp = hv_fetch(PL_strtab, tmpsv, FALSE, hash))) {
if (--*Svp == Nullsv)
- hv_delete(strtab, str, len, G_DISCARD, hash);
+ hv_delete(PL_strtab, str, len, G_DISCARD, hash);
} */
xhv = (XPVHV*)SvANY(PL_strtab);
/* assert(xhv_array != 0) */
@@ -1188,8 +1188,8 @@ share_hek(char *str, I32 len, register U32 hash)
/* what follows is the moral equivalent of:
- if (!(Svp = hv_fetch(strtab, str, len, FALSE)))
- hv_store(strtab, str, len, Nullsv, hash);
+ if (!(Svp = hv_fetch(PL_strtab, str, len, FALSE)))
+ hv_store(PL_strtab, str, len, Nullsv, hash);
*/
xhv = (XPVHV*)SvANY(PL_strtab);
/* assert(xhv_array != 0) */
diff --git a/lib/ExtUtils/typemap b/lib/ExtUtils/typemap
index 01e6e8347b..28fd99c00b 100644
--- a/lib/ExtUtils/typemap
+++ b/lib/ExtUtils/typemap
@@ -269,7 +269,7 @@ T_IN
if ( do_open(gv, "<&", 2, FALSE, 0, 0, $var) )
sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1)));
else
- $arg = &sv_undef;
+ $arg = &PL_sv_undef;
}
T_INOUT
{
@@ -277,7 +277,7 @@ T_INOUT
if ( do_open(gv, "+<&", 3, FALSE, 0, 0, $var) )
sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1)));
else
- $arg = &sv_undef;
+ $arg = &PL_sv_undef;
}
T_OUT
{
@@ -285,5 +285,5 @@ T_OUT
if ( do_open(gv, "+>&", 3, FALSE, 0, 0, $var) )
sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1)));
else
- $arg = &sv_undef;
+ $arg = &PL_sv_undef;
}
diff --git a/malloc.c b/malloc.c
index 2ddd8feb39..f46c0c05dd 100644
--- a/malloc.c
+++ b/malloc.c
@@ -591,7 +591,7 @@ emergency_sbrk(size)
return (char *)-1; /* Now die die die... */
/* Got it, now detach SvPV: */
- pv = SvPV(sv, na);
+ pv = SvPV(sv, PL_na);
/* Check alignment: */
if (((u_bigint)(pv - M_OVERHEAD)) & ((1<<LOG_OF_MIN_ARENA) - 1)) {
PerlIO_puts(PerlIO_stderr(),"Bad alignment of $^M!\n");
diff --git a/mg.c b/mg.c
index 443d97a4dc..6068d9bdec 100644
--- a/mg.c
+++ b/mg.c
@@ -447,7 +447,7 @@ magic_get(SV *sv, MAGIC *mg)
break;
case '\024': /* ^T */
#ifdef BIG_TIME
- sv_setnv(sv, basetime);
+ sv_setnv(sv, PL_basetime);
#else
sv_setiv(sv, (IV)PL_basetime);
#endif
@@ -523,8 +523,8 @@ magic_get(SV *sv, MAGIC *mg)
dTHR;
sv_setiv(sv, (IV)STATUS_CURRENT);
#ifdef COMPLEX_STATUS
- LvTARGOFF(sv) = statusvalue;
- LvTARGLEN(sv) = statusvalue_vms;
+ LvTARGOFF(sv) = PL_statusvalue;
+ LvTARGLEN(sv) = PL_statusvalue_vms;
#endif
}
break;
@@ -655,7 +655,7 @@ magic_setenv(SV *sv, MAGIC *mg)
/* waiting in the wings? */
if (!len) {
SV **valp;
- if ((valp = hv_fetch(GvHVn(envgv), ptr, klen, FALSE)))
+ if ((valp = hv_fetch(GvHVn(PL_envgv), ptr, klen, FALSE)))
s = SvPV(*valp, len);
}
#endif
@@ -1542,7 +1542,7 @@ magic_set(SV *sv, MAGIC *mg)
break;
case '\024': /* ^T */
#ifdef BIG_TIME
- basetime = (Time_t)(SvNOK(sv) ? SvNVX(sv) : sv_2nv(sv));
+ PL_basetime = (Time_t)(SvNOK(sv) ? SvNVX(sv) : sv_2nv(sv));
#else
PL_basetime = (Time_t)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
#endif
@@ -1629,9 +1629,9 @@ magic_set(SV *sv, MAGIC *mg)
break;
case '?':
#ifdef COMPLEX_STATUS
- if (localizing == 2) {
- statusvalue = LvTARGOFF(sv);
- statusvalue_vms = LvTARGLEN(sv);
+ if (PL_localizing == 2) {
+ PL_statusvalue = LvTARGOFF(sv);
+ PL_statusvalue_vms = LvTARGLEN(sv);
}
else
#endif
@@ -1686,7 +1686,7 @@ magic_set(SV *sv, MAGIC *mg)
(void)setreuid((Uid_t)-1, (Uid_t)PL_euid);
#else
#ifdef HAS_SETRESUID
- (void)setresuid((Uid_t)-1, (Uid_t)euid, (Uid_t)-1);
+ (void)setresuid((Uid_t)-1, (Uid_t)PL_euid, (Uid_t)-1);
#else
if (PL_euid == PL_uid) /* special case $> = $< */
PerlProc_setuid(PL_euid);
@@ -1788,7 +1788,7 @@ magic_set(SV *sv, MAGIC *mg)
for (i = 1; i < PL_origargc; i++) {
if (PL_origargv[i] == s + 1
#ifdef OS2
- || origargv[i] == s + 2
+ || PL_origargv[i] == s + 2
#endif
)
s += strlen(++s); /* this one is ok too */
@@ -1798,7 +1798,7 @@ magic_set(SV *sv, MAGIC *mg)
/* can grab env area too? */
if (PL_origenviron && (PL_origenviron[0] == s + 1
#ifdef OS2
- || (origenviron[0] == s + 9 && (s += 8))
+ || (PL_origenviron[0] == s + 9 && (s += 8))
#endif
)) {
my_setenv("NoNe SuCh", Nullch);
diff --git a/op.c b/op.c
index 66817daa2e..c0454bce00 100644
--- a/op.c
+++ b/op.c
@@ -483,21 +483,21 @@ pad_reset(void)
dTHR;
register I32 po;
- if (AvARRAY(comppad) != curpad)
+ if (AvARRAY(PL_comppad) != PL_curpad)
croak("panic: pad_reset curpad");
#ifdef USE_THREADS
DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx reset\n",
- (unsigned long) thr, (unsigned long) curpad));
+ (unsigned long) thr, (unsigned long) PL_curpad));
#else
DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx reset\n",
- (unsigned long) curpad));
+ (unsigned long) PL_curpad));
#endif /* USE_THREADS */
- if (!tainting) { /* Can't mix tainted and non-tainted temporaries. */
- for (po = AvMAX(comppad); po > padix_floor; po--) {
- if (curpad[po] && !SvIMMORTAL(curpad[po]))
- SvPADTMP_off(curpad[po]);
+ if (!PL_tainting) { /* Can't mix tainted and non-tainted temporaries. */
+ for (po = AvMAX(PL_comppad); po > PL_padix_floor; po--) {
+ if (PL_curpad[po] && !SvIMMORTAL(PL_curpad[po]))
+ SvPADTMP_off(PL_curpad[po]);
}
- padix = padix_floor;
+ PL_padix = PL_padix_floor;
}
#endif
PL_pad_reset_pending = FALSE;
@@ -3206,13 +3206,13 @@ CV* cv;
PerlIO_printf(Perl_debug_log, "\tCV=0x%lx (%s), OUTSIDE=0x%lx (%s)\n",
cv,
(CvANON(cv) ? "ANON"
- : (cv == main_cv) ? "MAIN"
+ : (cv == PL_main_cv) ? "MAIN"
: CvUNIQUE(outside) ? "UNIQUE"
: CvGV(cv) ? GvNAME(CvGV(cv)) : "UNDEFINED"),
outside,
(!outside ? "null"
: CvANON(outside) ? "ANON"
- : (outside == main_cv) ? "MAIN"
+ : (outside == PL_main_cv) ? "MAIN"
: CvUNIQUE(outside) ? "UNIQUE"
: CvGV(outside) ? GvNAME(CvGV(outside)) : "UNDEFINED"));
@@ -3695,7 +3695,7 @@ newCONSTSUB(HV *stash, char *name, SV *sv)
newSUB(
start_subparse(FALSE, 0),
newSVOP(OP_CONST, 0, newSVpv(name,0)),
- newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&sv_no) == "" -- GMB */
+ newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
);
@@ -4627,7 +4627,7 @@ ck_shift(OP *o)
#ifdef USE_THREADS
if (!CvUNIQUE(PL_compcv)) {
argop = newOP(OP_PADAV, OPf_REF);
- argop->op_targ = 0; /* curpad[0] is @_ */
+ argop->op_targ = 0; /* PL_curpad[0] is @_ */
}
else {
argop = newUNOP(OP_RV2AV, 0,
diff --git a/os2/OS2/PrfDB/PrfDB.xs b/os2/OS2/PrfDB/PrfDB.xs
index 5465e1d136..13123200a2 100644
--- a/os2/OS2/PrfDB/PrfDB.xs
+++ b/os2/OS2/PrfDB/PrfDB.xs
@@ -20,13 +20,13 @@ Prf_Get(HINI hini, PSZ app, PSZ key) {
BOOL rc;
SV *sv;
- if (CheckWinError(PrfQueryProfileSize(hini, app, key, &len))) return &sv_undef;
+ if (CheckWinError(PrfQueryProfileSize(hini, app, key, &len))) return &PL_sv_undef;
sv = newSVpv("", 0);
SvGROW(sv, len + 1);
if (CheckWinError(PrfQueryProfileData(hini, app, key, SvPVX(sv), &len))
|| (len == 0 && (app == NULL || key == NULL))) { /* Somewhy needed. */
SvREFCNT_dec(sv);
- return &sv_undef;
+ return &PL_sv_undef;
}
SvCUR_set(sv, len);
*SvEND(sv) = 0;
@@ -59,7 +59,7 @@ Prf_Profiles()
char system[257];
PRFPROFILE info = { 257, user, 257, system};
- if (CheckWinError(PrfQueryProfile(Perl_hab, &info))) return &sv_undef;
+ if (CheckWinError(PrfQueryProfile(Perl_hab, &info))) return &PL_sv_undef;
if (info.cchUserName > 257 || info.cchSysName > 257)
die("Panic: Profile names too long");
av_push(av, newSVpv(user, info.cchUserName - 1));
diff --git a/os2/OS2/PrfDB/typemap b/os2/OS2/PrfDB/typemap
index 0b91f3750a..eb2722bda5 100644
--- a/os2/OS2/PrfDB/typemap
+++ b/os2/OS2/PrfDB/typemap
@@ -7,7 +7,7 @@ PSZ T_PVNULL
#############################################################################
INPUT
T_PVNULL
- $var = ( SvOK($arg) ? ($type)SvPV($arg,na) : NULL )
+ $var = ( SvOK($arg) ? ($type)SvPV($arg,PL_na) : NULL )
#############################################################################
OUTPUT
T_PVNULL
diff --git a/os2/OS2/REXX/REXX.xs b/os2/OS2/REXX/REXX.xs
index 14489f965d..2d13f3e81e 100644
--- a/os2/OS2/REXX/REXX.xs
+++ b/os2/OS2/REXX/REXX.xs
@@ -94,9 +94,9 @@ exec_in_REXX(char *cmd, char * handlerName, RexxFunctionHandler *handler)
} else {
res = NEWSV(729,0);
}
- if (rc || SvTRUE(GvSV(errgv))) {
- if (SvTRUE(GvSV(errgv))) {
- die ("Error inside perl function called from REXX compartment.\n%s", SvPV(GvSV(errgv), na)) ;
+ if (rc || SvTRUE(GvSV(PL_errgv))) {
+ if (SvTRUE(GvSV(PL_errgv))) {
+ die ("Error inside perl function called from REXX compartment.\n%s", SvPV(GvSV(PL_errgv), PL_na)) ;
}
die ("REXX compartment returned non-zero status %li", rc);
}
@@ -374,7 +374,7 @@ _fetch(name, ...)
var->shvname.strlength, var->shvname.strptr,
namelen, var->shvvalue.strptr);
if (var->shvret & RXSHV_NEWV || !var->shvvalue.strptr)
- PUSHs(&sv_undef);
+ PUSHs(&PL_sv_undef);
else
PUSHs(sv_2mortal(newSVpv(var->shvvalue.strptr,
namelen)));
@@ -428,7 +428,7 @@ _next(stem)
PUSHs(sv_2mortal(newSVpv(sv.shvvalue.strptr, valuelen)));
DosFreeMem(sv.shvvalue.strptr);
} else
- PUSHs(&sv_undef);
+ PUSHs(&PL_sv_undef);
} else if (rc != RXSHV_LVAR) {
die("Error %i when in _next", rc);
} else {
diff --git a/os2/os2.c b/os2/os2.c
index 5b62fac132..75240ebbc3 100644
--- a/os2/os2.c
+++ b/os2/os2.c
@@ -160,7 +160,7 @@ int
os2_cond_wait(perl_cond *c, perl_mutex *m)
{
int rc;
- if ((rc = DosResetEventSem(*c,&na)) && (rc != ERROR_ALREADY_RESET))
+ if ((rc = DosResetEventSem(*c,&PL_na)) && (rc != ERROR_ALREADY_RESET))
croak("panic: COND_WAIT-reset: rc=%i", rc);
if (m) MUTEX_UNLOCK(m);
if (CheckOSError(DosWaitEventSem(*c,SEM_INDEFINITE_WAIT))
@@ -358,7 +358,7 @@ result(int flag, int pid)
rsignal(SIGINT, ihand);
rsignal(SIGQUIT, qhand);
- statusvalue = (U16)status;
+ PL_statusvalue = (U16)status;
if (r < 0)
return -1;
return status & 0xFFFF;
@@ -366,10 +366,10 @@ result(int flag, int pid)
ihand = rsignal(SIGINT, SIG_IGN);
r = DosWaitChild(DCWA_PROCESS, DCWW_WAIT, &res, &rpid, pid);
rsignal(SIGINT, ihand);
- statusvalue = res.codeResult << 8 | res.codeTerminate;
+ PL_statusvalue = res.codeResult << 8 | res.codeTerminate;
if (r)
return -1;
- return statusvalue;
+ return PL_statusvalue;
#endif
}
@@ -379,7 +379,7 @@ result(int flag, int pid)
#define EXECF_SPAWN_NOWAIT 3
/* Spawn/exec a program, revert to shell if needed. */
-/* global Argv[] contains arguments. */
+/* global PL_Argv[] contains arguments. */
int
do_spawn_ve(really, flag, execf, inicmd)
@@ -403,44 +403,44 @@ char *inicmd;
flag = P_NOWAIT;
retry:
- if (strEQ(Argv[0],"/bin/sh"))
- Argv[0] = sh_path;
+ if (strEQ(PL_Argv[0],"/bin/sh"))
+ PL_Argv[0] = PL_sh_path;
- if (Argv[0][0] != '/' && Argv[0][0] != '\\'
- && !(Argv[0][0] && Argv[0][1] == ':'
- && (Argv[0][2] == '/' || Argv[0][2] != '\\'))
+ if (PL_Argv[0][0] != '/' && PL_Argv[0][0] != '\\'
+ && !(PL_Argv[0][0] && PL_Argv[0][1] == ':'
+ && (PL_Argv[0][2] == '/' || PL_Argv[0][2] != '\\'))
) /* will spawnvp use PATH? */
TAINT_ENV(); /* testing IFS here is overkill, probably */
/* We should check PERL_SH* and PERLLIB_* as well? */
- if (!really || !*(tmps = SvPV(really, na)))
- tmps = Argv[0];
+ if (!really || !*(tmps = SvPV(really, PL_na)))
+ tmps = PL_Argv[0];
#if 0
- rc = result(trueflag, spawnvp(flag,tmps,Argv));
+ rc = result(trueflag, spawnvp(flag,tmps,PL_Argv));
#else
if (execf == EXECF_TRUEEXEC)
- rc = execvp(tmps,Argv);
+ rc = execvp(tmps,PL_Argv);
else if (execf == EXECF_EXEC)
- rc = spawnvp(trueflag | P_OVERLAY,tmps,Argv);
+ rc = spawnvp(trueflag | P_OVERLAY,tmps,PL_Argv);
else if (execf == EXECF_SPAWN_NOWAIT)
- rc = spawnvp(trueflag | P_NOWAIT,tmps,Argv);
+ rc = spawnvp(trueflag | P_NOWAIT,tmps,PL_Argv);
else /* EXECF_SPAWN */
rc = result(trueflag,
- spawnvp(trueflag | P_NOWAIT,tmps,Argv));
+ spawnvp(trueflag | P_NOWAIT,tmps,PL_Argv));
#endif
if (rc < 0 && pass == 1
- && (tmps == Argv[0])) { /* Cannot transfer `really' via shell. */
+ && (tmps == PL_Argv[0])) { /* Cannot transfer `really' via shell. */
err = errno;
if (err == ENOENT || err == ENOEXEC) {
/* No such file, or is a script. */
/* Try adding script extensions to the file name, and
search on PATH. */
- char *scr = find_script(Argv[0], TRUE, NULL, 0);
+ char *scr = find_script(PL_Argv[0], TRUE, NULL, 0);
if (scr) {
FILE *file = fopen(scr, "r");
char *s = 0, *s1;
- Argv[0] = scr;
+ PL_Argv[0] = scr;
if (!file)
goto panic_file;
if (!fgets(buf, sizeof buf, file)) {
@@ -500,7 +500,7 @@ char *inicmd;
}
doshell_args:
{
- char **a = Argv;
+ char **a = PL_Argv;
char *exec_args[2];
if (!buf[0] && file) { /* File without magic */
@@ -525,7 +525,7 @@ char *inicmd;
}
}
if (!inicmd) {
- s = Argv[0];
+ s = PL_Argv[0];
while (*s) {
/* Dosish shells will choke on slashes
in paths, fortunately, this is
@@ -550,29 +550,29 @@ char *inicmd;
/* Use the original cmd line */
/* XXXX This is good only until we refuse
quoted arguments... */
- Argv[0] = inicmd;
- Argv[1] = Nullch;
+ PL_Argv[0] = inicmd;
+ PL_Argv[1] = Nullch;
}
} else if (!buf[0] && inicmd) { /* No file */
/* Start with the original cmdline. */
/* XXXX This is good only until we refuse
quoted arguments... */
- Argv[0] = inicmd;
- Argv[1] = Nullch;
+ PL_Argv[0] = inicmd;
+ PL_Argv[1] = Nullch;
nargs = 2; /* shell -c */
}
while (a[1]) /* Get to the end */
a++;
a++; /* Copy finil NULL too */
- while (a >= Argv) {
- *(a + nargs) = *a; /* Argv was preallocated to be
+ while (a >= PL_Argv) {
+ *(a + nargs) = *a; /* PL_Argv was preallocated to be
long enough. */
a--;
}
while (nargs-- >= 0)
- Argv[nargs] = argsp[nargs];
+ PL_Argv[nargs] = argsp[nargs];
/* Enable pathless exec if #! (as pdksh). */
pass = (buf[0] == '#' ? 2 : 3);
goto retry;
@@ -582,21 +582,21 @@ char *inicmd;
errno = err;
}
} else if (rc < 0 && pass == 2 && err == ENOENT) { /* File not found */
- char *no_dir = strrchr(Argv[0], '/');
+ char *no_dir = strrchr(PL_Argv[0], '/');
/* Do as pdksh port does: if not found with /, try without
path. */
if (no_dir) {
- Argv[0] = no_dir + 1;
+ PL_Argv[0] = no_dir + 1;
pass++;
goto retry;
}
}
- if (rc < 0 && dowarn)
+ if (rc < 0 && PL_dowarn)
warn("Can't %s \"%s\": %s\n",
((execf != EXECF_EXEC && execf != EXECF_TRUEEXEC)
? "spawn" : "exec"),
- Argv[0], Strerror(err));
+ PL_Argv[0], Strerror(err));
if (rc < 0 && (execf != EXECF_SPAWN_NOWAIT)
&& ((trueflag & 0xFF) == P_WAIT))
rc = 255 << 8; /* Emulate the fork(). */
@@ -618,8 +618,8 @@ register SV **sp;
int flag = P_WAIT, trueflag, err, secondtry = 0;
if (sp > mark) {
- New(1301,Argv, sp - mark + 3, char*);
- a = Argv;
+ New(1301,PL_Argv, sp - mark + 3, char*);
+ a = PL_Argv;
if (mark < sp && SvNIOKp(*(mark+1)) && !SvPOKp(*(mark+1))) {
++mark;
@@ -628,7 +628,7 @@ register SV **sp;
while (++mark <= sp) {
if (*mark)
- *a++ = SvPVx(*mark, na);
+ *a++ = SvPVx(*mark, PL_na);
else
*a++ = "";
}
@@ -668,7 +668,7 @@ int execf;
have a shell which will not change between computers with the
same architecture, to avoid "action on a distance".
And to have simple build, this shell should be sh. */
- shell = sh_path;
+ shell = PL_sh_path;
copt = "-c";
#endif
@@ -676,10 +676,10 @@ int execf;
cmd++;
if (strnEQ(cmd,"/bin/sh",7) && isSPACE(cmd[7])) {
- STRLEN l = strlen(sh_path);
+ STRLEN l = strlen(PL_sh_path);
New(1302, news, strlen(cmd) - 7 + l + 1, char);
- strcpy(news, sh_path);
+ strcpy(news, PL_sh_path);
strcpy(news + l, cmd + 7);
cmd = news;
}
@@ -718,7 +718,7 @@ int execf;
/* In the ak code internal P_NOWAIT is P_WAIT ??? */
rc = result(P_WAIT,
spawnl(P_NOWAIT,shell,shell,copt,cmd,(char*)0));
- if (rc < 0 && dowarn)
+ if (rc < 0 && PL_dowarn)
warn("Can't %s \"%s\": %s",
(execf == EXECF_SPAWN ? "spawn" : "exec"),
shell, Strerror(errno));
@@ -733,10 +733,10 @@ int execf;
}
/* cmd="a" may lead to "sh", "-c", "\"$@\"", "a", "a.cmd", NULL */
- New(1303,Argv, (s - cmd + 11) / 2, char*);
- Cmd = savepvn(cmd, s-cmd);
- a = Argv;
- for (s = Cmd; *s;) {
+ New(1303,PL_Argv, (s - cmd + 11) / 2, char*);
+ PL_Cmd = savepvn(cmd, s-cmd);
+ a = PL_Argv;
+ for (s = PL_Cmd; *s;) {
while (*s && isSPACE(*s)) s++;
if (*s)
*(a++) = s;
@@ -745,7 +745,7 @@ int execf;
*s++ = '\0';
}
*a = Nullch;
- if (Argv[0])
+ if (PL_Argv[0])
rc = do_spawn_ve(NULL, 0, execf, cmd);
else
rc = -1;
@@ -799,7 +799,7 @@ char *mode;
/* `this' is what we use in the parent, `that' in the child. */
this = (*mode == 'w');
that = !this;
- if (tainting) {
+ if (PL_tainting) {
taint_env();
taint_proper("Insecure %s%s", "EXEC");
}
@@ -830,10 +830,10 @@ char *mode;
close(p[this]);
p[this] = p[that];
}
- sv = *av_fetch(fdpid,p[this],TRUE);
+ sv = *av_fetch(PL_fdpid,p[this],TRUE);
(void)SvUPGRADE(sv,SVt_IV);
SvIVX(sv) = pid;
- forkprocess = pid;
+ PL_forkprocess = pid;
return PerlIO_fdopen(p[this], mode);
#else /* USE_POPEN */
@@ -846,11 +846,11 @@ char *mode;
# else
char *shell = getenv("EMXSHELL");
- my_setenv("EMXSHELL", sh_path);
+ my_setenv("EMXSHELL", PL_sh_path);
res = popen(cmd, mode);
my_setenv("EMXSHELL", shell);
# endif
- sv = *av_fetch(fdpid, PerlIO_fileno(res), TRUE);
+ sv = *av_fetch(PL_fdpid, PerlIO_fileno(res), TRUE);
(void)SvUPGRADE(sv,SVt_IV);
SvIVX(sv) = -1; /* A cooky. */
return res;
@@ -1004,8 +1004,8 @@ XS(XS_File__Copy_syscopy)
if (items < 2 || items > 3)
croak("Usage: File::Copy::syscopy(src,dst,flag=0)");
{
- char * src = (char *)SvPV(ST(0),na);
- char * dst = (char *)SvPV(ST(1),na);
+ char * src = (char *)SvPV(ST(0),PL_na);
+ char * dst = (char *)SvPV(ST(1),PL_na);
U32 flag;
int RETVAL, rc;
@@ -1042,7 +1042,7 @@ mod2fname(sv)
if (avlen < 0)
croak("Empty array reference given to mod2fname");
- s = SvPV(*av_fetch((AV*)sv, avlen, FALSE), na);
+ s = SvPV(*av_fetch((AV*)sv, avlen, FALSE), PL_na);
strncpy(fname, s, 8);
len = strlen(s);
if (len < 6) pos = len;
@@ -1052,7 +1052,7 @@ mod2fname(sv)
}
avlen --;
while (avlen >= 0) {
- s = SvPV(*av_fetch((AV*)sv, avlen, FALSE), na);
+ s = SvPV(*av_fetch((AV*)sv, avlen, FALSE), PL_na);
while (*s) {
sum = 33 * sum + *(s++); /* 7 is primitive mod 13. */
}
@@ -1182,7 +1182,7 @@ XS(XS_Cwd_sys_chdir)
if (items != 1)
croak("Usage: Cwd::sys_chdir(path)");
{
- char * path = (char *)SvPV(ST(0),na);
+ char * path = (char *)SvPV(ST(0),PL_na);
bool RETVAL;
RETVAL = sys_chdir(path);
@@ -1198,7 +1198,7 @@ XS(XS_Cwd_change_drive)
if (items != 1)
croak("Usage: Cwd::change_drive(d)");
{
- char d = (char)*SvPV(ST(0),na);
+ char d = (char)*SvPV(ST(0),PL_na);
bool RETVAL;
RETVAL = change_drive(d);
@@ -1214,7 +1214,7 @@ XS(XS_Cwd_sys_is_absolute)
if (items != 1)
croak("Usage: Cwd::sys_is_absolute(path)");
{
- char * path = (char *)SvPV(ST(0),na);
+ char * path = (char *)SvPV(ST(0),PL_na);
bool RETVAL;
RETVAL = sys_is_absolute(path);
@@ -1230,7 +1230,7 @@ XS(XS_Cwd_sys_is_rooted)
if (items != 1)
croak("Usage: Cwd::sys_is_rooted(path)");
{
- char * path = (char *)SvPV(ST(0),na);
+ char * path = (char *)SvPV(ST(0),PL_na);
bool RETVAL;
RETVAL = sys_is_rooted(path);
@@ -1246,7 +1246,7 @@ XS(XS_Cwd_sys_is_relative)
if (items != 1)
croak("Usage: Cwd::sys_is_relative(path)");
{
- char * path = (char *)SvPV(ST(0),na);
+ char * path = (char *)SvPV(ST(0),PL_na);
bool RETVAL;
RETVAL = sys_is_relative(path);
@@ -1277,7 +1277,7 @@ XS(XS_Cwd_sys_abspath)
if (items < 1 || items > 2)
croak("Usage: Cwd::sys_abspath(path, dir = NULL)");
{
- char * path = (char *)SvPV(ST(0),na);
+ char * path = (char *)SvPV(ST(0),PL_na);
char * dir;
char p[MAXPATHLEN];
char * RETVAL;
@@ -1285,7 +1285,7 @@ XS(XS_Cwd_sys_abspath)
if (items < 2)
dir = NULL;
else {
- dir = (char *)SvPV(ST(1),na);
+ dir = (char *)SvPV(ST(1),PL_na);
}
if (path[0] == '.' && (path[1] == '/' || path[1] == '\\')) {
path += 2;
@@ -1425,7 +1425,7 @@ XS(XS_Cwd_extLibpath_set)
if (items < 1 || items > 2)
croak("Usage: Cwd::extLibpath_set(s, type = 0)");
{
- char * s = (char *)SvPV(ST(0),na);
+ char * s = (char *)SvPV(ST(0),PL_na);
bool type;
U32 rc;
bool RETVAL;
@@ -1486,19 +1486,19 @@ Perl_OS2_init(char **env)
environ = env;
}
if ( (shell = getenv("PERL_SH_DRIVE")) ) {
- New(1304, sh_path, strlen(SH_PATH) + 1, char);
- strcpy(sh_path, SH_PATH);
- sh_path[0] = shell[0];
+ New(1304, PL_sh_path, strlen(SH_PATH) + 1, char);
+ strcpy(PL_sh_path, SH_PATH);
+ PL_sh_path[0] = shell[0];
} else if ( (shell = getenv("PERL_SH_DIR")) ) {
int l = strlen(shell), i;
if (shell[l-1] == '/' || shell[l-1] == '\\') {
l--;
}
- New(1304, sh_path, l + 8, char);
- strncpy(sh_path, shell, l);
- strcpy(sh_path + l, "/sh.exe");
+ New(1304, PL_sh_path, l + 8, char);
+ strncpy(PL_sh_path, shell, l);
+ strcpy(PL_sh_path + l, "/sh.exe");
for (i = 0; i < l; i++) {
- if (sh_path[i] == '\\') sh_path[i] = '/';
+ if (PL_sh_path[i] == '\\') PL_sh_path[i] = '/';
}
}
MUTEX_INIT(&start_thread_mutex);
diff --git a/os2/os2ish.h b/os2/os2ish.h
index 4506bb4fb2..c02202abce 100644
--- a/os2/os2ish.h
+++ b/os2/os2ish.h
@@ -144,7 +144,7 @@ extern int rc;
if ((rc = DosCloseEventSem(*(c)))) \
croak("panic: COND_DESTROY, rc=%i", rc); \
} STMT_END
-/*#define THR ((struct thread *) TlsGetValue(thr_key))
+/*#define THR ((struct thread *) TlsGetValue(PL_thr_key))
#define dTHR struct thread *thr = THR
*/
diff --git a/perl.c b/perl.c
index f644c80d51..bebcb02a59 100644
--- a/perl.c
+++ b/perl.c
@@ -166,7 +166,7 @@ perl_construct(register PerlInterpreter *sv_interp)
#ifdef PERL_OBJECT
/* TODO: */
- /* sighandlerp = sighandler; */
+ /* PL_sighandlerp = sighandler; */
#else
PL_sighandlerp = sighandler;
#endif
@@ -210,7 +210,7 @@ perl_construct(register PerlInterpreter *sv_interp)
+ ((double) PATCHLEVEL / (double) 1000)
+ ((double) SUBVERSION / (double) 100000));
#else
- sprintf(patchlevel, "%5.3f", (double) 5 +
+ sprintf(PL_patchlevel, "%5.3f", (double) 5 +
((double) PATCHLEVEL / (double) 1000));
#endif
@@ -791,7 +791,7 @@ setuid perl scripts securely.\n");
if (*++s != ':') {
PL_Sv = newSVpv("print myconfig();",0);
#ifdef VMS
- sv_catpv(Sv,"print \"\\nCharacteristics of this PERLSHR image: \\n\",");
+ sv_catpv(PL_Sv,"print \"\\nCharacteristics of this PERLSHR image: \\n\",");
#else
sv_catpv(PL_Sv,"print \"\\nCharacteristics of this binary (from libperl): \\n\",");
#endif
@@ -801,7 +801,7 @@ setuid perl scripts securely.\n");
sv_catpv(PL_Sv," DEBUGGING");
# endif
# ifdef NO_EMBED
- sv_catpv(Sv," NO_EMBED");
+ sv_catpv(PL_Sv," NO_EMBED");
# endif
# ifdef MULTIPLICITY
sv_catpv(PL_Sv," MULTIPLICITY");
@@ -823,7 +823,7 @@ setuid perl scripts securely.\n");
# ifdef __TIME__
sv_catpvf(PL_Sv,",\" Compiled at %s %s\\n\"",__DATE__,__TIME__);
# else
- sv_catpvf(Sv,",\" Compiled on %s\\n\"",__DATE__);
+ sv_catpvf(PL_Sv,",\" Compiled on %s\\n\"",__DATE__);
# endif
#endif
sv_catpv(PL_Sv, "; \
@@ -1698,7 +1698,7 @@ moreswitches(char *s)
PATCHLEVEL, SUBVERSION, ARCHNAME);
#else
printf("\nThis is perl, version %s built for %s",
- patchlevel, ARCHNAME);
+ PL_patchlevel, ARCHNAME);
#endif
#if defined(LOCAL_PATCH_COUNT)
if (LOCAL_PATCH_COUNT > 0)
@@ -1784,7 +1784,7 @@ my_unexec(void)
prog = newSVpv(BIN_EXP, 0);
sv_catpv(prog, "/perl");
- file = newSVpv(origfilename, 0);
+ file = newSVpv(PL_origfilename, 0);
sv_catpv(file, ".perldump");
unexec(SvPVX(file), SvPVX(prog), &etext, sbrk(0), 0);
@@ -1807,35 +1807,35 @@ init_interp(void)
#ifdef PERL_OBJECT /* XXX kludge */
#define I_REINIT \
- STMT_START { \
- chopset = " \n-"; \
- copline = NOLINE; \
- curcop = &compiling; \
- curcopdb = NULL; \
- dbargs = 0; \
- dlmax = 128; \
- laststatval = -1; \
- laststype = OP_STAT; \
- maxscream = -1; \
- maxsysfd = MAXSYSFD; \
- statname = Nullsv; \
- tmps_floor = -1; \
- tmps_ix = -1; \
- op_mask = NULL; \
- dlmax = 128; \
- laststatval = -1; \
- laststype = OP_STAT; \
- mess_sv = Nullsv; \
- splitstr = " "; \
- generation = 100; \
- exitlist = NULL; \
- exitlistlen = 0; \
- regindent = 0; \
- in_clean_objs = FALSE; \
- in_clean_all= FALSE; \
- profiledata = NULL; \
- rsfp = Nullfp; \
- rsfp_filters= Nullav; \
+ STMT_START { \
+ PL_chopset = " \n-"; \
+ PL_copline = NOLINE; \
+ PL_curcop = &PL_compiling;\
+ PL_curcopdb = NULL; \
+ PL_dbargs = 0; \
+ PL_dlmax = 128; \
+ PL_laststatval = -1; \
+ PL_laststype = OP_STAT; \
+ PL_maxscream = -1; \
+ PL_maxsysfd = MAXSYSFD; \
+ PL_statname = Nullsv; \
+ PL_tmps_floor = -1; \
+ PL_tmps_ix = -1; \
+ PL_op_mask = NULL; \
+ PL_dlmax = 128; \
+ PL_laststatval = -1; \
+ PL_laststype = OP_STAT; \
+ PL_mess_sv = Nullsv; \
+ PL_splitstr = " "; \
+ PL_generation = 100; \
+ PL_exitlist = NULL; \
+ PL_exitlistlen = 0; \
+ PL_regindent = 0; \
+ PL_in_clean_objs = FALSE; \
+ PL_in_clean_all = FALSE; \
+ PL_profiledata = NULL; \
+ PL_rsfp = Nullfp; \
+ PL_rsfp_filters = Nullav; \
} STMT_END
I_REINIT;
#else
@@ -1970,7 +1970,7 @@ sed %s -e \"/^[^#]/b\" \
-e \"/^#[ ]*endif/b\" \
-e \"s/^#.*//\" \
%s | %_ -C %_ %s",
- (doextract ? "-e \"1,/^#/d\n\"" : ""),
+ (PL_doextract ? "-e \"1,/^#/d\n\"" : ""),
#else
sv_setpvf(cmd, "\
%s %s -e '/^[^#]/b' \
@@ -2031,10 +2031,12 @@ sed %s -e \"/^[^#]/b\" \
if (!PL_rsfp) {
#ifdef DOSUID
#ifndef IAMSUID /* in case script is not readable before setuid */
- if (PL_euid && PerlLIO_stat(SvPVX(GvSV(curcop->cop_filegv)),&PL_statbuf) >= 0 &&
- PL_statbuf.st_mode & (S_ISUID|S_ISGID)) {
+ if (PL_euid &&
+ PerlLIO_stat(SvPVX(GvSV(PL_curcop->cop_filegv)),&PL_statbuf) >= 0 &&
+ PL_statbuf.st_mode & (S_ISUID|S_ISGID))
+ {
/* try again */
- PerlProc_execv(form("%s/sperl%s", BIN_EXP, patchlevel), origargv);
+ PerlProc_execv(form("%s/sperl%s", BIN_EXP, PL_patchlevel), PL_origargv);
croak("Can't do setuid\n");
}
#endif
@@ -2074,7 +2076,7 @@ validate_suid(char *validarg, char *scriptname, int fdscript)
char *s, *s2;
if (PerlLIO_fstat(PerlIO_fileno(PL_rsfp),&PL_statbuf) < 0) /* normal stat is insecure */
- croak("Can't stat script \"%s\"",origfilename);
+ croak("Can't stat script \"%s\"",PL_origfilename);
if (fdscript < 0 && PL_statbuf.st_mode & (S_ISUID|S_ISGID)) {
I32 len;
@@ -2088,7 +2090,7 @@ validate_suid(char *validarg, char *scriptname, int fdscript)
* But I don't think it's too important. The manual lies when
* it says access() is useful in setuid programs.
*/
- if (PerlLIO_access(SvPVX(GvSV(curcop->cop_filegv)),1)) /*double check*/
+ if (PerlLIO_access(SvPVX(GvSV(PL_curcop->cop_filegv)),1)) /*double check*/
croak("Permission denied");
#else
/* If we can swap euid and uid, then we can determine access rights
@@ -2109,7 +2111,7 @@ validate_suid(char *validarg, char *scriptname, int fdscript)
#endif
|| PerlProc_getuid() != PL_euid || PerlProc_geteuid() != PL_uid)
croak("Can't swap uid and euid"); /* really paranoid */
- if (PerlLIO_stat(SvPVX(GvSV(curcop->cop_filegv)),&tmpstatbuf) < 0)
+ if (PerlLIO_stat(SvPVX(GvSV(PL_curcop->cop_filegv)),&tmpstatbuf) < 0)
croak("Permission denied"); /* testing full pathname here */
if (tmpstatbuf.st_dev != PL_statbuf.st_dev ||
tmpstatbuf.st_ino != PL_statbuf.st_ino) {
@@ -2120,7 +2122,7 @@ validate_suid(char *validarg, char *scriptname, int fdscript)
(Filename of set-id script was %s, uid %ld gid %ld.)\n\nSincerely,\nperl\n",
(long)PL_uid,(long)tmpstatbuf.st_dev, (long)tmpstatbuf.st_ino,
(long)PL_statbuf.st_dev, (long)PL_statbuf.st_ino,
- SvPVX(GvSV(curcop->cop_filegv)),
+ SvPVX(GvSV(PL_curcop->cop_filegv)),
(long)PL_statbuf.st_uid, (long)PL_statbuf.st_gid);
(void)PerlProc_pclose(PL_rsfp);
}
@@ -2146,15 +2148,15 @@ validate_suid(char *validarg, char *scriptname, int fdscript)
croak("Permission denied");
if (PL_statbuf.st_mode & S_IWOTH)
croak("Setuid/gid script is writable by world");
- doswitches = FALSE; /* -s is insecure in suid */
- curcop->cop_line++;
- if (sv_gets(linestr, PL_rsfp, 0) == Nullch ||
- strnNE(SvPV(linestr,na),"#!",2) ) /* required even on Sys V */
+ PL_doswitches = FALSE; /* -s is insecure in suid */
+ PL_curcop->cop_line++;
+ if (sv_gets(PL_linestr, PL_rsfp, 0) == Nullch ||
+ strnNE(SvPV(PL_linestr,PL_na),"#!",2) ) /* required even on Sys V */
croak("No #! line");
- s = SvPV(linestr,na)+2;
+ s = SvPV(PL_linestr,PL_na)+2;
if (*s == ' ') s++;
while (!isSPACE(*s)) s++;
- for (s2 = s; (s2 > SvPV(linestr,na)+2 &&
+ for (s2 = s; (s2 > SvPV(PL_linestr,PL_na)+2 &&
(isDIGIT(s2[-1]) || strchr("._-", s2[-1]))); s2--) ;
if (strnNE(s2-4,"perl",4) && strnNE(s-9,"perl",4)) /* sanity check */
croak("Not a perl script");
@@ -2181,7 +2183,7 @@ FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!\n");
(void)PerlIO_close(PL_rsfp);
#ifndef IAMSUID
/* try again */
- PerlProc_execv(form("%s/sperl%s", BIN_EXP, patchlevel), origargv);
+ PerlProc_execv(form("%s/sperl%s", BIN_EXP, PL_patchlevel), PL_origargv);
#endif
croak("Can't do setuid\n");
}
@@ -2243,7 +2245,7 @@ FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!\n");
croak("Permission denied\n"); /* they can't do this */
}
#ifdef IAMSUID
- else if (preprocess)
+ else if (PL_preprocess)
croak("-P not allowed for setuid/setgid script\n");
else if (fdscript >= 0)
croak("fd script not allowed in suidperl\n");
@@ -2255,15 +2257,15 @@ FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!\n");
/* (We pass script name as "subdir" of fd, which perl will grok.) */
PerlIO_rewind(PL_rsfp);
PerlLIO_lseek(PerlIO_fileno(PL_rsfp),(Off_t)0,0); /* just in case rewind didn't */
- for (which = 1; origargv[which] && origargv[which] != scriptname; which++) ;
- if (!origargv[which])
+ for (which = 1; PL_origargv[which] && PL_origargv[which] != scriptname; which++) ;
+ if (!PL_origargv[which])
croak("Permission denied");
- origargv[which] = savepv(form("/dev/fd/%d/%s",
- PerlIO_fileno(PL_rsfp), origargv[which]));
+ PL_origargv[which] = savepv(form("/dev/fd/%d/%s",
+ PerlIO_fileno(PL_rsfp), PL_origargv[which]));
#if defined(HAS_FCNTL) && defined(F_SETFD)
fcntl(PerlIO_fileno(PL_rsfp),F_SETFD,0); /* ensure no close-on-exec */
#endif
- PerlProc_execv(form("%s/perl%s", BIN_EXP, patchlevel), origargv); /* try again */
+ PerlProc_execv(form("%s/perl%s", BIN_EXP, PL_patchlevel), PL_origargv);/* try again */
croak("Can't do setuid\n");
#endif /* IAMSUID */
#else /* !DOSUID */
@@ -2655,8 +2657,8 @@ incpush(char *p, int addsubdirs)
sprintf(PL_archpat_auto, "/%s/%s/auto", ARCHNAME, PL_patchlevel);
#ifdef VMS
for (len = sizeof(ARCHNAME) + 2;
- archpat_auto[len] != '\0' && archpat_auto[len] != '/'; len++)
- if (archpat_auto[len] == '.') archpat_auto[len] = '_';
+ PL_archpat_auto[len] != '\0' && PL_archpat_auto[len] != '/'; len++)
+ if (PL_archpat_auto[len] == '.') PL_archpat_auto[len] = '_';
#endif
}
}
@@ -2669,7 +2671,7 @@ incpush(char *p, int addsubdirs)
/* skip any consecutive separators */
while ( *p == PERLLIB_SEP ) {
/* Uncomment the next line for PATH semantics */
- /* av_push(GvAVn(incgv), newSVpv(".", 1)); */
+ /* av_push(GvAVn(PL_incgv), newSVpv(".", 1)); */
p++;
}
@@ -2693,7 +2695,7 @@ incpush(char *p, int addsubdirs)
char *unix;
STRLEN len;
- if ((unix = tounixspec_ts(SvPV(libdir,na),Nullch)) != Nullch) {
+ if ((unix = tounixspec_ts(SvPV(libdir,PL_na),Nullch)) != Nullch) {
len = strlen(unix);
while (unix[len-1] == '/') len--; /* Cosmetic */
sv_usepvn(libdir,unix,len);
@@ -2701,7 +2703,7 @@ incpush(char *p, int addsubdirs)
else
PerlIO_printf(PerlIO_stderr(),
"Failed to unixify @INC element \"%s\"\n",
- SvPV(libdir,na));
+ SvPV(libdir,PL_na));
#endif
/* .../archname/version if -d .../archname/version/auto */
sv_setsv(subdir, libdir);
diff --git a/perl.h b/perl.h
index 180d98956b..bcaa992d55 100644
--- a/perl.h
+++ b/perl.h
@@ -1153,20 +1153,20 @@ typedef pthread_key_t perl_key;
#ifdef VMS
-# define STATUS_NATIVE statusvalue_vms
+# define STATUS_NATIVE PL_statusvalue_vms
# define STATUS_NATIVE_EXPORT \
- ((I32)statusvalue_vms == -1 ? 44 : statusvalue_vms)
+ ((I32)PL_statusvalue_vms == -1 ? 44 : PL_statusvalue_vms)
# define STATUS_NATIVE_SET(n) \
STMT_START { \
- statusvalue_vms = (n); \
- if ((I32)statusvalue_vms == -1) \
+ PL_statusvalue_vms = (n); \
+ if ((I32)PL_statusvalue_vms == -1) \
PL_statusvalue = -1; \
- else if (statusvalue_vms & STS$M_SUCCESS) \
+ else if (PL_statusvalue_vms & STS$M_SUCCESS) \
PL_statusvalue = 0; \
- else if ((statusvalue_vms & STS$M_SEVERITY) == 0) \
- PL_statusvalue = 1 << 8; \
+ else if ((PL_statusvalue_vms & STS$M_SEVERITY) == 0) \
+ PL_statusvalue = 1 << 8; \
else \
- PL_statusvalue = (statusvalue_vms & STS$M_SEVERITY) << 8; \
+ PL_statusvalue = (PL_statusvalue_vms & STS$M_SEVERITY) << 8; \
} STMT_END
# define STATUS_POSIX PL_statusvalue
# ifdef VMSISH_STATUS
@@ -1179,12 +1179,12 @@ typedef pthread_key_t perl_key;
PL_statusvalue = (n); \
if (PL_statusvalue != -1) { \
PL_statusvalue &= 0xFFFF; \
- statusvalue_vms = PL_statusvalue ? 44 : 1; \
+ PL_statusvalue_vms = PL_statusvalue ? 44 : 1; \
} \
- else statusvalue_vms = -1; \
+ else PL_statusvalue_vms = -1; \
} STMT_END
-# define STATUS_ALL_SUCCESS (PL_statusvalue = 0, statusvalue_vms = 1)
-# define STATUS_ALL_FAILURE (PL_statusvalue = 1, statusvalue_vms = 44)
+# define STATUS_ALL_SUCCESS (PL_statusvalue = 0, PL_statusvalue_vms = 1)
+# define STATUS_ALL_FAILURE (PL_statusvalue = 1, PL_statusvalue_vms = 44)
#else
# define STATUS_NATIVE STATUS_POSIX
# define STATUS_NATIVE_EXPORT STATUS_POSIX
@@ -1568,7 +1568,7 @@ typedef Sighandler_t Sigsave_t;
# define PAD_SV(po) pad_sv(po)
# define RUNOPS_DEFAULT runops_debug
#else
-# define PAD_SV(po) curpad[po]
+# define PAD_SV(po) PL_curpad[po]
# define RUNOPS_DEFAULT runops_standard
#endif
diff --git a/pp.c b/pp.c
index 0e11daa947..702806d476 100644
--- a/pp.c
+++ b/pp.c
@@ -2103,7 +2103,7 @@ PP(pp_crypt)
#ifdef HAS_CRYPT
char *tmps = SvPV(left, PL_na);
#ifdef FCRYPT
- sv_setpv(TARG, fcrypt(tmps, SvPV(right, na)));
+ sv_setpv(TARG, fcrypt(tmps, SvPV(right, PL_na)));
#else
sv_setpv(TARG, crypt(tmps, SvPV(right, PL_na)));
#endif
diff --git a/pp_ctl.c b/pp_ctl.c
index 81b4281278..0750220063 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -856,7 +856,7 @@ PP(pp_flop)
char *tmps = SvPV(final, len);
sv = sv_mortalcopy(left);
- SvPV_force(sv,na);
+ SvPV_force(sv,PL_na);
while (!SvNIOKp(sv) && SvCUR(sv) <= len) {
XPUSHs(sv);
if (strEQ(SvPVX(sv),tmps))
@@ -2090,7 +2090,7 @@ PP(pp_goto)
if (do_dump) {
#ifdef VMS
- if (!retop) retop = main_start;
+ if (!retop) retop = PL_main_start;
#endif
PL_restartop = retop;
PL_do_undump = TRUE;
@@ -2144,8 +2144,8 @@ PP(pp_nswitch)
match = 0;
else if (match > cCOP->uop.scop.scop_max)
match = cCOP->uop.scop.scop_max;
- op = cCOP->uop.scop.scop_next[match];
- RETURNOP(op);
+ PL_op = cCOP->uop.scop.scop_next[match];
+ RETURNOP(PL_op);
}
PP(pp_cswitch)
@@ -2153,18 +2153,18 @@ PP(pp_cswitch)
djSP;
register I32 match;
- if (multiline)
- op = op->op_next; /* can't assume anything */
+ if (PL_multiline)
+ PL_op = PL_op->op_next; /* can't assume anything */
else {
- match = *(SvPVx(GvSV(cCOP->cop_gv), na)) & 255;
+ match = *(SvPVx(GvSV(cCOP->cop_gv), PL_na)) & 255;
match -= cCOP->uop.scop.scop_offset;
if (match < 0)
match = 0;
else if (match > cCOP->uop.scop.scop_max)
match = cCOP->uop.scop.scop_max;
- op = cCOP->uop.scop.scop_next[match];
+ PL_op = cCOP->uop.scop.scop_next[match];
}
- RETURNOP(op);
+ RETURNOP(PL_op);
}
#endif
@@ -2266,7 +2266,7 @@ sv_compile_2op(SV *sv, OP** startop, char *code, AV** avp)
SAVEDELETE(PL_defstash, safestr, strlen(safestr));
SAVEHINTS();
#ifdef OP_IN_REGISTER
- opsave = op;
+ PL_opsave = op;
#else
SAVEPPTR(PL_op);
#endif
@@ -2276,7 +2276,7 @@ sv_compile_2op(SV *sv, OP** startop, char *code, AV** avp)
PL_op->op_type = 0; /* Avoid uninit warning. */
PL_op->op_flags = 0; /* Avoid uninit warning. */
PUSHBLOCK(cx, CXt_EVAL, SP);
- PUSHEVAL(cx, 0, compiling.cop_filegv);
+ PUSHEVAL(cx, 0, PL_compiling.cop_filegv);
rop = doeval(G_SCALAR, startop);
POPBLOCK(cx,PL_curpm);
POPEVAL(cx);
@@ -2287,7 +2287,7 @@ sv_compile_2op(SV *sv, OP** startop, char *code, AV** avp)
*avp = (AV*)SvREFCNT_inc(PL_comppad);
LEAVE;
#ifdef OP_IN_REGISTER
- op = opsave;
+ op = PL_opsave;
#endif
return rop;
}
@@ -2599,7 +2599,7 @@ PP(pp_require)
push_return(PL_op->op_next);
PUSHBLOCK(cx, CXt_EVAL, SP);
- PUSHEVAL(cx, name, compiling.cop_filegv);
+ PUSHEVAL(cx, name, PL_compiling.cop_filegv);
PL_compiling.cop_line = 0;
@@ -2657,7 +2657,7 @@ PP(pp_entereval)
push_return(PL_op->op_next);
PUSHBLOCK(cx, CXt_EVAL, SP);
- PUSHEVAL(cx, 0, compiling.cop_filegv);
+ PUSHEVAL(cx, 0, PL_compiling.cop_filegv);
/* prepare to compile string */
diff --git a/pp_hot.c b/pp_hot.c
index d7f8f52e28..823da4446a 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -284,7 +284,7 @@ PP(pp_pushre)
Copy(&PL_op, &LvTARGOFF(sv), 1, OP*);
XPUSHs(sv);
#else
- XPUSHs((SV*)op);
+ XPUSHs((SV*)PL_op);
#endif
RETURN;
}
diff --git a/pp_sys.c b/pp_sys.c
index e482e4ceee..c6c208d048 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -259,7 +259,7 @@ PP(pp_glob)
PL_rs = sv_2mortal(newSVpv("", 1));
#ifndef DOSISH
#ifndef CSH
- *SvPVX(rs) = '\n';
+ *SvPVX(PL_rs) = '\n';
#endif /* !CSH */
#endif /* !DOSISH */
@@ -271,7 +271,7 @@ PP(pp_glob)
#if 0 /* XXX never used! */
PP(pp_indread)
{
- last_in_gv = gv_fetchpv(SvPVx(GvSV((GV*)(*stack_sp--)), PL_na), TRUE,SVt_PVIO);
+ PL_last_in_gv = gv_fetchpv(SvPVx(GvSV((GV*)(*PL_stack_sp--)), PL_na), TRUE,SVt_PVIO);
return do_readline();
}
#endif
@@ -504,7 +504,7 @@ PP(pp_umask)
* since 'group' and 'other' concepts probably don't exist here. */
if (MAXARG >= 1 && (POPi & 0700))
DIE("umask not implemented");
- XPUSHs(&sv_undef);
+ XPUSHs(&PL_sv_undef);
#endif
RETURN;
}
@@ -2186,9 +2186,9 @@ PP(pp_stat)
#endif
PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_size)));
#ifdef BIG_TIME
- PUSHs(sv_2mortal(newSVnv((U32)statcache.st_atime)));
- PUSHs(sv_2mortal(newSVnv((U32)statcache.st_mtime)));
- PUSHs(sv_2mortal(newSVnv((U32)statcache.st_ctime)));
+ PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_atime)));
+ PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_mtime)));
+ PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_ctime)));
#else
PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_atime)));
PUSHs(sv_2mortal(newSViv((I32)PL_statcache.st_mtime)));
@@ -2650,7 +2650,7 @@ PP(pp_chdir)
}
#ifdef VMS
if (!tmps || !*tmps) {
- svp = hv_fetch(GvHVn(envgv), "SYS$LOGIN", 9, FALSE);
+ svp = hv_fetch(GvHVn(PL_envgv), "SYS$LOGIN", 9, FALSE);
if (svp)
tmps = SvPV(*svp, PL_na);
}
@@ -2660,7 +2660,7 @@ PP(pp_chdir)
#ifdef VMS
/* Clear the DEFAULT element of ENV so we'll get the new value
* in the future. */
- hv_delete(GvHVn(envgv),"DEFAULT",7,G_DISCARD);
+ hv_delete(GvHVn(PL_envgv),"DEFAULT",7,G_DISCARD);
#endif
RETURN;
}
@@ -2734,11 +2734,11 @@ PP(pp_rename)
#ifdef HAS_RENAME
anum = PerlLIO_rename(tmps, tmps2);
#else
- if (!(anum = PerlLIO_stat(tmps, &statbuf))) {
+ if (!(anum = PerlLIO_stat(tmps, &PL_statbuf))) {
if (same_dirent(tmps2, tmps)) /* can always rename to same name */
anum = 1;
else {
- if (euid || PerlLIO_stat(tmps2, &statbuf) < 0 || !S_ISDIR(statbuf.st_mode))
+ if (euid || PerlLIO_stat(tmps2, &PL_statbuf) < 0 || !S_ISDIR(PL_statbuf.st_mode))
(void)UNLINK(tmps2);
if (!(anum = link(tmps, tmps2)))
anum = UNLINK(tmps);
@@ -2826,7 +2826,7 @@ char *filename;
if (myfp) {
SV *tmpsv = sv_newmortal();
- /* Need to save/restore 'rs' ?? */
+ /* Need to save/restore 'PL_rs' ?? */
s = sv_gets(tmpsv, myfp, 0);
(void)PerlProc_pclose(myfp);
if (s != Nullch) {
@@ -2875,7 +2875,7 @@ char *filename;
return 0;
}
else { /* some mkdirs return no failure indication */
- anum = (PerlLIO_stat(save_filename, &statbuf) >= 0);
+ anum = (PerlLIO_stat(save_filename, &PL_statbuf) >= 0);
if (PL_op->op_type == OP_RMDIR)
anum = !anum;
if (anum)
@@ -3422,7 +3422,7 @@ PP(pp_tms)
#ifndef VMS
(void)PerlProc_times(&PL_timesbuf);
#else
- (void)PerlProc_times((tbuffer_t *)&timesbuf); /* time.h uses different name for */
+ (void)PerlProc_times((tbuffer_t *)&PL_timesbuf); /* time.h uses different name for */
/* struct tms, though same data */
/* is returned. */
#endif
@@ -3749,7 +3749,7 @@ PP(pp_ghostent)
sv_setpvn(sv, *elem, len);
}
#else
- PUSHs(sv = sv_mortalcopy(&sv_no));
+ PUSHs(sv = sv_mortalcopy(&PL_sv_no));
if (hent->h_addr)
sv_setpvn(sv, hent->h_addr, len);
#endif /* h_addr */
@@ -4228,7 +4228,7 @@ PP(pp_gpwent)
sv_setpv(sv, pwent->pw_shell);
#ifdef PWEXPIRE
- PUSHs(sv = sv_mortalcopy(&sv_no));
+ PUSHs(sv = sv_mortalcopy(&PL_sv_no));
sv_setiv(sv, (IV)pwent->pw_expire);
#endif
}
diff --git a/regcomp.c b/regcomp.c
index 41c42fa3ab..79b1316694 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -2101,7 +2101,7 @@ reg_node(U8 op)
ret = PL_regcode;
if (SIZE_ONLY) {
- SIZE_ALIGN(regsize);
+ SIZE_ALIGN(PL_regsize);
PL_regsize += 1;
return(ret);
}
@@ -2126,7 +2126,7 @@ reganode(U8 op, U32 arg)
ret = PL_regcode;
if (SIZE_ONLY) {
- SIZE_ALIGN(regsize);
+ SIZE_ALIGN(PL_regsize);
PL_regsize += 2;
return(ret);
}
diff --git a/regcomp.h b/regcomp.h
index 727a4e509b..526b885eec 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -183,7 +183,7 @@ struct regnode_2 {
#define UCHARAT(p) ((int)*(p)&CHARMASK)
#endif
#else /* lint */
-#define UCHARAT(p) regdummy
+#define UCHARAT(p) PL_regdummy
#endif /* lint */
#define FAIL(m) croak ("/%.127s/: %s", PL_regprecomp,m)
diff --git a/regexec.c b/regexec.c
index 2c10383854..9e90699ec8 100644
--- a/regexec.c
+++ b/regexec.c
@@ -820,7 +820,7 @@ regmatch(regnode *prog)
: (PL_multiline &&
(nextchr || locinput < PL_regeol) && locinput[-1] == '\n') )
{
- /* regtill = regbol; */
+ /* PL_regtill = PL_regbol; */
break;
}
sayNO;
diff --git a/scope.c b/scope.c
index 7d28ee45f2..4df5f2e9ea 100644
--- a/scope.c
+++ b/scope.c
@@ -28,7 +28,7 @@ stack_grow(SV **sp, SV **p, int n)
#ifndef STRESS_REALLOC
av_extend(PL_curstack, (p - PL_stack_base) + (n) + 128);
#else
- av_extend(curstack, (p - stack_base) + (n) + 1);
+ av_extend(PL_curstack, (p - PL_stack_base) + (n) + 1);
#endif
#if defined(DEBUGGING) && !defined(USE_THREADS)
growing--;
diff --git a/scope.h b/scope.h
index 24d98e4acd..0dde4e12a0 100644
--- a/scope.h
+++ b/scope.h
@@ -135,8 +135,8 @@ struct jmpenv {
typedef struct jmpenv JMPENV;
#ifdef OP_IN_REGISTER
-#define OP_REG_TO_MEM opsave = op
-#define OP_MEM_TO_REG op = opsave
+#define OP_REG_TO_MEM PL_opsave = op
+#define OP_MEM_TO_REG op = PL_opsave
#else
#define OP_REG_TO_MEM NOOP
#define OP_MEM_TO_REG NOOP
diff --git a/sv.h b/sv.h
index 61db0e5224..3dac548291 100644
--- a/sv.h
+++ b/sv.h
@@ -107,7 +107,7 @@ struct io {
# define SvREFCNT_inc(sv) sv_newref((SV*)sv)
# else
# define SvREFCNT_inc(sv) \
- ((Sv=(SV*)(sv)), (Sv && ATOMIC_INC(SvREFCNT(Sv))), (SV*)Sv)
+ ((PL_Sv=(SV*)(sv)), (PL_Sv && ATOMIC_INC(SvREFCNT(PL_Sv))), (SV*)PL_Sv)
# endif
#endif
@@ -451,7 +451,7 @@ struct xpvio {
#define SvLEN(sv) ((XPV*) SvANY(sv))->xpv_len
#define SvLENx(sv) SvLEN(sv)
#define SvEND(sv)(((XPV*) SvANY(sv))->xpv_pv + ((XPV*)SvANY(sv))->xpv_cur)
-#define SvENDx(sv) ((Sv = (sv)), SvEND(Sv))
+#define SvENDx(sv) ((PL_Sv = (sv)), SvEND(PL_Sv))
#define SvMAGIC(sv) ((XPVMG*) SvANY(sv))->xmg_magic
#define SvSTASH(sv) ((XPVMG*) SvANY(sv))->xmg_stash
@@ -590,18 +590,18 @@ struct xpvio {
# undef SvPVx
# undef SvTRUE
# undef SvTRUEx
-# define SvIVx(sv) ((Sv = (sv)), SvIV(Sv))
-# define SvUVx(sv) ((Sv = (sv)), SvUV(Sv))
-# define SvNVx(sv) ((Sv = (sv)), SvNV(Sv))
-# define SvPVx(sv, lp) ((Sv = (sv)), SvPV(Sv, lp))
+# define SvIVx(sv) ((PL_Sv = (sv)), SvIV(PL_Sv))
+# define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
+# define SvNVx(sv) ((PL_Sv = (sv)), SvNV(PL_Sv))
+# define SvPVx(sv, lp) ((PL_Sv = (sv)), SvPV(PL_Sv, lp))
# define SvTRUE(sv) ( \
!sv \
? 0 \
: SvPOK(sv) \
- ? ((Xpv = (XPV*)SvANY(sv)) && \
- (*Xpv->xpv_pv > '0' || \
- Xpv->xpv_cur > 1 || \
- (Xpv->xpv_cur && *Xpv->xpv_pv != '0')) \
+ ? ((PL_Xpv = (XPV*)SvANY(sv)) && \
+ (*PL_Xpv->xpv_pv > '0' || \
+ PL_Xpv->xpv_cur > 1 || \
+ (PL_Xpv->xpv_cur && *PL_Xpv->xpv_pv != '0')) \
? 1 \
: 0) \
: \
@@ -610,7 +610,7 @@ struct xpvio {
: SvNOK(sv) \
? SvNVX(sv) != 0.0 \
: sv_2bool(sv) )
-# define SvTRUEx(sv) ((Sv = (sv)), SvTRUE(Sv))
+# define SvTRUEx(sv) ((PL_Sv = (sv)), SvTRUE(PL_Sv))
#endif /* !USE_THREADS */
#endif /* !__GNU__ */
#endif /* !CRIPPLED_CC */
diff --git a/taint.c b/taint.c
index 88ca8a5a48..4c031de517 100644
--- a/taint.c
+++ b/taint.c
@@ -51,8 +51,8 @@ taint_env(void)
while (1) {
if (i)
(void)sprintf(name,"DCL$PATH;%d", i);
- svp = hv_fetch(GvHVn(envgv), name, strlen(name), FALSE);
- if (!svp || *svp == &sv_undef)
+ svp = hv_fetch(GvHVn(PL_envgv), name, strlen(name), FALSE);
+ if (!svp || *svp == &PL_sv_undef)
break;
if (SvTAINTED(*svp)) {
dTHR;
diff --git a/toke.c b/toke.c
index 8c2121d587..75f2b8ac77 100644
--- a/toke.c
+++ b/toke.c
@@ -1885,7 +1885,7 @@ yylex(void)
*/
SV *x = GvSV(gv_fetchpv("\030", TRUE, SVt_PV));
assert(SvPOK(x) || SvGMAGICAL(x));
- if (sv_eq(x, GvSV(curcop->cop_filegv))) {
+ if (sv_eq(x, GvSV(PL_curcop->cop_filegv))) {
sv_setpvn(x, ipath, ipathend - ipath);
SvSETMAGIC(x);
}
@@ -3197,7 +3197,7 @@ yylex(void)
case KEY_crypt:
#ifdef FCRYPT
- if (!cryptseen++)
+ if (!PL_cryptseen++)
init_des();
#endif
LOP(OP_CRYPT,XTERM);
diff --git a/util.c b/util.c
index 5c27bee456..b91601dfe2 100644
--- a/util.c
+++ b/util.c
@@ -90,7 +90,7 @@ safemalloc(MEM_SIZE size)
#if !(defined(I286) || defined(atarist))
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%x: (%05d) malloc %ld bytes\n",ptr,PL_an++,(long)size));
#else
- DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) malloc %ld bytes\n",ptr,an++,(long)size));
+ DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) malloc %ld bytes\n",ptr,PL_an++,(long)size));
#endif
if (ptr != Nullch)
return ptr;
@@ -141,8 +141,8 @@ saferealloc(Malloc_t where,MEM_SIZE size)
} )
#else
DEBUG_m( {
- PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) rfree\n",where,an++);
- PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) realloc %ld bytes\n",ptr,an++,(long)size);
+ PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) rfree\n",where,PL_an++);
+ PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) realloc %ld bytes\n",ptr,PL_an++,(long)size);
} )
#endif
@@ -166,7 +166,7 @@ safefree(Malloc_t where)
#if !(defined(I286) || defined(atarist))
DEBUG_m( PerlIO_printf(Perl_debug_log, "0x%x: (%05d) free\n",(char *) where,PL_an++));
#else
- DEBUG_m( PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) free\n",(char *) where,an++));
+ DEBUG_m( PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) free\n",(char *) where,PL_an++));
#endif
if (where) {
/*SUPPRESS 701*/
@@ -197,7 +197,7 @@ safecalloc(MEM_SIZE count, MEM_SIZE size)
#if !(defined(I286) || defined(atarist))
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%x: (%05d) calloc %ld x %ld bytes\n",ptr,PL_an++,(long)count,(long)size));
#else
- DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) calloc %ld x %ld bytes\n",ptr,an++,(long)count,(long)size));
+ DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) calloc %ld x %ld bytes\n",ptr,PL_an++,(long)count,(long)size));
#endif
if (ptr != Nullch) {
memset((void*)ptr, 0, size);
@@ -1106,7 +1106,7 @@ screaminstr(SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift, I32 *old_
if (!last) return (char *)(big+pos-previous);
found = 1;
}
- } while ( pos += screamnext[pos] );
+ } while ( pos += PL_screamnext[pos] );
return (last && found) ? (char *)(big+(*old_posp)-previous) : Nullch;
#else /* !POINTERRIGOR */
big -= previous;
@@ -1848,7 +1848,7 @@ my_popen(char *cmd, char *mode)
#ifndef NOFILE
#define NOFILE 20
#endif
- for (fd = maxsysfd + 1; fd < NOFILE; fd++)
+ for (fd = PL_maxsysfd + 1; fd < NOFILE; fd++)
PerlLIO_close(fd);
#endif
do_exec(cmd); /* may or may not use the shell */
@@ -2674,7 +2674,7 @@ getTHR _((void))
{
pthread_addr_t t;
- if (pthread_getspecific(thr_key, &t))
+ if (pthread_getspecific(PL_thr_key, &t))
croak("panic: pthread_getspecific");
return (struct perl_thread *) t;
}
@@ -2780,7 +2780,7 @@ new_struct_thread(struct perl_thread *t)
PL_in_eval = FALSE;
PL_restartop = 0;
- tainted = t->Ttainted;
+ PL_tainted = t->Ttainted;
PL_curpm = t->Tcurpm; /* XXX No PMOP ref count */
PL_nrs = newSVsv(t->Tnrs);
PL_rs = SvREFCNT_inc(PL_nrs);
diff --git a/vms/ext/DCLsym/DCLsym.xs b/vms/ext/DCLsym/DCLsym.xs
index 3918eb11e5..35cabc525e 100644
--- a/vms/ext/DCLsym/DCLsym.xs
+++ b/vms/ext/DCLsym/DCLsym.xs
@@ -54,7 +54,7 @@ _getsym(name)
_ckvmssts(lib$sfree1_dd(&valdsc));
}
else {
- ST(0) = &sv_undef; /* error - we're returning undef, if anything */
+ ST(0) = &PL_sv_undef; /* error - we're returning undef, if anything */
switch (retsts) {
case LIB$_NOSUCHSYM:
break; /* nobody home */;
diff --git a/vms/ext/Stdio/Stdio.xs b/vms/ext/Stdio/Stdio.xs
index 9744be04f2..6fa1b29bbe 100644
--- a/vms/ext/Stdio/Stdio.xs
+++ b/vms/ext/Stdio/Stdio.xs
@@ -93,11 +93,11 @@ newFH(FILE *fp, char type) {
* symbol tables. This code (through io = ...) is really
* equivalent to gv_fetchpv("VMS::Stdio::__FH__",TRUE,SVt_PVIO),
* with a little less overhead, and good exercise for me. :-) */
- stashp = (GV **)hv_fetch(defstash,"VMS::",5,TRUE);
- if (!stashp || *stashp == (GV *)&sv_undef) return Nullsv;
+ stashp = (GV **)hv_fetch(PL_defstash,"VMS::",5,TRUE);
+ if (!stashp || *stashp == (GV *)&PL_sv_undef) return Nullsv;
if (!(stash = GvHV(*stashp))) stash = GvHV(*stashp) = newHV();
stashp = (GV **)hv_fetch(GvHV(*stashp),"Stdio::",7,TRUE);
- if (!stashp || *stashp == (GV *)&sv_undef) return Nullsv;
+ if (!stashp || *stashp == (GV *)&PL_sv_undef) return Nullsv;
if (!(stash = GvHV(*stashp))) stash = GvHV(*stashp) = newHV();
/* Set up GV to point to IO, and then take reference */
@@ -122,15 +122,15 @@ constant(name)
if (constant(name, &i))
ST(0) = sv_2mortal(newSViv(i));
else
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
void
flush(fp)
FILE * fp
PROTOTYPE: $
CODE:
- if (fflush(fp)) { ST(0) = &sv_undef; }
- else { clearerr(fp); ST(0) = &sv_yes; }
+ if (fflush(fp)) { ST(0) = &PL_sv_undef; }
+ else { clearerr(fp); ST(0) = &PL_sv_yes; }
char *
getname(fp)
@@ -146,14 +146,14 @@ rewind(fp)
FILE * fp
PROTOTYPE: $
CODE:
- ST(0) = rewind(fp) ? &sv_undef : &sv_yes;
+ ST(0) = rewind(fp) ? &PL_sv_undef : &PL_sv_yes;
void
remove(name)
char *name
PROTOTYPE: $
CODE:
- ST(0) = remove(name) ? &sv_undef : &sv_yes;
+ ST(0) = remove(name) ? &PL_sv_undef : &PL_sv_yes;
void
setdef(...)
@@ -166,14 +166,14 @@ setdef(...)
struct dsc$descriptor_s dirdsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
if (items) {
SV *defsv = ST(items-1); /* mimic chdir() */
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
if (!SvPOK(defsv)) { SETERRNO(EINVAL,LIB$_INVARG); XSRETURN(1); }
- if (tovmsspec(SvPV(defsv,na),vmsdef) == NULL) { XSRETURN(1); }
+ if (tovmsspec(SvPV(defsv,PL_na),vmsdef) == NULL) { XSRETURN(1); }
deffab.fab$l_fna = vmsdef; deffab.fab$b_fns = strlen(vmsdef);
}
else {
deffab.fab$l_fna = "SYS$LOGIN"; deffab.fab$b_fns = 9;
- EXTEND(sp,1); ST(0) = &sv_undef;
+ EXTEND(sp,1); ST(0) = &PL_sv_undef;
}
defnam.nam$l_esa = es; defnam.nam$b_ess = sizeof es;
deffab.fab$l_nam = &defnam;
@@ -204,7 +204,7 @@ setdef(...)
my_setenv("SYS$DISK",defnam.nam$b_node ? defnam.nam$l_node : defnam.nam$l_dev);
*defnam.nam$l_dir = sep;
dirdsc.dsc$a_pointer = defnam.nam$l_dir; dirdsc.dsc$w_length = defnam.nam$b_dir;
- if ((retsts = sys$setddir(&dirdsc,0,0)) & 1) ST(0) = &sv_yes;
+ if ((retsts = sys$setddir(&dirdsc,0,0)) & 1) ST(0) = &PL_sv_yes;
else { set_errno(EVMSERR); set_vaxc_errno(retsts); }
(void) sys$parse(&deffab,0,0); /* free up context */
@@ -213,8 +213,8 @@ sync(fp)
FILE * fp
PROTOTYPE: $
CODE:
- if (fsync(fileno(fp))) { ST(0) = &sv_undef; }
- else { clearerr(fp); ST(0) = &sv_yes; }
+ if (fsync(fileno(fp))) { ST(0) = &PL_sv_undef; }
+ else { clearerr(fp); ST(0) = &PL_sv_yes; }
char *
tmpnam()
@@ -250,7 +250,7 @@ vmsopen(spec,...)
}
else if (*spec == '<') spec++;
myargc = items - 1;
- for (i = 0; i < myargc; i++) args[i] = SvPV(ST(i+1),na);
+ for (i = 0; i < myargc; i++) args[i] = SvPV(ST(i+1),PL_na);
/* This hack brought to you by C's opaque arglist management */
switch (myargc) {
case 0:
@@ -283,9 +283,9 @@ vmsopen(spec,...)
}
if (fp != Nullfp) {
SV *fh = newFH(fp,(mode[1] ? '+' : (mode[0] == 'r' ? '<' : (mode[0] == 'a' ? 'a' : '>'))));
- ST(0) = (fh ? sv_2mortal(fh) : &sv_undef);
+ ST(0) = (fh ? sv_2mortal(fh) : &PL_sv_undef);
}
- else { ST(0) = &sv_undef; }
+ else { ST(0) = &PL_sv_undef; }
void
vmssysopen(spec,mode,perm,...)
@@ -304,7 +304,7 @@ vmssysopen(spec,mode,perm,...)
}
if (items > 11) croak("too many args");
myargc = items - 3;
- for (i = 0; i < myargc; i++) args[i] = SvPV(ST(i+3),na);
+ for (i = 0; i < myargc; i++) args[i] = SvPV(ST(i+3),PL_na);
/* More fun with C calls; can't combine with above because
args 2,3 of different types in fopen() and open() */
switch (myargc) {
@@ -340,16 +340,16 @@ vmssysopen(spec,mode,perm,...)
if (fd >= 0 &&
((fp = fdopen(fd, &("r\000w\000r+"[2*i]))) != Nullfp)) {
SV *fh = newFH(fp,"<>++"[i]);
- ST(0) = (fh ? sv_2mortal(fh) : &sv_undef);
+ ST(0) = (fh ? sv_2mortal(fh) : &PL_sv_undef);
}
- else { ST(0) = &sv_undef; }
+ else { ST(0) = &PL_sv_undef; }
void
waitfh(fp)
FILE * fp
PROTOTYPE: $
CODE:
- ST(0) = fwait(fp) ? &sv_undef : &sv_yes;
+ ST(0) = fwait(fp) ? &PL_sv_undef : &PL_sv_yes;
void
writeof(mysv)
@@ -363,9 +363,9 @@ writeof(mysv)
FILE *fp = io ? IoOFP(io) : NULL;
if (fp == NULL || strchr(">was+-|",IoTYPE(io)) == Nullch) {
set_errno(EBADF); set_vaxc_errno(SS$_IVCHAN);
- ST(0) = &sv_undef; XSRETURN(1);
+ ST(0) = &PL_sv_undef; XSRETURN(1);
}
- if (fgetname(fp,devnam) == Nullch) { ST(0) = &sv_undef; XSRETURN(1); }
+ if (fgetname(fp,devnam) == Nullch) { ST(0) = &PL_sv_undef; XSRETURN(1); }
if ((cp = strrchr(devnam,':')) != NULL) *(cp+1) = '\0';
devdsc.dsc$w_length = strlen(devnam);
retsts = sys$assign(&devdsc,&chan,0,0);
@@ -373,7 +373,7 @@ writeof(mysv)
if (retsts & 1) retsts = iosb[0];
retsts2 = sys$dassgn(chan); /* Be sure to deassign the channel */
if (retsts & 1) retsts = retsts2;
- if (retsts & 1) { ST(0) = &sv_yes; }
+ if (retsts & 1) { ST(0) = &PL_sv_yes; }
else {
set_vaxc_errno(retsts);
switch (retsts) {
@@ -388,5 +388,5 @@ writeof(mysv)
default: /* Includes "shouldn't happen" cases that might map */
set_errno(EVMSERR); break; /* to other errno values */
}
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
}
diff --git a/vms/vms.c b/vms/vms.c
index 46bad3bc7d..e80a5ac2a4 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -129,7 +129,7 @@ my_getenv(char *lnm)
int trnsuccess;
SV *tmpsv;
- if (curinterp) { /* Perl interpreter running -- may be threaded */
+ if (PL_curinterp) { /* Perl interpreter running -- may be threaded */
/* Set up a temporary buffer for the return value; Perl will
* clean it up at the next statement transition */
tmpsv = sv_2mortal(newSVpv("",LNM$C_NAMLENGTH+1));
@@ -188,7 +188,7 @@ prime_env_iter(void)
{
dTHR;
static int primed = 0;
- HV *envhv = GvHVn(envgv);
+ HV *envhv = GvHVn(PL_envgv);
PerlIO *sholog;
char eqv[LNM$C_NAMLENGTH+1],mbxnam[LNM$C_NAMLENGTH+1],*start,*end;
unsigned short int chan;
@@ -248,13 +248,13 @@ prime_env_iter(void)
}
/* We use Perl's sv_gets to read from the pipe, since PerlIO_open is
* tied to Perl's I/O layer, so it may not return a simple FILE * */
- oldrs = rs;
- rs = newSVpv("\n",1);
+ oldrs = PL_rs;
+ PL_rs = newSVpv("\n",1);
linesv = newSVpv("",0);
while (1) {
if ((start = sv_gets(linesv,sholog,0)) == Nullch) {
PerlIO_close(sholog);
- SvREFCNT_dec(linesv); SvREFCNT_dec(rs); rs = oldrs;
+ SvREFCNT_dec(linesv); SvREFCNT_dec(PL_rs); PL_rs = oldrs;
primed = 1;
/* Wait for subprocess to clean up (we know subproc won't return 0) */
while (substs == 0) { sys$hiber(); wakect++;}
@@ -270,7 +270,7 @@ prime_env_iter(void)
else end = Nullch;
if ((eqvlen = my_trnlnm(start,eqv,0)) == 0) {
if (vaxc$errno == SS$_NOLOGNAM || vaxc$errno == SS$_IVLOGNAM) {
- if (dowarn)
+ if (PL_dowarn)
warn("Ill-formed logical name |%s| in prime_env_iter",start);
continue;
}
@@ -673,7 +673,7 @@ safe_popen(char *cmd, char *mode)
info->next=open_pipes; /* prepend to list */
open_pipes=info;
- forkprocess = info->pid;
+ PL_forkprocess = info->pid;
return info->fp;
} /* end of safe_popen */
@@ -764,7 +764,7 @@ my_waitpid(Pid_t pid, int *statusp, int flags)
unsigned long int ownercode = JPI$_OWNER, ownerpid, mypid;
unsigned long int interval[2],sts;
- if (dowarn) {
+ if (PL_dowarn) {
_ckvmssts(lib$getjpi(&ownercode,&pid,0,&ownerpid,0,0));
_ckvmssts(lib$getjpi(&ownercode,0,0,&mypid,0,0));
if (ownerpid != mypid)
@@ -2374,7 +2374,7 @@ vms_image_init(int *argcp, char ***argvp)
if (mask != rlst) Safefree(mask);
}
/* We need to use this hack to tell Perl it should run with tainting,
- * since its tainting flag may be part of the curinterp struct, which
+ * since its tainting flag may be part of the PL_curinterp struct, which
* hasn't been allocated when vms_image_init() is called.
*/
if (add_taint) {
@@ -2829,9 +2829,9 @@ static struct dsc$descriptor_s VMScmd = {0,DSC$K_DTYPE_T,DSC$K_CLASS_S,Nullch};
static void
vms_execfree() {
- if (Cmd) {
- Safefree(Cmd);
- Cmd = Nullch;
+ if (PL_Cmd) {
+ Safefree(PL_Cmd);
+ PL_Cmd = Nullch;
}
if (VMScmd.dsc$a_pointer) {
Safefree(VMScmd.dsc$a_pointer);
@@ -2864,20 +2864,20 @@ setup_argstr(SV *really, SV **mark, SV **sp)
cmdlen += rlen ? rlen + 1 : 0;
}
}
- New(401,Cmd,cmdlen+1,char);
+ New(401,PL_Cmd,cmdlen+1,char);
if (tmps && *tmps) {
- strcpy(Cmd,tmps);
+ strcpy(PL_Cmd,tmps);
mark++;
}
- else *Cmd = '\0';
+ else *PL_Cmd = '\0';
while (++mark <= sp) {
if (*mark) {
- strcat(Cmd," ");
- strcat(Cmd,SvPVx(*mark,na));
+ strcat(PL_Cmd," ");
+ strcat(PL_Cmd,SvPVx(*mark,PL_na));
}
}
- return Cmd;
+ return PL_Cmd;
} /* end of setup_argstr() */
@@ -2909,9 +2909,9 @@ setup_cmddsc(char *cmd, int check_img)
else isdcl = 1;
if (isdcl) { /* It's a DCL command, just do it. */
VMScmd.dsc$w_length = strlen(cmd);
- if (cmd == Cmd) {
- VMScmd.dsc$a_pointer = Cmd;
- Cmd = Nullch; /* Don't try to free twice in vms_execfree() */
+ if (cmd == PL_Cmd) {
+ VMScmd.dsc$a_pointer = PL_Cmd;
+ PL_Cmd = Nullch; /* Don't try to free twice in vms_execfree() */
}
else VMScmd.dsc$a_pointer = savepvn(cmd,VMScmd.dsc$w_length);
}
@@ -3010,7 +3010,7 @@ vms_do_exec(char *cmd)
set_errno(EVMSERR);
}
set_vaxc_errno(retsts);
- if (dowarn)
+ if (PL_dowarn)
warn("Can't exec \"%s\": %s", VMScmd.dsc$a_pointer, Strerror(errno));
vms_execfree();
}
@@ -3067,7 +3067,7 @@ do_spawn(char *cmd)
set_errno(EVMSERR);
}
set_vaxc_errno(sts);
- if (dowarn)
+ if (PL_dowarn)
warn("Can't spawn \"%s\": %s",
hadcmd ? VMScmd.dsc$a_pointer : "", Strerror(errno));
}
@@ -3917,7 +3917,7 @@ is_null_device(name)
return (*name++ == ':') && (*name != ':');
}
-/* Do the permissions allow some operation? Assumes statcache already set. */
+/* Do the permissions allow some operation? Assumes PL_statcache already set. */
/* Do this via $Check_Access on VMS, since the CRTL stat() returns only a
* subset of the applicable information.
*/
@@ -3926,7 +3926,7 @@ I32
cando(I32 bit, I32 effective, Stat_t *statbufp)
{
dTHR;
- if (statbufp == &statcache) return cando_by_name(bit,effective,namecache);
+ if (statbufp == &PL_statcache) return cando_by_name(bit,effective,namecache);
else {
char fname[NAM$C_MAXRSS+1];
unsigned long int retsts;
@@ -4061,7 +4061,7 @@ flex_fstat(int fd, Stat_t *statbufp)
{
dTHR;
if (!fstat(fd,(stat_t *) statbufp)) {
- if (statbufp == (Stat_t *) &statcache) *namecache == '\0';
+ if (statbufp == (Stat_t *) &PL_statcache) *namecache == '\0';
statbufp->st_dev = encode_dev(statbufp->st_devnam);
# ifdef RTL_USES_UTC
# ifdef VMSISH_TIME
@@ -4097,7 +4097,7 @@ flex_stat(char *fspec, Stat_t *statbufp)
char fileified[NAM$C_MAXRSS+1];
int retval = -1;
- if (statbufp == (Stat_t *) &statcache)
+ if (statbufp == (Stat_t *) &PL_statcache)
do_tovmsspec(fspec,namecache,0);
if (is_null_device(fspec)) { /* Fake a stat() for the null device */
memset(statbufp,0,sizeof *statbufp);
@@ -4120,7 +4120,7 @@ flex_stat(char *fspec, Stat_t *statbufp)
*/
if (do_fileify_dirspec(fspec,fileified,0) != NULL) {
retval = stat(fileified,(stat_t *) statbufp);
- if (!retval && statbufp == (Stat_t *) &statcache)
+ if (!retval && statbufp == (Stat_t *) &PL_statcache)
strcpy(namecache,fileified);
}
if (retval) retval = stat(fspec,(stat_t *) statbufp);
@@ -4410,9 +4410,9 @@ rmsexpand_fromperl(CV *cv)
if (!items || items > 2)
croak("Usage: VMS::Filespec::rmsexpand(spec[,defspec])");
- fspec = SvPV(ST(0),na);
+ fspec = SvPV(ST(0),PL_na);
if (!fspec || !*fspec) XSRETURN_UNDEF;
- if (items == 2) defspec = SvPV(ST(1),na);
+ if (items == 2) defspec = SvPV(ST(1),PL_na);
rslt = do_rmsexpand(fspec,NULL,1,defspec,0);
ST(0) = sv_newmortal();
@@ -4427,7 +4427,7 @@ vmsify_fromperl(CV *cv)
char *vmsified;
if (items != 1) croak("Usage: VMS::Filespec::vmsify(spec)");
- vmsified = do_tovmsspec(SvPV(ST(0),na),NULL,1);
+ vmsified = do_tovmsspec(SvPV(ST(0),PL_na),NULL,1);
ST(0) = sv_newmortal();
if (vmsified != NULL) sv_usepvn(ST(0),vmsified,strlen(vmsified));
XSRETURN(1);
@@ -4440,7 +4440,7 @@ unixify_fromperl(CV *cv)
char *unixified;
if (items != 1) croak("Usage: VMS::Filespec::unixify(spec)");
- unixified = do_tounixspec(SvPV(ST(0),na),NULL,1);
+ unixified = do_tounixspec(SvPV(ST(0),PL_na),NULL,1);
ST(0) = sv_newmortal();
if (unixified != NULL) sv_usepvn(ST(0),unixified,strlen(unixified));
XSRETURN(1);
@@ -4453,7 +4453,7 @@ fileify_fromperl(CV *cv)
char *fileified;
if (items != 1) croak("Usage: VMS::Filespec::fileify(spec)");
- fileified = do_fileify_dirspec(SvPV(ST(0),na),NULL,1);
+ fileified = do_fileify_dirspec(SvPV(ST(0),PL_na),NULL,1);
ST(0) = sv_newmortal();
if (fileified != NULL) sv_usepvn(ST(0),fileified,strlen(fileified));
XSRETURN(1);
@@ -4466,7 +4466,7 @@ pathify_fromperl(CV *cv)
char *pathified;
if (items != 1) croak("Usage: VMS::Filespec::pathify(spec)");
- pathified = do_pathify_dirspec(SvPV(ST(0),na),NULL,1);
+ pathified = do_pathify_dirspec(SvPV(ST(0),PL_na),NULL,1);
ST(0) = sv_newmortal();
if (pathified != NULL) sv_usepvn(ST(0),pathified,strlen(pathified));
XSRETURN(1);
@@ -4479,7 +4479,7 @@ vmspath_fromperl(CV *cv)
char *vmspath;
if (items != 1) croak("Usage: VMS::Filespec::vmspath(spec)");
- vmspath = do_tovmspath(SvPV(ST(0),na),NULL,1);
+ vmspath = do_tovmspath(SvPV(ST(0),PL_na),NULL,1);
ST(0) = sv_newmortal();
if (vmspath != NULL) sv_usepvn(ST(0),vmspath,strlen(vmspath));
XSRETURN(1);
@@ -4492,7 +4492,7 @@ unixpath_fromperl(CV *cv)
char *unixpath;
if (items != 1) croak("Usage: VMS::Filespec::unixpath(spec)");
- unixpath = do_tounixpath(SvPV(ST(0),na),NULL,1);
+ unixpath = do_tounixpath(SvPV(ST(0),PL_na),NULL,1);
ST(0) = sv_newmortal();
if (unixpath != NULL) sv_usepvn(ST(0),unixpath,strlen(unixpath));
XSRETURN(1);
@@ -4512,15 +4512,15 @@ candelete_fromperl(CV *cv)
if (SvTYPE(mysv) == SVt_PVGV) {
if (!(io = GvIOp(mysv)) || !fgetname(IoIFP(io),fspec)) {
set_errno(EINVAL); set_vaxc_errno(LIB$_INVARG);
- ST(0) = &sv_no;
+ ST(0) = &PL_sv_no;
XSRETURN(1);
}
fsp = fspec;
}
else {
- if (mysv != ST(0) || !(fsp = SvPV(mysv,na)) || !*fsp) {
+ if (mysv != ST(0) || !(fsp = SvPV(mysv,PL_na)) || !*fsp) {
set_errno(EINVAL); set_vaxc_errno(LIB$_INVARG);
- ST(0) = &sv_no;
+ ST(0) = &PL_sv_no;
XSRETURN(1);
}
}
@@ -4548,15 +4548,15 @@ rmscopy_fromperl(CV *cv)
if (SvTYPE(mysv) == SVt_PVGV) {
if (!(io = GvIOp(mysv)) || !fgetname(IoIFP(io),inspec)) {
set_errno(EINVAL); set_vaxc_errno(LIB$_INVARG);
- ST(0) = &sv_no;
+ ST(0) = &PL_sv_no;
XSRETURN(1);
}
inp = inspec;
}
else {
- if (mysv != ST(0) || !(inp = SvPV(mysv,na)) || !*inp) {
+ if (mysv != ST(0) || !(inp = SvPV(mysv,PL_na)) || !*inp) {
set_errno(EINVAL); set_vaxc_errno(LIB$_INVARG);
- ST(0) = &sv_no;
+ ST(0) = &PL_sv_no;
XSRETURN(1);
}
}
@@ -4564,15 +4564,15 @@ rmscopy_fromperl(CV *cv)
if (SvTYPE(mysv) == SVt_PVGV) {
if (!(io = GvIOp(mysv)) || !fgetname(IoIFP(io),outspec)) {
set_errno(EINVAL); set_vaxc_errno(LIB$_INVARG);
- ST(0) = &sv_no;
+ ST(0) = &PL_sv_no;
XSRETURN(1);
}
outp = outspec;
}
else {
- if (mysv != ST(1) || !(outp = SvPV(mysv,na)) || !*outp) {
+ if (mysv != ST(1) || !(outp = SvPV(mysv,PL_na)) || !*outp) {
set_errno(EINVAL); set_vaxc_errno(LIB$_INVARG);
- ST(0) = &sv_no;
+ ST(0) = &PL_sv_no;
XSRETURN(1);
}
}
diff --git a/vms/vmsish.h b/vms/vmsish.h
index fd9d693bcb..228a054996 100644
--- a/vms/vmsish.h
+++ b/vms/vmsish.h
@@ -203,9 +203,9 @@
#define HINT_M_VMSISH_STATUS 0x01000000 /* system, $? return VMS status */
#define HINT_M_VMSISH_EXIT 0x02000000 /* exit(1) ==> SS$_NORMAL */
#define HINT_M_VMSISH_TIME 0x04000000 /* times are local, not UTC */
-#define NATIVE_HINTS (hints >> HINT_V_VMSISH) /* used in op.c */
+#define NATIVE_HINTS (PL_hints >> HINT_V_VMSISH) /* used in op.c */
-#define TEST_VMSISH(h) (curcop->op_private & ((h) >> HINT_V_VMSISH))
+#define TEST_VMSISH(h) (PL_curcop->op_private & ((h) >> HINT_V_VMSISH))
#define VMSISH_STATUS TEST_VMSISH(HINT_M_VMSISH_STATUS)
#define VMSISH_EXIT TEST_VMSISH(HINT_M_VMSISH_EXIT)
#define VMSISH_TIME TEST_VMSISH(HINT_M_VMSISH_TIME)
diff --git a/win32/win32.c b/win32/win32.c
index 1f7883bc52..13f11e3cc7 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -474,7 +474,7 @@ do_aspawn(void *vreally, void **vmark, void **vsp)
}
while (++mark <= sp) {
- if (*mark && (str = SvPV(*mark, na)))
+ if (*mark && (str = SvPV(*mark, PL_na)))
argv[index++] = str;
else
argv[index++] = "";
@@ -482,7 +482,7 @@ do_aspawn(void *vreally, void **vmark, void **vsp)
argv[index++] = 0;
status = win32_spawnvp(flag,
- (const char*)(really ? SvPV(really,na) : argv[0]),
+ (const char*)(really ? SvPV(really,PL_na) : argv[0]),
(const char* const*)argv);
if (status < 0 && errno == ENOEXEC) {
@@ -495,7 +495,7 @@ do_aspawn(void *vreally, void **vmark, void **vsp)
argv[sh_items] = w32_perlshell_vec[sh_items];
status = win32_spawnvp(flag,
- (const char*)(really ? SvPV(really,na) : argv[0]),
+ (const char*)(really ? SvPV(really,PL_na) : argv[0]),
(const char* const*)argv);
}
@@ -2122,7 +2122,7 @@ XS(w32_SetCwd)
dXSARGS;
if (items != 1)
croak("usage: Win32::SetCurrentDirectory($cwd)");
- if (SetCurrentDirectory(SvPV(ST(0),na)))
+ if (SetCurrentDirectory(SvPV(ST(0),PL_na)))
XSRETURN_YES;
XSRETURN_NO;
@@ -2305,8 +2305,8 @@ XS(w32_Spawn)
if (items != 3)
croak("usage: Win32::Spawn($cmdName, $args, $PID)");
- cmd = SvPV(ST(0),na);
- args = SvPV(ST(1), na);
+ cmd = SvPV(ST(0),PL_na);
+ args = SvPV(ST(1), PL_na);
memset(&stStartInfo, 0, sizeof(stStartInfo)); /* Clear the block */
stStartInfo.cb = sizeof(stStartInfo); /* Set the structure size */
@@ -2362,7 +2362,7 @@ XS(w32_GetShortPathName)
ST(0) = shortpath;
}
else
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
XSRETURN(1);
}
diff --git a/win32/win32thread.c b/win32/win32thread.c
index e91830d38d..14ac5d7f42 100644
--- a/win32/win32thread.c
+++ b/win32/win32thread.c
@@ -18,7 +18,7 @@ Perl_setTHR(struct perl_thread *t)
#ifdef USE_DECLSPEC_THREAD
Perl_current_thread = t;
#else
- TlsSetValue(thr_key,t);
+ TlsSetValue(PL_thr_key,t);
#endif
#endif
}
@@ -30,7 +30,7 @@ Perl_getTHR(void)
#ifdef USE_DECLSPEC_THREAD
return Perl_current_thread;
#else
- return (struct perl_thread *) TlsGetValue(thr_key);
+ return (struct perl_thread *) TlsGetValue(PL_thr_key);
#endif
#else
return NULL;
@@ -43,7 +43,7 @@ Perl_alloc_thread_key(void)
#ifdef USE_THREADS
static int key_allocated = 0;
if (!key_allocated) {
- if ((thr_key = TlsAlloc()) == TLS_OUT_OF_INDEXES)
+ if ((PL_thr_key = TlsAlloc()) == TLS_OUT_OF_INDEXES)
croak("panic: TlsAlloc");
key_allocated = 1;
}