summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1998-07-18 13:53:03 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1998-07-18 13:53:03 +0000
commit3280af22f58e7b37514ed104858e2c2fc55ceeeb (patch)
tree8fd8328859f022068272656f072a7ec4eecac0a6 /ext
parentef6361f9c2260919aefcc17b1b80f8857c67a84a (diff)
downloadperl-3280af22f58e7b37514ed104858e2c2fc55ceeeb.tar.gz
PL_ prefix to all perlvars, part1
Builds and passes all tests at one limit i.e. -DPERL_GLOBAL_STRUCT p4raw-id: //depot/ansiperl@1532
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.xs22
-rw-r--r--ext/Data/Dumper/Dumper.xs12
-rw-r--r--ext/DynaLoader/dl_next.xs2
-rw-r--r--ext/ODBM_File/ODBM_File.xs2
-rw-r--r--ext/Opcode/Opcode.xs70
-rw-r--r--ext/POSIX/POSIX.xs4
-rw-r--r--ext/Socket/Socket.xs4
-rw-r--r--ext/attrs/attrs.xs2
-rw-r--r--ext/re/re.xs14
9 files changed, 66 insertions, 66 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs
index f9a0645bb8..9dfcf465c1 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -189,8 +189,8 @@ make_sv_object(SV *arg, SV *sv)
char *type = 0;
IV iv;
- for (iv = 0; iv < sizeof(specialsv_list)/sizeof(SV*); iv++) {
- if (sv == specialsv_list[iv]) {
+ for (iv = 0; iv < sizeof(PL_specialsv_list)/sizeof(SV*); iv++) {
+ if (sv == PL_specialsv_list[iv]) {
type = "B::SPECIAL";
break;
}
@@ -436,13 +436,13 @@ PROTOTYPES: DISABLE
BOOT:
INIT_SPECIALSV_LIST;
-#define B_main_cv() main_cv
-#define B_main_root() main_root
-#define B_main_start() main_start
-#define B_comppadlist() (main_cv ? CvPADLIST(main_cv) : CvPADLIST(compcv))
-#define B_sv_undef() &sv_undef
-#define B_sv_yes() &sv_yes
-#define B_sv_no() &sv_no
+#define B_main_cv() PL_main_cv
+#define B_main_root() PL_main_root
+#define B_main_start() PL_main_start
+#define B_comppadlist() (PL_main_cv ? CvPADLIST(PL_main_cv) : CvPADLIST(PL_compcv))
+#define B_sv_undef() &PL_sv_undef
+#define B_sv_yes() &PL_sv_yes
+#define B_sv_no() &PL_sv_no
B::CV
B_main_cv()
@@ -516,7 +516,7 @@ ppname(opnum)
int opnum
CODE:
ST(0) = sv_newmortal();
- if (opnum >= 0 && opnum < maxo) {
+ if (opnum >= 0 && opnum < PL_maxo) {
sv_setpvn(ST(0), "pp_", 3);
sv_catpv(ST(0), op_name[opnum]);
}
@@ -543,7 +543,7 @@ cast_I32(i)
void
minus_c()
CODE:
- minus_c = TRUE;
+ PL_minus_c = TRUE;
SV *
cstring(sv)
diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs
index 07e82d5f7c..6add52fe0f 100644
--- a/ext/Data/Dumper/Dumper.xs
+++ b/ext/Data/Dumper/Dumper.xs
@@ -138,7 +138,7 @@ DD_dump(SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv,
if (SvGMAGICAL(val))
mg_get(val);
- if (val == &sv_undef || !SvOK(val)) {
+ if (val == &PL_sv_undef || !SvOK(val)) {
sv_catpvn(retval, "undef", 5);
return 1;
}
@@ -151,9 +151,9 @@ DD_dump(SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv,
XPUSHs(val); PUTBACK;
i = perl_call_method(SvPVX(freezer), G_EVAL|G_SCALAR);
SPAGAIN;
- if (SvTRUE(GvSV(errgv)))
+ if (SvTRUE(GvSV(PL_errgv)))
warn("WARNING(Freezer method call failed): %s",
- SvPVX(GvSV(errgv)));
+ SvPVX(GvSV(PL_errgv)));
else if (i)
val = newSVsv(POPs);
PUTBACK; FREETMPS; LEAVE;
@@ -302,7 +302,7 @@ DD_dump(SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv,
if (svp)
elem = *svp;
else
- elem = &sv_undef;
+ elem = &PL_sv_undef;
ilen = inamelen;
sv_setiv(ixsv, ix);
@@ -640,7 +640,7 @@ Data_Dumper_Dumpxs(href, ...)
todumpav = namesav = Nullav;
seenhv = Nullhv;
val = pad = xpad = apad = sep = tmp = varname
- = freezer = toaster = bless = &sv_undef;
+ = freezer = toaster = bless = &PL_sv_undef;
name = sv_newmortal();
indent = 2;
terse = useqq = purity = deepcopy = 0;
@@ -699,7 +699,7 @@ Data_Dumper_Dumpxs(href, ...)
if ((svp = av_fetch(todumpav, i, FALSE)))
val = *svp;
else
- val = &sv_undef;
+ val = &PL_sv_undef;
if ((svp = av_fetch(namesav, i, TRUE)))
sv_setsv(name, *svp);
else
diff --git a/ext/DynaLoader/dl_next.xs b/ext/DynaLoader/dl_next.xs
index e35c251c55..48ec49cd82 100644
--- a/ext/DynaLoader/dl_next.xs
+++ b/ext/DynaLoader/dl_next.xs
@@ -191,7 +191,7 @@ static char *dlopen(char *path, int mode /* mode is ignored */)
if (rld_success) {
result = path;
/* prevent multiple loads of same file into same process */
- hv_store(dl_loaded_files, path, strlen(path), &sv_yes, 0);
+ hv_store(dl_loaded_files, path, strlen(path), &PL_sv_yes, 0);
} else {
TransferError(nxerr);
result = (char*) 0;
diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs
index 53d1930c54..5127ea52a3 100644
--- a/ext/ODBM_File/ODBM_File.xs
+++ b/ext/ODBM_File/ODBM_File.xs
@@ -64,7 +64,7 @@ odbm_TIEHASH(dbtype, filename, flags, mode)
New(0, tmpbuf, strlen(filename) + 5, char);
SAVEFREEPV(tmpbuf);
sprintf(tmpbuf,"%s.dir",filename);
- if (stat(tmpbuf, &statbuf) < 0) {
+ if (stat(tmpbuf, &PL_statbuf) < 0) {
if (flags & O_CREAT) {
if (mode < 0 || close(creat(tmpbuf,mode)) < 0)
croak("ODBM_File: Can't create %s", filename);
diff --git a/ext/Opcode/Opcode.xs b/ext/Opcode/Opcode.xs
index a9fea04954..63743a5ce0 100644
--- a/ext/Opcode/Opcode.xs
+++ b/ext/Opcode/Opcode.xs
@@ -2,7 +2,7 @@
#include "perl.h"
#include "XSUB.h"
-/* maxo shouldn't differ from MAXO but leave room anyway (see BOOT:) */
+/* PL_maxo shouldn't differ from MAXO but leave room anyway (see BOOT:) */
#define OP_MASK_BUF_SIZE (MAXO + 100)
/* XXX op_named_bits and opset_all are never freed */
@@ -36,7 +36,7 @@ op_names_init(void)
op_named_bits = newHV();
op_names = get_op_names();
- for(i=0; i < maxo; ++i) {
+ for(i=0; i < PL_maxo; ++i) {
SV *sv;
sv = newSViv(i);
SvREADONLY_on(sv);
@@ -51,7 +51,7 @@ op_names_init(void)
while(i-- > 0)
bitmap[i] = 0xFF;
/* Take care to set the right number of bits in the last byte */
- bitmap[len-1] = (maxo & 0x07) ? ~(0xFF << (maxo & 0x07)) : 0xFF;
+ bitmap[len-1] = (PL_maxo & 0x07) ? ~(0xFF << (PL_maxo & 0x07)) : 0xFF;
put_op_bitspec(":all",0, opset_all); /* don't mortalise */
}
@@ -145,7 +145,7 @@ set_opset_bits(char *bitmap, SV *bitspec, int on, char *opname)
int myopcode = SvIV(bitspec);
int offset = myopcode >> 3;
int bit = myopcode & 0x07;
- if (myopcode >= maxo || myopcode < 0)
+ if (myopcode >= PL_maxo || myopcode < 0)
croak("panic: opcode \"%s\" value %d is invalid", opname, myopcode);
if (opcode_debug >= 2)
warn("set_opset_bits bit %2d (off=%d, bit=%d) %s %s\n",
@@ -173,7 +173,7 @@ set_opset_bits(char *bitmap, SV *bitspec, int on, char *opname)
static void
-opmask_add(SV *opset) /* THE ONLY FUNCTION TO EDIT op_mask ITSELF */
+opmask_add(SV *opset) /* THE ONLY FUNCTION TO EDIT PL_op_mask ITSELF */
{
int i,j;
char *bitmask;
@@ -182,8 +182,8 @@ opmask_add(SV *opset) /* THE ONLY FUNCTION TO EDIT op_mask ITSELF */
verify_opset(opset,1); /* croaks on bad opset */
- if (!op_mask) /* caller must ensure op_mask exists */
- croak("Can't add to uninitialised op_mask");
+ if (!PL_op_mask) /* caller must ensure PL_op_mask exists */
+ croak("Can't add to uninitialised PL_op_mask");
/* OPCODES ALREADY MASKED ARE NEVER UNMASKED. See opmask_addlocal() */
@@ -194,28 +194,28 @@ opmask_add(SV *opset) /* THE ONLY FUNCTION TO EDIT op_mask ITSELF */
myopcode += 8;
continue;
}
- for (j=0; j < 8 && myopcode < maxo; )
- op_mask[myopcode++] |= bits & (1 << j++);
+ for (j=0; j < 8 && myopcode < PL_maxo; )
+ PL_op_mask[myopcode++] |= bits & (1 << j++);
}
}
static void
-opmask_addlocal(SV *opset, char *op_mask_buf) /* Localise op_mask then opmask_add() */
+opmask_addlocal(SV *opset, char *op_mask_buf) /* Localise PL_op_mask then opmask_add() */
{
- char *orig_op_mask = op_mask;
- SAVEPPTR(op_mask);
+ char *orig_op_mask = PL_op_mask;
+ SAVEPPTR(PL_op_mask);
#if !(defined(PERL_OBJECT) && defined(__BORLANDC__))
/* XXX casting to an ordinary function ptr from a member function ptr
* is disallowed by Borland
*/
if (opcode_debug >= 2)
- SAVEDESTRUCTOR((void(CPERLscope(*))_((void*)))warn,"op_mask restored");
+ SAVEDESTRUCTOR((void(CPERLscope(*))_((void*)))warn,"PL_op_mask restored");
#endif
- op_mask = &op_mask_buf[0];
+ PL_op_mask = &op_mask_buf[0];
if (orig_op_mask)
- Copy(orig_op_mask, op_mask, maxo, char);
+ Copy(orig_op_mask, PL_op_mask, PL_maxo, char);
else
- Zero(op_mask, maxo, char);
+ Zero(PL_op_mask, PL_maxo, char);
opmask_add(opset);
}
@@ -226,8 +226,8 @@ MODULE = Opcode PACKAGE = Opcode
PROTOTYPES: ENABLE
BOOT:
- assert(maxo < OP_MASK_BUF_SIZE);
- opset_len = (maxo + 7) / 8;
+ assert(PL_maxo < OP_MASK_BUF_SIZE);
+ opset_len = (PL_maxo + 7) / 8;
if (opcode_debug >= 1)
warn("opset_len %ld\n", (long)opset_len);
op_names_init();
@@ -246,19 +246,19 @@ PPCODE:
opmask_addlocal(mask, op_mask_buf);
- save_aptr(&endav);
- endav = (AV*)sv_2mortal((SV*)newAV()); /* ignore END blocks for now */
+ save_aptr(&PL_endav);
+ PL_endav = (AV*)sv_2mortal((SV*)newAV()); /* ignore END blocks for now */
- save_hptr(&defstash); /* save current default stack */
+ save_hptr(&PL_defstash); /* save current default stack */
/* the assignment to global defstash changes our sense of 'main' */
- defstash = gv_stashpv(Package, GV_ADDWARN); /* should exist already */
+ PL_defstash = gv_stashpv(Package, GV_ADDWARN); /* should exist already */
/* defstash must itself contain a main:: so we'll add that now */
/* take care with the ref counts (was cause of long standing bug) */
/* XXX I'm still not sure if this is right, GV_ADDWARN should warn! */
gv = gv_fetchpv("main::", GV_ADDWARN, SVt_PVHV);
sv_free((SV*)GvHV(gv));
- GvHV(gv) = (HV*)SvREFCNT_inc(defstash);
+ GvHV(gv) = (HV*)SvREFCNT_inc(PL_defstash);
PUSHMARK(SP);
perl_call_sv(codesv, GIMME|G_EVAL|G_KEEPERR); /* use callers context */
@@ -283,9 +283,9 @@ CODE:
bitmap = SvPVX(opset);
while(len-- > 0)
bitmap[len] = ~bitmap[len];
- /* take care of extra bits beyond maxo in last byte */
- if (maxo & 07)
- bitmap[opset_len-1] &= ~(0xFF << (maxo & 0x07));
+ /* take care of extra bits beyond PL_maxo in last byte */
+ if (PL_maxo & 07)
+ bitmap[opset_len-1] &= ~(0xFF << (PL_maxo & 0x07));
}
ST(0) = opset;
@@ -303,7 +303,7 @@ PPCODE:
verify_opset(opset,1);
for (myopcode=0, i=0; i < opset_len; i++) {
U16 bits = bitmap[i];
- for (j=0; j < 8 && myopcode < maxo; j++, myopcode++) {
+ for (j=0; j < 8 && myopcode < PL_maxo; j++, myopcode++) {
if ( bits & (1 << j) )
XPUSHs(sv_2mortal(newSVpv(names[myopcode], 0)));
}
@@ -394,7 +394,7 @@ PPCODE:
SV *bitspec = get_op_bitspec(opname, len, 1);
if (SvIOK(bitspec)) {
myopcode = SvIV(bitspec);
- if (myopcode < 0 || myopcode >= maxo)
+ if (myopcode < 0 || myopcode >= PL_maxo)
croak("panic: opcode %d (%s) out of range",myopcode,opname);
XPUSHs(sv_2mortal(newSVpv(op_desc[myopcode], 0)));
}
@@ -404,7 +404,7 @@ PPCODE:
myopcode = 0;
for (b=0; b < opset_len; b++) {
U16 bits = bitmap[b];
- for (j=0; j < 8 && myopcode < maxo; j++, myopcode++)
+ for (j=0; j < 8 && myopcode < PL_maxo; j++, myopcode++)
if (bits & (1 << j))
XPUSHs(sv_2mortal(newSVpv(op_desc[myopcode], 0)));
}
@@ -440,8 +440,8 @@ void
opmask_add(opset)
SV *opset
PREINIT:
- if (!op_mask)
- Newz(0, op_mask, maxo, char);
+ if (!PL_op_mask)
+ Newz(0, PL_op_mask, PL_maxo, char);
void
opcodes()
@@ -450,18 +450,18 @@ PPCODE:
croak("opcodes in list context not yet implemented"); /* XXX */
}
else {
- XPUSHs(sv_2mortal(newSViv(maxo)));
+ XPUSHs(sv_2mortal(newSViv(PL_maxo)));
}
void
opmask()
CODE:
ST(0) = sv_2mortal(new_opset(Nullsv));
- if (op_mask) {
+ if (PL_op_mask) {
char *bitmap = SvPVX(ST(0));
int myopcode;
- for(myopcode=0; myopcode < maxo; ++myopcode) {
- if (op_mask[myopcode])
+ for(myopcode=0; myopcode < PL_maxo; ++myopcode) {
+ if (PL_op_mask[myopcode])
bitmap[myopcode >> 3] |= 1 << (myopcode & 0x07);
}
}
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 88aac25868..0a5212d0b3 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -3167,7 +3167,7 @@ sigaction(sig, action, oldaction = 0)
# This code is really grody because we're trying to make the signal
# interface look beautiful, which is hard.
- if (!siggv)
+ if (!PL_siggv)
gv_fetchpv("SIG", TRUE, SVt_PVHV);
{
@@ -3175,7 +3175,7 @@ sigaction(sig, action, oldaction = 0)
struct sigaction oact;
POSIX__SigSet sigset;
SV** svp;
- SV** sigsvp = hv_fetch(GvHVn(siggv),
+ SV** sigsvp = hv_fetch(GvHVn(PL_siggv),
sig_name[sig],
strlen(sig_name[sig]),
TRUE);
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index 9c80c3d358..de0217bdb4 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -85,9 +85,9 @@ my_inet_aton(register const char *cp, struct in_addr *addr)
cp++;
continue;
}
- if (base == 16 && (s=strchr(hexdigit,c))) {
+ if (base == 16 && (s=strchr(PL_hexdigit,c))) {
val = (val << 4) +
- ((s - hexdigit) & 15);
+ ((s - PL_hexdigit) & 15);
cp++;
continue;
}
diff --git a/ext/attrs/attrs.xs b/ext/attrs/attrs.xs
index dae612adaf..bc0df7082b 100644
--- a/ext/attrs/attrs.xs
+++ b/ext/attrs/attrs.xs
@@ -24,7 +24,7 @@ char * Class
int i;
CV *cv;
PPCODE:
- if (!compcv || !(cv = CvOUTSIDE(compcv)))
+ 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);
diff --git a/ext/re/re.xs b/ext/re/re.xs
index 5e68226235..27c92b9294 100644
--- a/ext/re/re.xs
+++ b/ext/re/re.xs
@@ -20,20 +20,20 @@ static void
deinstall(void)
{
dTHR;
- regexecp = &regexec_flags;
- regcompp = &pregcomp;
+ PL_regexecp = &regexec_flags;
+ PL_regcompp = &pregcomp;
if (!oldfl)
- debug &= ~R_DB;
+ PL_debug &= ~R_DB;
}
static void
install(void)
{
dTHR;
- regexecp = &my_regexec;
- regcompp = &my_regcomp;
- oldfl = debug & R_DB;
- debug |= R_DB;
+ PL_regexecp = &my_regexec;
+ PL_regcompp = &my_regcomp;
+ oldfl = PL_debug & R_DB;
+ PL_debug |= R_DB;
}
MODULE = re PACKAGE = re