This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
flip release & version in win32_uname()
[perl5.git] / sv.h
diff --git a/sv.h b/sv.h
index 3dac548..fb89907 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -1,6 +1,6 @@
 /*    sv.h
  *
- *    Copyright (c) 1991-1997, Larry Wall
+ *    Copyright (c) 1991-1999, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -147,11 +147,7 @@ struct io {
 #define SVf_OK         (SVf_IOK|SVf_NOK|SVf_POK|SVf_ROK| \
                         SVp_IOK|SVp_NOK|SVp_POK)
 
-#ifdef OVERLOAD
-#define SVf_AMAGIC    0x10000000      /* has magical overloaded methods */
-#else
-#define SVf_AMAGIC    0               /* can be or-ed without effect */
-#endif /* OVERLOAD */
+#define SVf_AMAGIC     0x10000000      /* has magical overloaded methods */
 
 #define PRIVSHIFT 8
 
@@ -316,7 +312,8 @@ struct xpvio {
 #define IOf_START 2    /* check for null ARGV and substitute '-' */
 #define IOf_FLUSH 4    /* this fp wants a flush after write op */
 #define IOf_DIDTOP 8   /* just did top of form */
-#define IOf_UNTAINT 16  /* consider this fp (and it's data) "safe" */
+#define IOf_UNTAINT 16  /* consider this fp (and its data) "safe" */
+#define IOf_NOLINE  32 /* slurped a pseudo-line from empty file */
 
 /* The following macros define implementation-independent predicates on SVs. */
 
@@ -384,10 +381,9 @@ struct xpvio {
 #define SvRMAGICAL_on(sv)      (SvFLAGS(sv) |= SVs_RMG)
 #define SvRMAGICAL_off(sv)     (SvFLAGS(sv) &= ~SVs_RMG)
 
-#ifdef OVERLOAD
-#define SvAMAGIC(sv)         (SvFLAGS(sv) & SVf_AMAGIC)
-#define SvAMAGIC_on(sv)      (SvFLAGS(sv) |= SVf_AMAGIC)
-#define SvAMAGIC_off(sv)     (SvFLAGS(sv) &= ~SVf_AMAGIC)
+#define SvAMAGIC(sv)           (SvFLAGS(sv) & SVf_AMAGIC)
+#define SvAMAGIC_on(sv)                (SvFLAGS(sv) |= SVf_AMAGIC)
+#define SvAMAGIC_off(sv)       (SvFLAGS(sv) &= ~SVf_AMAGIC)
 
 /*
 #define Gv_AMG(stash) \
@@ -395,7 +391,6 @@ struct xpvio {
          ((!HV_AMAGICbad(stash) && HV_AMAGIC(stash)) || Gv_AMupdate(stash)))
 */
 #define Gv_AMG(stash)           (PL_amagic_generation && Gv_AMupdate(stash))
-#endif /* OVERLOAD */
 
 #define SvTHINKFIRST(sv)       (SvFLAGS(sv) & SVf_THINKFIRST)
 
@@ -517,6 +512,7 @@ struct xpvio {
 
 #define SvPV_force(sv, lp) sv_pvn_force(sv, &lp)
 #define SvPV(sv, lp) sv_pvn(sv, &lp)
+#define SvPV_nolen(sv) sv_pv(sv)
 #define SvIVx(sv) sv_iv(sv)
 #define SvUVx(sv) sv_uv(sv)
 #define SvNVx(sv) sv_nv(sv)
@@ -550,6 +546,10 @@ struct xpvio {
     ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
      ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force(sv, &lp))
 
+#undef SvPV_nolen
+#define SvPV_nolen(sv) \
+    (SvPOK(sv) ? SvPVX(sv) : sv_2pv_nolen(sv))
+
 #ifdef __GNUC__
 #  undef SvIVx
 #  undef SvUVx
@@ -650,7 +650,11 @@ struct xpvio {
 #define SvSetMagicSV_nosteal(dst,src) \
                SvSetSV_nosteal_and(dst,src,SvSETMAGIC(dst))
 
+#ifdef DEBUGGING
 #define SvPEEK(sv) sv_peek(sv)
+#else
+#define SvPEEK(sv) ""
+#endif
 
 #define SvIMMORTAL(sv) ((sv)==&PL_sv_undef || (sv)==&PL_sv_yes || (sv)==&PL_sv_no)