Clarify the documentation regarding the return value from C<push>.
[p5sagit/p5-mst-13.2.git] / sv.h
diff --git a/sv.h b/sv.h
index c53de53..1e6c86a 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -858,8 +858,6 @@ in gv.h: */
 #  else
 #  define SvPVX(sv) SvPVX_mutable(sv)
 #  endif
-#  define SvPVX_mutable(sv)    (0 + (sv)->sv_u.svu_pv)
-#  define SvPVX_const(sv)      ((const char*)(0 + (sv)->sv_u.svu_pv))
 #  define SvCUR(sv) (0 + ((XPV*) SvANY(sv))->xpv_cur)
 #  define SvLEN(sv) (0 + ((XPV*) SvANY(sv))->xpv_len)
 #  define SvEND(sv) ((sv)->sv_u.svu_pv + ((XPV*)SvANY(sv))->xpv_cur)
@@ -885,8 +883,6 @@ in gv.h: */
 #  define SvUVX(sv) ((XPVUV*) SvANY(sv))->xuv_uv
 #  define SvNVX(sv) ((XPVNV*) SvANY(sv))->xnv_nv
 #  define SvPVX(sv) ((sv)->sv_u.svu_pv)
-#  define SvPVX_mutable(sv)    SvPVX(sv)
-#  define SvPVX_const(sv)      ((const char*)SvPVX(sv))
 #  define SvCUR(sv) ((XPV*) SvANY(sv))->xpv_cur
 #  define SvLEN(sv) ((XPV*) SvANY(sv))->xpv_len
 #  define SvEND(sv) ((sv)->sv_u.svu_pv + ((XPV*)SvANY(sv))->xpv_cur)
@@ -900,6 +896,11 @@ in gv.h: */
 #  endif
 #endif
 
+/* Given that these two are new, there can't be any existing code using them
+ *  as LVALUEs  */
+#define SvPVX_mutable(sv)      (0 + (sv)->sv_u.svu_pv)
+#define SvPVX_const(sv)                ((const char*)(0 + (sv)->sv_u.svu_pv))
+
 #define SvIVXx(sv) SvIVX(sv)
 #define SvUVXx(sv) SvUVX(sv)
 #define SvNVXx(sv) SvNVX(sv)
@@ -1187,6 +1188,10 @@ Like C<sv_catsv> but doesn't process magic.
     ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
      ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
      (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
+#define SvPV_flags_const_nolen(sv, flags) \
+    ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+     ? SvPVX_const(sv) : \
+     (const char*) sv_2pv_flags(sv, 0, flags|SV_CONST_RETURN))
 #define SvPV_flags_mutable(sv, lp, flags) \
     ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
      ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
@@ -1197,6 +1202,7 @@ Like C<sv_catsv> but doesn't process magic.
 #define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
 
 #define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
+#define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
 
 #define SvPV_force_flags(sv, lp, flags) \
     ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
@@ -1219,6 +1225,7 @@ Like C<sv_catsv> but doesn't process magic.
 
 #define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
 #define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
+#define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
 
 /* ----*/