summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-08 22:43:58 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-08 22:43:58 +0000
commit44d223002dcef65c7a5da4557c2a3682159e12ab (patch)
tree6c9496535eda6b6a789d8453852f79d4952f2544 /sv.h
parent78d1e7216828c407764c451df38627050a590fe2 (diff)
downloadperl-44d223002dcef65c7a5da4557c2a3682159e12ab.tar.gz
Add SvPV_mutable for use by the old COW code.
p4raw-id: //depot/perl@24767
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index 13ac3b1967..a22fb8deff 100644
--- a/sv.h
+++ b/sv.h
@@ -1199,6 +1199,7 @@ Like C<sv_catsv> but doesn't process magic.
#define SvPV(sv, lp) SvPV_flags(sv, lp, SV_GMAGIC)
#define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
+#define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
#define SvPV_flags(sv, lp, flags) \
((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
@@ -1207,6 +1208,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_mutable(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
+ sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
#define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
#define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)