summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2010-10-25 22:59:59 +1100
committerTony Cook <tony@develop-help.com>2010-10-25 22:59:59 +1100
commit71eb6d8cfb246d23c05d58a2404b8e67ca3e8968 (patch)
tree72f5fe95710d56f4d0e95c6222f027d63f1519e2 /sv.h
parent209e41dc03667de597dae6674b5df755c0795132 (diff)
downloadperl-71eb6d8cfb246d23c05d58a2404b8e67ca3e8968.tar.gz
rt #72398 - get magic before downgrading in SvPVbyte()
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index 3be9559242..92f5edd74a 100644
--- a/sv.h
+++ b/sv.h
@@ -1421,6 +1421,9 @@ Returns a pointer to the string in the SV, or a stringified form of
the SV if the SV does not contain a string. The SV may cache the
stringified form becoming C<SvPOK>. Handles 'get' magic.
+=for apidoc Am|char*|SvPV_nomg_nolen|SV* sv
+Like C<SvPV_nolen> but doesn't process magic.
+
=for apidoc Am|IV|SvIV|SV* sv
Coerces the given SV to an integer and returns it. See C<SvIVx> for a
version which guarantees to evaluate sv only once.
@@ -1586,6 +1589,10 @@ Like sv_utf8_upgrade, but doesn't do magic on C<sv>
((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
? SvPVX(sv) : sv_2pv_flags(sv, 0, SV_GMAGIC))
+#define SvPV_nomg_nolen(sv) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? SvPVX(sv) : sv_2pv_flags(sv, 0, 0))
+
#define SvPV_nolen_const(sv) \
((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
? SvPVX_const(sv) : sv_2pv_flags(sv, 0, SV_GMAGIC|SV_CONST_RETURN))