Integrate with Sarathy.
[p5sagit/p5-mst-13.2.git] / sv.h
diff --git a/sv.h b/sv.h
index 20253be..eea984a 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -156,6 +156,7 @@ struct io {
 
 /* Some private flags. */
 
+/* SVpad_OUR may be set on SVt_PV{NV,MG,GV} types */
 #define SVpad_OUR      0x80000000      /* pad name is "our" instead of "my" */
 
 #define SVf_IVisUV     0x80000000      /* use XPVUV instead of XPVIV */
@@ -260,7 +261,7 @@ struct xpvbm {
     U8         xbm_rare;       /* rarest character in string */
 };
 
-/* This structure much match XPVCV */
+/* This structure much match XPVCV in cv.h */
 
 typedef U16 cv_flags_t;
 
@@ -279,8 +280,8 @@ struct xpvfm {
     void      (*xcv_xsub)(pTHXo_ CV*);
     ANY                xcv_xsubany;
     GV *       xcv_gv;
-    GV *       xcv_filegv;
-    long       xcv_depth;              /* >= 2 indicates recursive call */
+    char *     xcv_file;
+    long       xcv_depth;      /* >= 2 indicates recursive call */
     AV *       xcv_padlist;
     CV *       xcv_outside;
 #ifdef USE_THREADS
@@ -319,12 +320,13 @@ struct xpvio {
     char       xio_flags;
 };
 
-#define IOf_ARGV 1     /* this fp iterates over ARGV */
-#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 its data) "safe" */
-#define IOf_NOLINE  32 /* slurped a pseudo-line from empty file */
+#define IOf_ARGV       1       /* this fp iterates over ARGV */
+#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 its data) "safe" */
+#define IOf_NOLINE     32      /* slurped a pseudo-line from empty file */
+#define IOf_FAKE_DIRP  64      /* xio_dirp is fake (source filters kludge) */
 
 /* The following macros define implementation-independent predicates on SVs. */
 
@@ -372,9 +374,9 @@ struct xpvio {
 #define SvNOK_only(sv)         (SvOK_off(sv), \
                                    SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
 
-#define SvUTF8(sv)             (SvFLAGS(sv) & SVf_ISUTF8)
-#define SvUTF8_on(sv)          (SvFLAGS(sv) |= (SVf_ISUTF8))
-#define SvUTF8_off(sv)         (SvFLAGS(sv) &= ~(SVf_ISUTF8))
+#define SvUTF8(sv)             (SvFLAGS(sv) & SVf_UTF8)
+#define SvUTF8_on(sv)          (SvFLAGS(sv) |= (SVf_UTF8))
+#define SvUTF8_off(sv)         (SvFLAGS(sv) &= ~(SVf_UTF8))
 
 #define SvPOK(sv)              (SvFLAGS(sv) & SVf_POK)
 #define SvPOK_on(sv)           (SvFLAGS(sv) |= (SVf_POK|SVp_POK))
@@ -674,8 +676,7 @@ struct xpvio {
     :    SvPOK(sv)                                             \
        ?   (({XPV *nxpv = (XPV*)SvANY(sv);                     \
             nxpv &&                                            \
-            (*nxpv->xpv_pv > '0' ||                            \
-             nxpv->xpv_cur > 1 ||                              \
+            (nxpv->xpv_cur > 1 ||                              \
              (nxpv->xpv_cur && *nxpv->xpv_pv != '0')); })      \
             ? 1                                                \
             : 0)                                               \
@@ -704,14 +705,13 @@ struct xpvio {
 #  define SvNVx(sv) ((PL_Sv = (sv)), SvNV(PL_Sv))
 #  define SvPVx(sv, lp) ((PL_Sv = (sv)), SvPV(PL_Sv, lp))
 #  define SvPVutf8x(sv, lp) ((PL_Sv = (sv)), SvPVutf8(PL_Sv, lp))
-#  define SvPVutf8x(sv, lp) ((PL_Sv = (sv)), SvPVbyte(PL_Sv, lp))
+#  define SvPVbytex(sv, lp) ((PL_Sv = (sv)), SvPVbyte(PL_Sv, lp))
 #  define SvTRUE(sv) (                                         \
     !sv                                                                \
     ? 0                                                                \
     :    SvPOK(sv)                                             \
        ?   ((PL_Xpv = (XPV*)SvANY(sv)) &&                      \
-            (*PL_Xpv->xpv_pv > '0' ||                          \
-             PL_Xpv->xpv_cur > 1 ||                            \
+            (PL_Xpv->xpv_cur > 1 ||                            \
              (PL_Xpv->xpv_cur && *PL_Xpv->xpv_pv != '0'))      \
             ? 1                                                \
             : 0)                                               \