diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-06-08 22:43:58 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-06-08 22:43:58 +0000 |
commit | 44d223002dcef65c7a5da4557c2a3682159e12ab (patch) | |
tree | 6c9496535eda6b6a789d8453852f79d4952f2544 /sv.h | |
parent | 78d1e7216828c407764c451df38627050a590fe2 (diff) | |
download | perl-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.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) |