# define XS_VERSION_BOOTCHECK \
STMT_START { \
SV *_sv; \
- const char *vn = Nullch, *module = SvPV_nolen_const(ST(0)); \
+ const char *vn = NULL, *module = SvPV_nolen_const(ST(0)); \
if (items >= 2) /* version supplied as bootstrap arg */ \
_sv = ST(1); \
else { \
# define CopSTASHPV(c) ((c)->cop_stashpv)
# ifdef NETWARE
-# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
+# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : NULL))
# else
# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = savesharedpv(pv))
# endif
# define CopSTASH(c) (CopSTASHPV(c) \
? gv_stashpv(CopSTASHPV(c),GV_ADD) : NULL)
-# define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME_get(hv) : Nullch)
+# define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME_get(hv) : NULL)
# define CopSTASH_eq(c,hv) ((hv) && stashpv_hvname_match(c,hv))
# ifdef NETWARE
# define CopSTASH_free(c) SAVECOPSTASH_FREE(c)
# define CopFILE_free(c) SAVECOPFILE_FREE(c)
# else
# define CopSTASH_free(c) PerlMemShared_free(CopSTASHPV(c))
-# define CopFILE_free(c) (PerlMemShared_free(CopFILE(c)),(CopFILE(c) = Nullch))
+# define CopFILE_free(c) (PerlMemShared_free(CopFILE(c)),(CopFILE(c) = NULL))
# endif
#else
# define CopFILEGV(c) ((c)->cop_filegv)
# else
# define CopFILEAVx(c) (GvAV(CopFILEGV(c)))
# endif
-# define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
+# define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : NULL)
# define CopSTASH(c) ((c)->cop_stash)
# define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
-# define CopSTASHPV(c) (CopSTASH(c) ? HvNAME_get(CopSTASH(c)) : Nullch)
+# define CopSTASHPV(c) (CopSTASH(c) ? HvNAME_get(CopSTASH(c)) : NULL)
/* cop_stash is not refcounted */
# define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
# define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
namesv = sv_2mortal(newSVpv(oname,0));
num_svs = 1;
svp = &namesv;
- type = Nullch;
+ type = NULL;
fp = PerlIO_openn(aTHX_ type, mode, -1, rawmode, rawperm, NULL, num_svs, svp);
}
else {
fd = -1;
}
if (!num_svs)
- type = Nullch;
+ type = NULL;
if (that_fp) {
fp = PerlIO_fdupopen(aTHX_ that_fp, NULL, dodup);
}
namesv = sv_2mortal(newSVpvn(type,tend - type));
num_svs = 1;
svp = &namesv;
- type = Nullch;
+ type = NULL;
}
fp = PerlIO_openn(aTHX_ type,mode,-1,0,0,NULL,num_svs,svp);
}
namesv = sv_2mortal(newSVpvn(type,tend - type));
num_svs = 1;
svp = &namesv;
- type = Nullch;
+ type = NULL;
}
fp = PerlIO_openn(aTHX_ type,mode,-1,0,0,NULL,num_svs,svp);
}
namesv = sv_2mortal(newSVpvn(type,tend - type));
num_svs = 1;
svp = &namesv;
- type = Nullch;
+ type = NULL;
}
fp = PerlIO_openn(aTHX_ type,mode,-1,0,0,NULL,num_svs,svp);
}
Safefree(PL_Argv);
PL_Argv = Null(char **);
Safefree(PL_Cmd);
- PL_Cmd = Nullch;
+ PL_Cmd = NULL;
}
#ifdef PERL_DEFAULT_DO_EXEC3_IMPLEMENTATION
if (PL_op->op_flags & OPf_MOD || LVRET) { /* lvalue */
if (SvTYPE(TARG) < SVt_PVLV) {
sv_upgrade(TARG, SVt_PVLV);
- sv_magic(TARG, Nullsv, PERL_MAGIC_nkeys, Nullch, 0);
+ sv_magic(TARG, Nullsv, PERL_MAGIC_nkeys, NULL, 0);
}
LvTYPE(TARG) = 'k';
if (LvTARG(TARG) != (SV*)keys) {
{
SV * const sv = sv_newmortal();
- gv_fullname3(sv, gv, Nullch);
+ gv_fullname3(sv, gv, NULL);
Perl_dump_indent(aTHX_ 0, Perl_debug_log, "\nSUB %s = ", SvPVX_const(sv));
if (CvXSUB(GvCV(gv)))
Perl_dump_indent(aTHX_ 0, Perl_debug_log, "(xsub 0x%"UVxf" %d)\n",
{
SV * const sv = sv_newmortal();
- gv_fullname3(sv, gv, Nullch);
+ gv_fullname3(sv, gv, NULL);
Perl_dump_indent(aTHX_ 0, Perl_debug_log, "\nFORMAT %s = ", SvPVX_const(sv));
if (CvROOT(GvFORM(gv)))
op_dump(CvROOT(GvFORM(gv)));
SV *tmpsv = newSV(0);
ENTER;
SAVEFREESV(tmpsv);
- gv_fullname3(tmpsv, (GV*)cSVOPo->op_sv, Nullch);
+ gv_fullname3(tmpsv, (GV*)cSVOPo->op_sv, NULL);
Perl_dump_indent(aTHX_ level, file, "GV = %s\n",
SvPV_nolen_const(tmpsv));
LEAVE;
}
sv = sv_newmortal();
PerlIO_printf(Perl_debug_log, "{\n");
- gv_fullname3(sv, gv, Nullch);
+ gv_fullname3(sv, gv, NULL);
Perl_dump_indent(aTHX_ 1, Perl_debug_log, "GV_NAME = %s", SvPVX_const(sv));
if (gv != GvEGV(gv)) {
- gv_efullname3(sv, GvEGV(gv), Nullch);
+ gv_efullname3(sv, GvEGV(gv), NULL);
Perl_dump_indent(aTHX_ 1, Perl_debug_log, "-> %s", SvPVX_const(sv));
}
PerlIO_putc(Perl_debug_log, '\n');
case OP_GV:
if (cGVOPo_gv) {
SV *sv = newSV(0);
- gv_fullname3(sv, cGVOPo_gv, Nullch);
+ gv_fullname3(sv, cGVOPo_gv, NULL);
PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen_const(sv));
SvREFCNT_dec(sv);
}
GvFILE(gv) = CopFILE(PL_curcop) ? CopFILE(PL_curcop) : (char *) "";
GvCVGEN(gv) = 0;
GvEGV(gv) = gv;
- sv_magic((SV*)gv, (SV*)gv, PERL_MAGIC_glob, Nullch, 0);
+ sv_magic((SV*)gv, (SV*)gv, PERL_MAGIC_glob, NULL, 0);
GvSTASH(gv) = stash;
if (stash)
Perl_sv_add_backref(aTHX_ (SV*)stash, (SV*)gv);
if (strEQ(name2, "SA")) {
AV* const av = GvAVn(gv);
GvMULTI_on(gv);
- sv_magic((SV*)av, (SV*)gv, PERL_MAGIC_isa, Nullch, 0);
+ sv_magic((SV*)av, (SV*)gv, PERL_MAGIC_isa, NULL, 0);
/* NOTE: No support for tied ISA */
if ((add & GV_ADDMULTI) && strEQ(nambeg,"AnyDBM_File::ISA")
&& AvFILLp(av) == -1)
case '-':
{
AV* const av = GvAVn(gv);
- sv_magic((SV*)av, Nullsv, PERL_MAGIC_regdata, Nullch, 0);
+ sv_magic((SV*)av, Nullsv, PERL_MAGIC_regdata, NULL, 0);
SvREADONLY_on(av);
goto magicalize;
}
case '+':
{
AV* const av = GvAVn(gv);
- sv_magic((SV*)av, (SV*)av, PERL_MAGIC_regdata, Nullch, 0);
+ sv_magic((SV*)av, (SV*)av, PERL_MAGIC_regdata, NULL, 0);
SvREADONLY_on(av);
/* FALL THROUGH */
}
if ((name = HvNAME_get(hv))) {
if(PL_stashcache)
hv_delete(PL_stashcache, name, HvNAMELEN_get(hv), G_DISCARD);
- hv_name_set(hv, Nullch, 0, 0);
+ hv_name_set(hv, NULL, 0, 0);
}
SvFLAGS(hv) &= ~SVf_OOK;
Safefree(HvARRAY(hv));
#define HePV(he,lp) ((HeKLEN(he) == HEf_SVKEY) ? \
SvPV(HeKEY_sv(he),lp) : \
(((lp = HeKLEN(he)) >= 0) ? \
- HeKEY(he) : Nullch))
+ HeKEY(he) : NULL))
#define HeSVKEY(he) ((HeKEY(he) && \
HeKLEN(he) == HEf_SVKEY) ? \
#define HV_ITERNEXT_WANTPLACEHOLDERS 0x01 /* Don't skip placeholders. */
#define hv_iternext(hv) hv_iternext_flags(hv, 0)
-#define hv_magic(hv, gv, how) sv_magic((SV*)(hv), (SV*)(gv), how, Nullch, 0)
+#define hv_magic(hv, gv, how) sv_magic((SV*)(hv), (SV*)(gv), how, NULL, 0)
/* available as a function in hv.c */
#define Perl_sharepvn(sv, len, hash) HEK_KEY(share_hek(sv, len, hash))
if (! (curctype =
setlocale(LC_CTYPE,
(!done && (lang || PerlEnv_getenv("LC_CTYPE")))
- ? "" : Nullch)))
+ ? "" : NULL)))
setlocale_failure = TRUE;
else
curctype = savepv(curctype);
if (! (curcoll =
setlocale(LC_COLLATE,
(!done && (lang || PerlEnv_getenv("LC_COLLATE")))
- ? "" : Nullch)))
+ ? "" : NULL)))
setlocale_failure = TRUE;
else
curcoll = savepv(curcoll);
if (! (curnum =
setlocale(LC_NUMERIC,
(!done && (lang || PerlEnv_getenv("LC_NUMERIC")))
- ? "" : Nullch)))
+ ? "" : NULL)))
setlocale_failure = TRUE;
else
curnum = savepv(curnum);
#endif /* ! LC_ALL */
#ifdef USE_LOCALE_CTYPE
- curctype = savepv(setlocale(LC_CTYPE, Nullch));
+ curctype = savepv(setlocale(LC_CTYPE, NULL));
#endif /* USE_LOCALE_CTYPE */
#ifdef USE_LOCALE_COLLATE
- curcoll = savepv(setlocale(LC_COLLATE, Nullch));
+ curcoll = savepv(setlocale(LC_COLLATE, NULL));
#endif /* USE_LOCALE_COLLATE */
#ifdef USE_LOCALE_NUMERIC
- curnum = savepv(setlocale(LC_NUMERIC, Nullch));
+ curnum = savepv(setlocale(LC_NUMERIC, NULL));
#endif /* USE_LOCALE_NUMERIC */
}
else {
}
SvPOK_off(sv);
- SvPV_set(sv, Nullch);
+ SvPV_set(sv, NULL);
SvCUR_set(sv, 0);
SvLEN_set(sv, 0);
*size = malloced_size(pv) + M_OVERHEAD;
if (emergency_buffer_size) {
add_to_chain(emergency_buffer, emergency_buffer_size, 0);
emergency_buffer_size = 0;
- emergency_buffer = Nullch;
+ emergency_buffer = NULL;
have = 1;
}
MALLOC_UNLOCK;
emergency_sbrk_croak("Out of memory during request for %"UVuf" bytes, total sbrk() is %"UVuf" bytes", (UV)size, (UV)(goodsbrk + sbrk_slack));
/* NOTREACHED */
- return Nullch;
+ return NULL;
}
#else /* !defined(PERL_EMERGENCY_SBRK) */
bad_free_warn = (pbf) ? atoi(pbf) : 1;
}
if (!bad_free_warn)
- return Nullch;
+ return NULL;
#ifdef RCHECK
#ifdef PERL_CORE
{
warn("%s", "Bad realloc() ignored");
#endif
#endif
- return Nullch; /* sanity */
+ return NULL; /* sanity */
}
onb = BUCKET_SIZE_REAL(bucket);
void
Perl_sv_taint(pTHX_ SV *sv)
{
- sv_magic((sv), Nullsv, PERL_MAGIC_taint, Nullch, 0);
+ sv_magic((sv), Nullsv, PERL_MAGIC_taint, NULL, 0);
}
/* sv_2iv() is now a macro using Perl_sv_2iv_flags();
void
Perl_hv_magic(pTHX_ HV *hv, GV *gv, int how)
{
- sv_magic((SV*)hv, (SV*)gv, how, Nullch, 0);
+ sv_magic((SV*)hv, (SV*)gv, how, NULL, 0);
}
#if 0 /* use the macro from hv.h instead */
return 0;
}
}
- if ((cp = strchr(elt, ':')) != Nullch)
+ if ((cp = strchr(elt, ':')) != NULL)
*cp = '\0';
if (my_trnlnm(elt, eltbuf, j++))
elt = eltbuf;
Perl_magic_clearenv(pTHX_ SV *sv, MAGIC *mg)
{
PERL_UNUSED_ARG(sv);
- my_setenv(MgPV_nolen_const(mg),Nullch);
+ my_setenv(MgPV_nolen_const(mg),NULL);
return 0;
}
break;
case '\011': /* ^I */ /* NOT \t in EBCDIC */
Safefree(PL_inplace);
- PL_inplace = SvOK(sv) ? savesvpv(sv) : Nullch;
+ PL_inplace = SvOK(sv) ? savesvpv(sv) : NULL;
break;
case '\017': /* ^O */
if (*(mg->mg_ptr+1) == '\0') {
Safefree(PL_osname);
- PL_osname = Nullch;
+ PL_osname = NULL;
if (SvOK(sv)) {
TAINT_PROPER("assigning to $^O");
PL_osname = savesvpv(sv);
(void)rsignal(sig, PL_csighandlerp);
#endif
#endif /* !PERL_MICRO */
- Perl_die(aTHX_ Nullch);
+ Perl_die(aTHX_ NULL);
}
cleanup:
if (flags & 1)
S_gv_ename(pTHX_ GV *gv)
{
SV* const tmpsv = sv_newmortal();
- gv_efullname3(tmpsv, gv, Nullch);
+ gv_efullname3(tmpsv, gv, NULL);
return SvPV_nolen_const(tmpsv);
}
}
else {
Safefree(cPVOPo->op_pv);
- cPVOPo->op_pv = Nullch;
+ cPVOPo->op_pv = NULL;
}
break;
case OP_SUBST:
Nullop,
append_elem(OP_LINESEQ,
append_elem(OP_LINESEQ,
- newSTATEOP(0, Nullch, newUNOP(OP_REQUIRE, 0, idop)),
- newSTATEOP(0, Nullch, veop)),
- newSTATEOP(0, Nullch, imop) ));
+ newSTATEOP(0, NULL, newUNOP(OP_REQUIRE, 0, idop)),
+ newSTATEOP(0, NULL, veop)),
+ newSTATEOP(0, NULL, imop) ));
/* The "did you use incorrect case?" warning used to be here.
* The problem is that on case-insensitive filesystems one
SV* name = Nullsv;
if (gv)
- gv_efullname3(name = sv_newmortal(), gv, Nullch);
+ gv_efullname3(name = sv_newmortal(), gv, NULL);
sv_setpv(msg, "Prototype mismatch:");
if (name)
Perl_sv_catpvf(aTHX_ msg, " sub %"SVf, name);
const I32 gv_fetch_flags
= (block || attrs || (CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS))
? GV_ADDMULTI : GV_ADDMULTI | GV_NOINIT;
- const char * const name = o ? SvPVx_nolen_const(cSVOPo->op_sv) : Nullch;
+ const char * const name = o ? SvPVx_nolen_const(cSVOPo->op_sv) : NULL;
if (proto) {
assert(proto->op_type == OP_CONST);
ps = SvPVx_const(((SVOP*)proto)->op_sv, ps_len);
}
else
- ps = Nullch;
+ ps = NULL;
if (!name && PERLDB_NAMEANON && CopLINE(PL_curcop)) {
SV * const sv = sv_newmortal();
aname = SvPVX_const(sv);
}
else
- aname = Nullch;
+ aname = NULL;
gv = name ? gv_fetchsv(cSVOPo->op_sv, gv_fetch_flags, SVt_PVCV)
: gv_fetchpv(aname ? aname
/* This makes sub {}; work as expected. */
if (block->op_type == OP_STUB) {
op_free(block);
- block = newSTATEOP(0, Nullch, 0);
+ block = newSTATEOP(0, NULL, 0);
}
CvROOT(cv) = newUNOP(OP_LEAVESUB, 0, scalarseq(block));
}
Perl_sv_setpvf(aTHX_ sv, "%s:%ld-%ld",
CopFILE(PL_curcop),
(long)PL_subline, (long)CopLINE(PL_curcop));
- gv_efullname3(tmpstr, gv, Nullch);
+ gv_efullname3(tmpstr, gv, NULL);
hv_store(GvHV(PL_DBsub), SvPVX_const(tmpstr), SvCUR(tmpstr), sv, 0);
hv = GvHVn(db_postponed);
if (HvFILL(hv) > 0 && hv_exists(hv, SvPVX_const(tmpstr), SvCUR(tmpstr))) {
if (SvROK(kidsv) && SvREADONLY(kidsv)) {
SV * const rsv = SvRV(kidsv);
const int svtype = SvTYPE(rsv);
- const char *badtype = Nullch;
+ const char *badtype = NULL;
switch (o->op_type) {
case OP_RV2SV:
o->op_private &= ~HINT_STRICT_REFS;
}
if ((o->op_private & HINT_STRICT_REFS) && (kid->op_private & OPpCONST_BARE)) {
- const char *badthing = Nullch;
+ const char *badthing = NULL;
switch (o->op_type) {
case OP_RV2SV:
badthing = "a SCALAR";
/* is this op a FH constructor? */
if (is_handle_constructor(o,numargs)) {
- const char *name = Nullch;
+ const char *name = NULL;
STRLEN len = 0;
flags = 0;
if (SvTYPE(gv) == SVt_PVGV && GvCV(gv) && SvPVX_const(GvCV(gv))) {
/* XXX could check prototype here instead of just carping */
SV * const sv = sv_newmortal();
- gv_efullname3(sv, gv, Nullch);
+ gv_efullname3(sv, gv, NULL);
Perl_warner(aTHX_ packWARN(WARN_PROTOTYPE),
"%"SVf"() called too early to check prototype",
sv);
# define PmopSTASHPV_set(o,pv) (PmopSTASHPV(o) = savesharedpv(pv))
# define PmopSTASH(o) (PmopSTASHPV(o) \
? gv_stashpv(PmopSTASHPV(o),GV_ADD) : NULL)
-# define PmopSTASH_set(o,hv) PmopSTASHPV_set(o, ((hv) ? HvNAME_get(hv) : Nullch))
+# define PmopSTASH_set(o,hv) PmopSTASHPV_set(o, ((hv) ? HvNAME_get(hv) : NULL))
# define PmopSTASH_free(o) PerlMemShared_free(PmopSTASHPV(o))
#else
# define PmopSTASH(o) ((o)->op_pmstash)
# define PmopSTASH_set(o,hv) ((o)->op_pmstash = (hv))
-# define PmopSTASHPV(o) (PmopSTASH(o) ? HvNAME_get(PmopSTASH(o)) : Nullch)
+# define PmopSTASHPV(o) (PmopSTASH(o) ? HvNAME_get(PmopSTASH(o)) : NULL)
/* op_pmstash is not refcounted */
# define PmopSTASHPV_set(o,pv) PmopSTASH_set((o), gv_stashpv(pv,GV_ADD))
# define PmopSTASH_free(o)
SV* const const_sv = op_const_sv(CvSTART(cv), cv);
if (const_sv) {
SvREFCNT_dec(cv);
- cv = newCONSTSUB(CvSTASH(proto), Nullch, const_sv);
+ cv = newCONSTSUB(CvSTASH(proto), NULL, const_sv);
}
else {
CvCONST_off(cv);
PL_unsafe = FALSE;
Safefree(PL_inplace);
- PL_inplace = Nullch;
+ PL_inplace = NULL;
SvREFCNT_dec(PL_patchlevel);
if (PL_e_script) {
PL_multiline = 0; /* $* */
Safefree(PL_osname); /* $^O */
- PL_osname = Nullch;
+ PL_osname = NULL;
SvREFCNT_dec(PL_statname);
PL_statname = Nullsv;
/* float buffer */
Safefree(PL_efloatbuf);
- PL_efloatbuf = Nullch;
+ PL_efloatbuf = NULL;
PL_efloatsize = 0;
/* startup and shutdown function lists */
/* free locale stuff */
#ifdef USE_LOCALE_COLLATE
Safefree(PL_collation_name);
- PL_collation_name = Nullch;
+ PL_collation_name = NULL;
#endif
#ifdef USE_LOCALE_NUMERIC
Safefree(PL_numeric_name);
- PL_numeric_name = Nullch;
+ PL_numeric_name = NULL;
SvREFCNT_dec(PL_numeric_radix_sv);
PL_numeric_radix_sv = Nullsv;
#endif
SvREADONLY_off(&PL_sv_undef);
Safefree(PL_origfilename);
- PL_origfilename = Nullch;
+ PL_origfilename = NULL;
Safefree(PL_reg_start_tmp);
PL_reg_start_tmp = (char**)NULL;
PL_reg_start_tmpl = 0;
Safefree(PL_psig_name);
PL_psig_name = (SV**)NULL;
Safefree(PL_bitcount);
- PL_bitcount = Nullch;
+ PL_bitcount = NULL;
Safefree(PL_psig_pend);
PL_psig_pend = (int*)NULL;
PL_formfeed = Nullsv;
s = PL_origenviron[0];
while (*s) s++;
#endif
- my_setenv("NoNe SuCh", Nullch);
+ my_setenv("NoNe SuCh", NULL);
/* Force copy of environment. */
for (i = 1; PL_origenviron[i]; i++) {
if (PL_origenviron[i] == s + 1
const char *validarg = "";
register SV *sv;
register char *s;
- const char *cddir = Nullch;
+ const char *cddir = NULL;
#ifdef USE_SITECUSTOMIZE
bool minus_f = FALSE;
#endif
case 'I': /* -I handled both here and in moreswitches() */
forbid_setid("-I");
- if (!*++s && (s=argv[1]) != Nullch) {
+ if (!*++s && (s=argv[1]) != NULL) {
argc--,argv++;
}
if (s && *s) {
PL_taint_warn = FALSE;
}
else {
- char *popt_copy = Nullch;
+ char *popt_copy = NULL;
while (s && *s) {
char *d;
while (isSPACE(*s))
argc++,argv--;
scriptname = BIT_BUCKET; /* don't look for script or read stdin */
}
- else if (scriptname == Nullch) {
+ else if (scriptname == NULL) {
#ifdef MSDOS
if ( PerlLIO_isatty(PerlIO_fileno(PerlIO_stdin())) )
moreswitches("h");
default:
Perl_croak(aTHX_ "Can't emulate -%.1s on #! line",s);
}
- return Nullch;
+ return NULL;
}
/* compliments of Tom Christiansen */
PL_doswitches = FALSE; /* -s is insecure in suid */
/* PSz 13 Nov 03 But -s was caught elsewhere ... so unsetting it here is useless(?!) */
CopLINE_inc(PL_curcop);
- if (sv_gets(PL_linestr, PL_rsfp, 0) == Nullch)
+ if (sv_gets(PL_linestr, PL_rsfp, 0) == NULL)
Perl_croak(aTHX_ "No #! line");
linestr = SvPV_nolen_const(PL_linestr);
/* required even on Sys V */
/* Since the Mac OS does not honor #! arguments for us, we do it ourselves */
while (PL_doextract || gMacPerl_AlwaysExtract) {
- if ((s = sv_gets(PL_linestr, PL_rsfp, 0)) == Nullch) {
+ if ((s = sv_gets(PL_linestr, PL_rsfp, 0)) == NULL) {
if (!gMacPerl_AlwaysExtract)
Perl_croak(aTHX_ "No Perl script found in input\n");
}
#else
while (PL_doextract) {
- if ((s = sv_gets(PL_linestr, PL_rsfp, 0)) == Nullch)
+ if ((s = sv_gets(PL_linestr, PL_rsfp, 0)) == NULL)
Perl_croak(aTHX_ "No Perl script found in input\n");
#endif
s2 = s;
# endif
)
{
- environ[0] = Nullch;
+ environ[0] = NULL;
}
if (env) {
char** origenv = environ;
}
}
- if ( usesep && (s = strchr(p, PERLLIB_SEP)) != Nullch ) {
+ if ( usesep && (s = strchr(p, PERLLIB_SEP)) != NULL ) {
sv_setpvn(libdir, PERLLIB_MANGLE(p, (STRLEN)(s - p)),
(STRLEN)(s - p));
p = s + 1;
}
else {
sv_setpv(libdir, PERLLIB_MANGLE(p, 0));
- p = Nullch; /* break out */
+ p = NULL; /* break out */
}
#ifdef MACOS_TRADITIONAL
if (!strchr(SvPVX(libdir), ':')) {
char *unix;
STRLEN len;
- if ((unix = tounixspec_ts(SvPV(libdir,len),Nullch)) != Nullch) {
+ if ((unix = tounixspec_ts(SvPV(libdir,len),NULL)) != NULL) {
len = strlen(unix);
while (unix[len-1] == '/') len--; /* Cosmetic */
sv_usepvn(libdir,unix,len);
#define TAINT_NOT (PL_tainted = FALSE)
#define TAINT_IF(c) if (c) { PL_tainted = TRUE; }
#define TAINT_ENV() if (PL_tainting) { taint_env(); }
-#define TAINT_PROPER(s) if (PL_tainting) { taint_proper(Nullch, s); }
+#define TAINT_PROPER(s) if (PL_tainting) { taint_proper(NULL, s); }
/* XXX All process group stuff is handled in pp_sys.c. Should these
defines move there? If so, I could simplify this a lot. --AD 9/96.
if (*s) {
STRLEN llen = 0;
const char *e = s;
- const char *as = Nullch;
+ const char *as = NULL;
STRLEN alen = 0;
if (!isIDFIRST(*s)) {
/*
{
dVAR;
if (!PL_def_layerlist) {
- const char * const s = (PL_tainting) ? Nullch : PerlEnv_getenv("PERLIO");
+ const char * const s = (PL_tainting) ? NULL : PerlEnv_getenv("PERLIO");
PERLIO_FUNCS_DECL(*osLayer) = &PerlIO_unix;
PL_def_layerlist = PerlIO_list_alloc(aTHX);
PerlIO_define_layer(aTHX_ PERLIO_FUNCS_CAST(&PerlIO_unix));
/* Legacy binmode is now _defined_ as being equivalent to pushing :raw
So code that used to be here is now in PerlIORaw_pushed().
*/
- return PerlIO_push(aTHX_ f, PERLIO_FUNCS_CAST(&PerlIO_raw), Nullch, Nullsv) ? TRUE : FALSE;
+ return PerlIO_push(aTHX_ f, PERLIO_FUNCS_CAST(&PerlIO_raw), NULL, Nullsv) ? TRUE : FALSE;
}
}
#ifdef HAS_SETLINEBUF
PerlSIO_setlinebuf(PerlIOSelf(f, PerlIOStdio)->stdio);
#else
- PerlSIO_setvbuf(PerlIOSelf(f, PerlIOStdio)->stdio, Nullch, _IOLBF, 0);
+ PerlSIO_setvbuf(PerlIOSelf(f, PerlIOStdio)->stdio, NULL, _IOLBF, 0);
#endif
}
l = *PerlIONext(&l);
}
/* Uses fallback "mode" via PerlIO_modestr() in PerlIO_exportFILE */
- return PerlIO_exportFILE(f, Nullch);
+ return PerlIO_exportFILE(f, NULL);
}
/* Use this to reverse PerlIO_exportFILE calls. */
#ifdef PERLIO_USING_CRLF
# ifdef PERLIO_IS_BINMODE_FD
if (PERLIO_IS_BINMODE_FD(fd))
- PerlIO_binmode(aTHX_ f, '<'/*not used*/, O_BINARY, Nullch);
+ PerlIO_binmode(aTHX_ f, '<'/*not used*/, O_BINARY, NULL);
else
# endif
/*
PERL_UNUSED_ARG(f);
PERL_UNUSED_ARG(buf);
Perl_croak(aTHX_ "Don't know how to get file name");
- return Nullch;
+ return NULL;
#endif
}
PerlIO_fdopen(int fd, const char *mode)
{
dTHX;
- return PerlIO_openn(aTHX_ Nullch, mode, fd, 0, 0, NULL, 0, NULL);
+ return PerlIO_openn(aTHX_ NULL, mode, fd, 0, 0, NULL, 0, NULL);
}
#undef PerlIO_open
{
dTHX;
SV *name = sv_2mortal(newSVpv(path, 0));
- return PerlIO_openn(aTHX_ Nullch, mode, -1, 0, 0, NULL, 1, &name);
+ return PerlIO_openn(aTHX_ NULL, mode, -1, 0, 0, NULL, 1, &name);
}
#undef Perlio_reopen
{
dTHX;
SV *name = sv_2mortal(newSVpv(path,0));
- return PerlIO_openn(aTHX_ Nullch, mode, -1, 0, 0, f, 1, &name);
+ return PerlIO_openn(aTHX_ NULL, mode, -1, 0, 0, f, 1, &name);
}
#undef PerlIO_getc
#ifdef HAS_SETLINEBUF
#define PerlIO_setlinebuf(f) PerlSIO_setlinebuf(f);
#else
-#define PerlIO_setlinebuf(f) PerlSIO_setvbuf(f, Nullch, _IOLBF, 0);
+#define PerlIO_setlinebuf(f) PerlSIO_setvbuf(f, NULL, _IOLBF, 0);
#endif
/* Now our interface to Configure's FILE_xxx macros */
X<fbm_instr>
Returns the location of the SV in the string delimited by C<str> and
-C<strend>. It returns C<Nullch> if the string can't be found. The C<sv>
+C<strend>. It returns C<NULL> if the string can't be found. The C<sv>
does not have to be fbm_compiled, but the search will not be as fast
then.
Copies an integer into a new SV, optionally blessing the SV. The C<rv>
argument will be upgraded to an RV. That RV will be modified to point to
the new SV. The C<classname> argument indicates the package for the
-blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
SV* sv_setref_iv(SV* rv, const char* classname, IV iv)
Copies a double into a new SV, optionally blessing the SV. The C<rv>
argument will be upgraded to an RV. That RV will be modified to point to
the new SV. The C<classname> argument indicates the package for the
-blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
SV* sv_setref_nv(SV* rv, const char* classname, NV nv)
argument will be upgraded to an RV. That RV will be modified to point to
the new SV. If the C<pv> argument is NULL then C<PL_sv_undef> will be placed
into the SV. The C<classname> argument indicates the package for the
-blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
Do not use with other Perl types such as HV, AV, SV, CV, because those
string must be specified with C<n>. The C<rv> argument will be upgraded to
an RV. That RV will be modified to point to the new SV. The C<classname>
argument indicates the package for the blessing. Set C<classname> to
-C<Nullch> to avoid the blessing. The new SV will have a reference count
+C<NULL> to avoid the blessing. The new SV will have a reference count
of 1, and the RV will be returned.
Note that C<sv_setref_pv> copies the pointer while this copies the string.
Copies an unsigned integer into a new SV, optionally blessing the SV. The C<rv>
argument will be upgraded to an RV. That RV will be modified to point to
the new SV. The C<classname> argument indicates the package for the
-blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
SV* sv_setref_uv(SV* rv, const char* classname, UV uv)
sidestepping the normal C order of execution. See C<warn>.
If you want to throw an exception object, assign the object to
-C<$@> and then pass C<Nullch> to croak():
+C<$@> and then pass C<NULL> to croak():
errsv = get_sv("@", TRUE);
sv_setsv(errsv, exception_object);
- croak(Nullch);
+ croak(NULL);
void croak(const char* pat, ...)
}
else if (gv) {
SV *tmpstr = sv_newmortal();
- gv_efullname3(tmpstr, gv, Nullch);
+ gv_efullname3(tmpstr, gv, NULL);
DIE(aTHX_ "Undefined sort subroutine \"%"SVf"\" called",
tmpstr);
}
SAVESPTR(PL_rs);
PL_rs = &PL_sv_undef;
sv_setpvn(TARG, "", 0); /* note that this preserves previous buffer */
- while (sv_gets(TARG, fp, SvCUR(TARG)) != Nullch)
+ while (sv_gets(TARG, fp, SvCUR(TARG)) != NULL)
;
LEAVE;
XPUSHs(TARG);
else {
for (;;) {
SV * const sv = newSV(79);
- if (sv_gets(sv, fp, 0) == Nullch) {
+ if (sv_gets(sv, fp, 0) == NULL) {
SvREFCNT_dec(sv);
break;
}
}
else {
tmpsv = TOPs;
- tmps = SvROK(tmpsv) ? Nullch : SvPV_const(tmpsv, len);
+ tmps = SvROK(tmpsv) ? NULL : SvPV_const(tmpsv, len);
}
if (!tmps || !len) {
SV * const error = ERRSV;
sv_setsv(error,*PL_stack_sp--);
}
}
- DIE(aTHX_ Nullch);
+ DIE(aTHX_ NULL);
}
else {
if (SvPOK(error) && SvCUR(error))
if (SvOK(tmpsv))
tmps = SvPV_const(tmpsv, len);
else
- tmps = Nullch;
+ tmps = NULL;
}
}
if (!tmps || !len)
PUTBACK;
if (PerlIO_binmode(aTHX_ fp,IoTYPE(io),mode_from_discipline(discp),
- (discp) ? SvPV_nolen_const(discp) : Nullch)) {
+ (discp) ? SvPV_nolen_const(discp) : NULL)) {
if (IoOFP(io) && IoOFP(io) != IoIFP(io)) {
if (!PerlIO_binmode(aTHX_ IoOFP(io),IoTYPE(io),
mode_from_discipline(discp),
- (discp) ? SvPV_nolen_const(discp) : Nullch)) {
+ (discp) ? SvPV_nolen_const(discp) : NULL)) {
SPAGAIN;
RETPUSHUNDEF;
}
SvTYPE(varsv) == SVt_PVHV))
Perl_croak(aTHX_
"Self-ties of arrays and hashes are not supported");
- sv_magic(varsv, (SvRV(sv) == varsv ? Nullsv : sv), how, Nullch, 0);
+ sv_magic(varsv, (SvRV(sv) == varsv ? Nullsv : sv), how, NULL, 0);
}
LEAVE;
SP = PL_stack_base + markoff;
if (sv_isobject(TOPs)) {
sv_unmagic((SV *) hv, PERL_MAGIC_tied);
- sv_magic((SV*)hv, TOPs, PERL_MAGIC_tied, Nullch, 0);
+ sv_magic((SV*)hv, TOPs, PERL_MAGIC_tied, NULL, 0);
}
LEAVE;
RETURN;
else {
GV * const * const gvp = (GV**)hv_fetch(hv, GvNAME(egv), GvNAMELEN(egv), FALSE);
if (gvp && *gvp == egv) {
- gv_efullname4(TARG, PL_defoutgv, Nullch, TRUE);
+ gv_efullname4(TARG, PL_defoutgv, NULL, TRUE);
XPUSHTARG;
}
else {
if (fgv) {
SV * const tmpsv = sv_newmortal();
const char *name;
- gv_efullname4(tmpsv, fgv, Nullch, FALSE);
+ gv_efullname4(tmpsv, fgv, NULL, FALSE);
name = SvPV_nolen_const(tmpsv);
if (name && *name)
DIE(aTHX_ "Undefined format \"%s\" called", name);
if (!cv) {
SV * const sv = sv_newmortal();
const char *name;
- gv_efullname4(sv, fgv, Nullch, FALSE);
+ gv_efullname4(sv, fgv, NULL, FALSE);
name = SvPV_nolen_const(sv);
if (name && *name)
DIE(aTHX_ "Undefined top format \"%s\" called",name);
(void)PerlIO_close(fp);
RETPUSHUNDEF;
}
- PerlIO_binmode(aTHX_ fp, '<', O_BINARY, Nullch);
+ PerlIO_binmode(aTHX_ fp, '<', O_BINARY, NULL);
len = PerlIO_read(fp, tbuf, sizeof(tbuf));
(void)PerlIO_close(fp);
if (len <= 0) {
/* Need to save/restore 'PL_rs' ?? */
s = sv_gets(tmpsv, myfp, 0);
(void)PerlProc_pclose(myfp);
- if (s != Nullch) {
+ if (s != NULL) {
int e;
for (e = 1;
#ifdef HAS_SYS_ERRLIST
#ifdef HAS_GETSERVBYNAME
const char * const proto = POPpbytex;
const char * const name = POPpbytex;
- sent = PerlSock_getservbyname(name, (proto && !*proto) ? Nullch : proto);
+ sent = PerlSock_getservbyname(name, (proto && !*proto) ? NULL : proto);
#else
DIE(aTHX_ PL_no_sock_func, "getservbyname");
#endif
#ifdef HAS_HTONS
port = PerlSock_htons(port);
#endif
- sent = PerlSock_getservbyport(port, (proto && !*proto) ? Nullch : proto);
+ sent = PerlSock_getservbyport(port, (proto && !*proto) ? NULL : proto);
#else
DIE(aTHX_ PL_no_sock_func, "getservbyport");
#endif
* compile to execute that permits the execute phase to run lots faster on
* simple cases. They are:
*
- * regstart sv that must begin a match; Nullch if none obvious
+ * regstart sv that must begin a match; NULL if none obvious
* reganch is the match anchored (at beginning-of-line only)?
* regmust string (pointer into program) that match must include, or NULL
* [regmust changed to SV* for bminstr()--law]
char *t;
const int do_utf8 = sv ? SvUTF8(sv) : 0; /* if no sv we have to assume bytes */
I32 ml_anch;
- register char *other_last = Nullch; /* other substr checked before this */
- char *check_at = Nullch; /* check substr found at this pos */
+ register char *other_last = NULL; /* other substr checked before this */
+ char *check_at = NULL; /* check substr found at this pos */
const I32 multiline = prog->reganch & PMf_MULTILINE;
#ifdef DEBUGGING
const char * const i_strpos = strpos;
fail:
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "%sMatch rejected by optimizer%s\n",
PL_colors[4], PL_colors[5]));
- return Nullch;
+ return NULL;
}
/* We know what class REx starts with. Try to find this position... */
last = strend - len + 1;
else if (!multiline)
last = memEQ(strend - len, little, len)
- ? strend - len : Nullch;
+ ? strend - len : NULL;
else
goto find_last;
} else {
&& (mg = mg_find(PL_reg_sv, PERL_MAGIC_regex_global)))) {
/* prepare for quick setting of pos */
sv_magic(PL_reg_sv, (SV*)0,
- PERL_MAGIC_regex_global, Nullch, 0);
+ PERL_MAGIC_regex_global, NULL, 0);
mg = mg_find(PL_reg_sv, PERL_MAGIC_regex_global);
mg->mg_len = -1;
}
RX_MATCH_COPIED_off(prog);
}
else
- PL_reg_oldsaved = Nullch;
+ PL_reg_oldsaved = NULL;
prog->subbeg = PL_bostr;
prog->sublen = PL_regeol - PL_bostr; /* strend may have been modified */
}
function of same name */
register I32 n; /* no or next */
register I32 ln = 0; /* len or last */
- register char *s = Nullch; /* operand or save */
+ register char *s = NULL; /* operand or save */
register char *locinput = PL_reginput;
register I32 c1 = 0, c2 = 0, paren; /* case fold search, parenth */
int minmod = 0, sw = 0, logical = 0;
S_regrepeat_hard(pTHX_ regnode *p, I32 max, I32 *lp)
{
dVAR;
- register char *scan = Nullch;
+ register char *scan = NULL;
register char *start;
register char *loceol = PL_regeol;
I32 l = 0;
if (PL_nice_chunk) {
sv_add_arena(PL_nice_chunk, PL_nice_chunk_size, 0);
- PL_nice_chunk = Nullch;
+ PL_nice_chunk = NULL;
PL_nice_chunk_size = 0;
}
else {
PL_body_roots[i] = 0;
Safefree(PL_nice_chunk);
- PL_nice_chunk = Nullch;
+ PL_nice_chunk = NULL;
PL_nice_chunk_size = 0;
PL_sv_arenaroot = 0;
PL_sv_root = 0;
/* don't upgrade SVt_PVLV: it can hold a glob */
if (dtype != SVt_PVLV)
sv_upgrade(dstr, SVt_PVGV);
- sv_magic(dstr, dstr, PERL_MAGIC_glob, Nullch, 0);
+ sv_magic(dstr, dstr, PERL_MAGIC_glob, NULL, 0);
GvSTASH(dstr) = GvSTASH(sstr);
if (GvSTASH(dstr))
Perl_sv_add_backref(aTHX_ (SV*)GvSTASH(dstr), dstr);
}
if (!intro)
cv_ckproto(cv, (GV*)dstr,
- SvPOK(sref) ? SvPVX_const(sref) : Nullch);
+ SvPOK(sref) ? SvPVX_const(sref) : NULL);
}
GvCV(dstr) = (CV*)sref;
GvCVGEN(dstr) = 0; /* Switch off cacheness. */
const STRLEN len = SvCUR(sv);
SvFAKE_off(sv);
SvREADONLY_off(sv);
- SvPV_set(sv, Nullch);
+ SvPV_set(sv, NULL);
SvLEN_set(sv, 0);
SvGROW(sv, len + 1);
Move(pvx,SvPVX(sv),len,char);
const char *pv2;
STRLEN cur2;
I32 eq = 0;
- char *tpv = Nullch;
+ char *tpv = NULL;
SV* svrecode = Nullsv;
if (!sv1) {
dVAR;
STRLEN cur1, cur2;
const char *pv1, *pv2;
- char *tpv = Nullch;
+ char *tpv = NULL;
I32 cmp;
SV *svrecode = Nullsv;
}
return_string_or_null:
- return (SvCUR(sv) - append) ? SvPVX(sv) : Nullch;
+ return (SvCUR(sv) - append) ? SvPVX(sv) : NULL;
}
/*
SvOK_off(sv);
if (SvTYPE(sv) >= SVt_PV) {
SvCUR_set(sv, 0);
- if (SvPVX_const(sv) != Nullch)
+ if (SvPVX_const(sv) != NULL)
*SvPVX(sv) = '\0';
SvTAINT(sv);
}
SV *tmpsv;
ENTER;
tmpsv = newSV(0);
- gv_efullname3(tmpsv, gv, Nullch);
+ gv_efullname3(tmpsv, gv, NULL);
/* XXX this is probably not what they think they're getting.
* It has the same effect as "sub name;", i.e. just a forward
* declaration! */
argument will be upgraded to an RV. That RV will be modified to point to
the new SV. If the C<pv> argument is NULL then C<PL_sv_undef> will be placed
into the SV. The C<classname> argument indicates the package for the
-blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
Do not use with other Perl types such as HV, AV, SV, CV, because those
Copies an integer into a new SV, optionally blessing the SV. The C<rv>
argument will be upgraded to an RV. That RV will be modified to point to
the new SV. The C<classname> argument indicates the package for the
-blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
=cut
Copies an unsigned integer into a new SV, optionally blessing the SV. The C<rv>
argument will be upgraded to an RV. That RV will be modified to point to
the new SV. The C<classname> argument indicates the package for the
-blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
=cut
Copies a double into a new SV, optionally blessing the SV. The C<rv>
argument will be upgraded to an RV. That RV will be modified to point to
the new SV. The C<classname> argument indicates the package for the
-blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
=cut
string must be specified with C<n>. The C<rv> argument will be upgraded to
an RV. That RV will be modified to point to the new SV. The C<classname>
argument indicates the package for the blessing. Set C<classname> to
-C<Nullch> to avoid the blessing. The new SV will have a reference count
+C<NULL> to avoid the blessing. The new SV will have a reference count
of 1, and the RV will be returned.
Note that C<sv_setref_pv> copies the pointer while this copies the string.
*len = endbuf - p;
return p;
}
- return Nullch;
+ return NULL;
}
U8 utf8buf[UTF8_MAXBYTES+1];
STRLEN esignlen = 0;
- const char *eptr = Nullch;
+ const char *eptr = NULL;
STRLEN elen = 0;
SV *vecsv = Nullsv;
const U8 *vecstr = Null(U8*);
if (RX_MATCH_COPIED(ret))
ret->subbeg = SAVEPVN(r->subbeg, r->sublen);
else
- ret->subbeg = Nullch;
+ ret->subbeg = NULL;
#ifdef PERL_OLD_COPY_ON_WRITE
ret->saved_copy = Nullsv;
#endif
}
}
else {
- SvPV_set(dstr, Nullch);
+ SvPV_set(dstr, NULL);
AvALLOC((AV*)dstr) = (SV**)NULL;
}
break;
}
}
else {
- SvPV_set(dstr, Nullch);
+ SvPV_set(dstr, NULL);
}
/* Record stashes for possible cloning in Perl_clone(). */
if(hvname)
if (proto_perl->Iop_mask)
PL_op_mask = SAVEPVN(proto_perl->Iop_mask, PL_maxo);
else
- PL_op_mask = Nullch;
+ PL_op_mask = NULL;
/* PL_asserting = proto_perl->Iasserting; */
/* current interpreter roots */
PL_lastfd = proto_perl->Ilastfd;
PL_oldname = proto_perl->Ioldname; /* XXX not quite right */
PL_Argv = NULL;
- PL_Cmd = Nullch;
+ PL_Cmd = NULL;
PL_gensym = proto_perl->Igensym;
PL_preambled = proto_perl->Ipreambled;
PL_preambleav = av_dup_inc(proto_perl->Ipreambleav, param);
PL_glob_index = proto_perl->Iglob_index;
PL_srand_called = proto_perl->Isrand_called;
PL_uudmap['M'] = 0; /* reinits on demand */
- PL_bitcount = Nullch; /* reinits on demand */
+ PL_bitcount = NULL; /* reinits on demand */
if (proto_perl->Ipsig_pend) {
Newxz(PL_psig_pend, SIG_SIZE, int);
PL_sortstash = hv_dup(proto_perl->Tsortstash, param);
PL_firstgv = gv_dup(proto_perl->Tfirstgv, param);
PL_secondgv = gv_dup(proto_perl->Tsecondgv, param);
- PL_efloatbuf = Nullch; /* reinits on demand */
+ PL_efloatbuf = NULL; /* reinits on demand */
PL_efloatsize = 0; /* reinits on demand */
/* regex stuff */
PL_lastscream = Nullsv;
PL_watchaddr = NULL;
- PL_watchok = Nullch;
+ PL_watchok = NULL;
PL_regdummy = proto_perl->Tregdummy;
- PL_regprecomp = Nullch;
+ PL_regprecomp = NULL;
PL_regnpar = 0;
PL_regsize = 0;
PL_colorset = 0; /* reinits PL_colors[] */
/*PL_colors[6] = {0,0,0,0,0,0};*/
- PL_reginput = Nullch;
- PL_regbol = Nullch;
- PL_regeol = Nullch;
+ PL_reginput = NULL;
+ PL_regbol = NULL;
+ PL_regeol = NULL;
PL_regstartp = (I32*)NULL;
PL_regendp = (I32*)NULL;
PL_reglastparen = (U32*)NULL;
PL_reglastcloseparen = (U32*)NULL;
- PL_regtill = Nullch;
+ PL_regtill = NULL;
PL_reg_start_tmp = (char**)NULL;
PL_reg_start_tmpl = 0;
PL_regdata = (struct reg_data*)NULL;
- PL_bostr = Nullch;
+ PL_bostr = NULL;
PL_reg_flags = 0;
PL_reg_eval_set = 0;
PL_regnarrate = 0;
PL_regcc = (CURCUR*)NULL;
PL_reg_call_cc = (struct re_cc_state*)NULL;
PL_reg_re = (regexp*)NULL;
- PL_reg_ganch = Nullch;
+ PL_reg_ganch = NULL;
PL_reg_sv = Nullsv;
PL_reg_match_utf8 = FALSE;
PL_reg_magic = (MAGIC*)NULL;
PL_reg_oldpos = 0;
PL_reg_oldcurpm = (PMOP*)NULL;
PL_reg_curpm = (PMOP*)NULL;
- PL_reg_oldsaved = Nullch;
+ PL_reg_oldsaved = NULL;
PL_reg_oldsavedlen = 0;
#ifdef PERL_OLD_COPY_ON_WRITE
PL_nrs = Nullsv;
#endif
PL_reg_maxiter = 0;
PL_reg_leftiter = 0;
- PL_reg_poscache = Nullch;
+ PL_reg_poscache = NULL;
PL_reg_poscache_size= 0;
/* RE engine - function pointers */
=cut
*/
-#define sv_taint(sv) sv_magic((sv), Nullsv, PERL_MAGIC_taint, Nullch, 0)
+#define sv_taint(sv) sv_magic((sv), Nullsv, PERL_MAGIC_taint, NULL, 0)
#define SvTAINTED(sv) (SvMAGICAL(sv) && sv_tainted(sv))
#define SvTAINTED_on(sv) STMT_START{ if(PL_tainting){sv_taint(sv);} }STMT_END
PERLVAR(Treg_oldsavedlen, STRLEN) /* old length of saved substr during match */
PERLVAR(Treg_maxiter, I32) /* max wait until caching pos */
PERLVAR(Treg_leftiter, I32) /* wait until caching pos */
-PERLVARI(Treg_poscache, char *, Nullch) /* cache of pos of WHILEM */
+PERLVARI(Treg_poscache, char *, NULL) /* cache of pos of WHILEM */
PERLVAR(Treg_poscache_size, STRLEN) /* size of pos cache of WHILEM */
PERLVARI(Tpeepp, peep_t, MEMBER_TO_FPTR(Perl_peep))
{
dVAR;
if (DEBUG_T_TEST) {
- const char *name = Nullch;
+ const char *name = NULL;
enum token_type type = TOKENTYPE_NONE;
const struct debug_tokens *p;
SV* const report = newSVpvs("<== ");
SvTEMP_off(PL_linestr);
PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = SvPVX(PL_linestr);
PL_bufend = PL_bufptr + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
PL_rsfp = 0;
}
/* try to recharge the buffer */
if ((s = filter_gets(PL_linestr, PL_rsfp,
- (prevlen = SvCUR(PL_linestr)))) == Nullch)
+ (prevlen = SvCUR(PL_linestr)))) == NULL)
{
/* end of file. Add on the -p or -n magic */
if (PL_minus_p) {
PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = s = PL_linestart
= SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
/* Close the filehandle. Could be from -P preprocessor,
* STDIN, or a regular file. If we were reading code from
PL_bufend = PL_bufptr = PL_oldbufptr = PL_oldoldbufptr = PL_linestart
= SvPVX(PL_linestr);
PL_bufend += SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
SAVEFREESV(PL_linestr);
PL_lex_dojoin = FALSE;
PL_lex_inpat = 0;
PL_bufend = PL_bufptr = PL_oldbufptr = PL_oldoldbufptr = PL_linestart = SvPVX(PL_linestr);
PL_bufend += SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
SAVEFREESV(PL_linestr);
PL_lex_dojoin = FALSE;
PL_lex_brackets = 0;
goto NUM_ESCAPE_INSERT;
}
res = newSVpvn(s + 1, e - s - 1);
- res = new_constant( Nullch, 0, "charnames",
+ res = new_constant( NULL, 0, "charnames",
res, Nullsv, "\\N{...}" );
if (has_utf8)
sv_utf8_upgrade(res);
if (FILTER_READ(0, sv, 0) > 0)
return ( SvPVX(sv) ) ;
else
- return Nullch ;
+ return NULL ;
}
else
return (sv_gets(sv, fp, append));
sv_catpvs(PL_linestr, "\n");
PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
if (PERLDB_LINE && PL_curstash != PL_debstash) {
SV * const sv = newSV(0);
}
do {
bof = PL_rsfp ? TRUE : FALSE;
- if ((s = filter_gets(PL_linestr, PL_rsfp, 0)) == Nullch) {
+ if ((s = filter_gets(PL_linestr, PL_rsfp, 0)) == NULL) {
fake_eof:
if (PL_rsfp) {
if (PL_preprocess && !PL_in_eval)
? ";}continue{print;}" : ";}");
PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
PL_minus_n = PL_minus_p = 0;
goto retry;
}
PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
sv_setpvn(PL_linestr,"",0);
TOKEN(';'); /* not infinite loop because rsfp is NULL now */
}
sv_setpvn(PL_linestr, "", 0);
PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
PL_doextract = FALSE;
}
}
av_store(CopFILEAVx(PL_curcop),(I32)CopLINE(PL_curcop),sv);
}
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
if (CopLINE(PL_curcop) == 1) {
while (s < PL_bufend && isSPACE(*s))
s++;
if (*s == ':' && s[1] != ':') /* for csh execing sh scripts */
s++;
- d = Nullch;
+ d = NULL;
if (!PL_in_eval) {
if (*s == '#' && *(s+1) == '!')
d = s + 2;
}
}
if (d < ipath)
- d = Nullch;
+ d = NULL;
}
#endif
}
while (*c && !strchr("; \t\r\n\f\v#", *c))
c++;
if (c < d)
- d = Nullch; /* "perl" not in first word; ignore */
+ d = NULL; /* "perl" not in first word; ignore */
else
*s = '#'; /* Don't try to parse shebang line */
}
sv_setpvn(PL_linestr, "", 0);
PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
PL_preambled = FALSE;
if (PERLDB_LINE)
(void)gv_fetchfile(PL_origfilename);
sv_setsv(PL_linestr,herewas);
PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = s = PL_linestart = SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
}
else
sv_setpvn(tmpstr,"",0); /* avoid "uninitialized" warning */
}
CopLINE_inc(PL_curcop);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
#ifndef PERL_STRICT_CR
if (PL_bufend - PL_linestart >= 2) {
if ((PL_bufend[-2] == '\r' && PL_bufend[-1] == '\n') ||
!(PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = filter_gets(PL_linestr, PL_rsfp, 0))) {
sv_free(sv);
CopLINE_set(PL_curcop, (line_t)PL_multi_start);
- return Nullch;
+ return NULL;
}
/* we read a line, so increment our line counter */
CopLINE_inc(PL_curcop);
/* having changed the buffer, we must update PL_bufend */
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
}
/* at this point, we have successfully read the delimited string */
s = filter_gets(PL_linestr, PL_rsfp, 0);
PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = SvPVX(PL_linestr);
PL_bufend = PL_bufptr + SvCUR(PL_linestr);
- PL_last_lop = PL_last_uni = Nullch;
+ PL_last_lop = PL_last_uni = NULL;
if (!s) {
s = PL_bufptr;
break;
ptr = (Malloc_t)PerlMem_malloc(size?size:1); /* malloc(0) is NASTY on our system */
PERL_ALLOC_CHECK(ptr);
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) malloc %ld bytes\n",PTR2UV(ptr),(long)PL_an++,(long)size));
- if (ptr != Nullch) {
+ if (ptr != NULL) {
#ifdef PERL_TRACK_MEMPOOL
((struct perl_memory_debug_header *)ptr)->interpreter = aTHX;
# ifdef PERL_POISON
return ptr;
}
else if (PL_nomemok)
- return Nullch;
+ return NULL;
else {
return write_no_mem();
}
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) rfree\n",PTR2UV(where),(long)PL_an++));
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) realloc %ld bytes\n",PTR2UV(ptr),(long)PL_an++,(long)size));
- if (ptr != Nullch) {
+ if (ptr != NULL) {
#ifdef PERL_TRACK_MEMPOOL
ptr = (Malloc_t)((char*)ptr+sTHX);
#endif
return ptr;
}
else if (PL_nomemok)
- return Nullch;
+ return NULL;
else {
return write_no_mem();
}
ptr = (Malloc_t)PerlMem_malloc(size?size:1); /* malloc(0) is NASTY on our system */
PERL_ALLOC_CHECK(ptr);
DEBUG_m(PerlIO_printf(Perl_debug_log, "0x%"UVxf": (%05ld) calloc %ld x %ld bytes\n",PTR2UV(ptr),(long)PL_an++,(long)count,(long)size));
- if (ptr != Nullch) {
+ if (ptr != NULL) {
memset((void*)ptr, 0, size);
#ifdef PERL_TRACK_MEMPOOL
((struct perl_memory_debug_header *)ptr)->interpreter = aTHX;
return ptr;
}
else if (PL_nomemok)
- return Nullch;
+ return NULL;
return write_no_mem();
}
continue;
for (x=big,s=little; *s; /**/ ) {
if (!*x)
- return Nullch;
+ return NULL;
if (*s != *x)
break;
else {
if (!*s)
return (char*)(big-1);
}
- return Nullch;
+ return NULL;
}
/* same as instr but allow embedded nulls */
return (char*)(big-1);
}
}
- return Nullch;
+ return NULL;
}
/* reverse of the above--find last substring */
if (s >= littleend)
return (char*)(big+1);
}
- return Nullch;
+ return NULL;
}
#define FBM_TABLE_OFFSET 2 /* Number of bytes between EOS and table*/
s--, i++;
}
}
- sv_magic(sv, Nullsv, PERL_MAGIC_bm, Nullch, 0); /* deep magic */
+ sv_magic(sv, Nullsv, PERL_MAGIC_bm, NULL, 0); /* deep magic */
SvVALID_on(sv);
s = (const unsigned char*)(SvPVX_const(sv)); /* deeper magic */
=for apidoc fbm_instr
Returns the location of the SV in the string delimited by C<str> and
-C<strend>. It returns C<Nullch> if the string can't be found. The C<sv>
+C<strend>. It returns C<NULL> if the string can't be found. The C<sv>
does not have to be fbm_compiled, but the search will not be as fast
then.
|| (*big == *little &&
memEQ((char *)big, (char *)little, littlelen - 1))))
return (char*)big;
- return Nullch;
+ return NULL;
}
if (littlelen <= 2) { /* Special-cased */
}
if (SvTAIL(littlestr))
return (char *) bigend;
- return Nullch;
+ return NULL;
}
if (!littlelen)
return (char*)big; /* Cannot be SvTAIL! */
return (char*)bigend - 2;
if (bigend[-1] == *little)
return (char*)bigend - 1;
- return Nullch;
+ return NULL;
}
{
/* This should be better than FBM if c1 == c2, and almost
check_1char_anchor: /* One char and anchor! */
if (SvTAIL(littlestr) && (*bigend == *little))
return (char *)bigend; /* bigend is already decremented. */
- return Nullch;
+ return NULL;
}
if (SvTAIL(littlestr) && !multiline) { /* tail anchored? */
s = bigend - littlelen;
{
return (char*)s + 1; /* how sweet it is */
}
- return Nullch;
+ return NULL;
}
if (SvTYPE(littlestr) != SVt_PVBM || !SvVALID(littlestr)) {
char * const b = ninstr((char*)big,(char*)bigend,
{
return (char*)s;
}
- return Nullch;
+ return NULL;
}
return b;
}
register const unsigned char *oldlittle;
if (littlelen > (STRLEN)(bigend - big))
- return Nullch;
+ return NULL;
--littlelen; /* Last char found by table lookup */
s = big + littlelen;
&& memEQ((char *)(bigend - littlelen),
(char *)(oldlittle - littlelen), littlelen) )
return (char*)bigend - littlelen;
- return Nullch;
+ return NULL;
}
}
first = *little++;
goto check_tail;
}
- return Nullch;
+ return NULL;
}
little = (const unsigned char *)(SvPVX_const(littlestr));
if (previous + start_shift == stop_pos + 1) /* A fake '\n'? */
goto check_tail;
#endif
- return Nullch;
+ return NULL;
}
while (pos < previous + start_shift) {
if (!(pos += PL_screamnext[pos]))
return (char *)(big+(*old_posp));
check_tail:
if (!SvTAIL(littlestr) || (end_shift > 0))
- return Nullch;
+ return NULL;
/* Ignore the trailing "\n". This code is not microoptimized */
big = (const unsigned char *)(SvPVX_const(bigstr) + SvCUR(bigstr));
stop_pos = littleend - little; /* Actual littlestr len */
&& ((stop_pos == 1) ||
memEQ((char *)(big + 1), (char *)little, stop_pos - 1)))
return (char*)big;
- return Nullch;
+ return NULL;
}
I32
Perl_savepv(pTHX_ const char *pv)
{
if (!pv)
- return Nullch;
+ return NULL;
else {
char *newaddr;
const STRLEN pvlen = strlen(pv)+1;
register char *newaddr;
STRLEN pvlen;
if (!pv)
- return Nullch;
+ return NULL;
pvlen = strlen(pv)+1;
newaddr = (char*)PerlMemShared_malloc(pvlen);
*utf8 = SvUTF8(msv);
}
else {
- message = Nullch;
+ message = NULL;
}
DEBUG_S(PerlIO_printf(Perl_debug_log,
sidestepping the normal C order of execution. See C<warn>.
If you want to throw an exception object, assign the object to
-C<$@> and then pass C<Nullch> to croak():
+C<$@> and then pass C<NULL> to croak():
errsv = get_sv("@", TRUE);
sv_setsv(errsv, exception_object);
- croak(Nullch);
+ croak(NULL);
=cut
*/
tmpenv[j] = (char*)safesysmalloc((len+1)*sizeof(char));
Copy(environ[j], tmpenv[j], len+1, char);
}
- tmpenv[max] = Nullch;
+ tmpenv[max] = NULL;
environ = tmpenv; /* tell exec where it is now */
}
if (!val) {
}
if (!environ[i]) { /* does not exist yet */
environ = (char**)safesysrealloc(environ, (i+2) * sizeof(char*));
- environ[i+1] = Nullch; /* make sure it's null terminated */
+ environ[i+1] = NULL; /* make sure it's null terminated */
}
else
safesysfree(environ[i]);
const char *const *const search_ext, I32 flags)
{
dVAR;
- const char *xfound = Nullch;
- char *xfailed = Nullch;
+ const char *xfound = NULL;
+ char *xfailed = NULL;
char tmpbuf[MAXPATHLEN];
register char *s;
I32 len = 0;
static const char *const exts[] = { SEARCH_EXTS };
const char *const *const ext = search_ext ? search_ext : exts;
int extidx = 0, i = 0;
- const char *curext = Nullch;
+ const char *curext = NULL;
#else
PERL_UNUSED_ARG(search_ext);
# define MAX_EXT_LEN 0
int idx = 0, deftypes = 1;
bool seen_dot = 1;
- const int hasdir = !dosearch || (strpbrk(scriptname,":[</") != Nullch);
+ const int hasdir = !dosearch || (strpbrk(scriptname,":[</") != NULL);
# else
if (dosearch) {
int idx = 0, deftypes = 1;
bool seen_dot = 1;
- const int hasdir = (strpbrk(scriptname,":[</") != Nullch);
+ const int hasdir = (strpbrk(scriptname,":[</") != NULL);
# endif
/* The first time through, just add SEARCH_EXTS to whatever we
* already have, so we can check for default file types. */
(xfailed ? "" : " on PATH"),
(xfailed || seen_dot) ? "" : ", '.' not in PATH");
}
- scriptname = Nullch;
+ scriptname = NULL;
}
Safefree(xfailed);
scriptname = xfound;
}
- return (scriptname ? savepv(scriptname) : Nullch);
+ return (scriptname ? savepv(scriptname) : NULL);
}
#ifndef PERL_GET_CONTEXT_DEFINED