From 44d223002dcef65c7a5da4557c2a3682159e12ab Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 8 Jun 2005 22:43:58 +0000 Subject: [PATCH] Add SvPV_mutable for use by the old COW code. p4raw-id: //depot/perl@24767 --- sv.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sv.h b/sv.h index 13ac3b1..a22fb8d 100644 --- a/sv.h +++ b/sv.h @@ -1199,6 +1199,7 @@ Like C 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 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) -- 2.7.4