summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-05-17 20:54:23 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-05-17 20:54:23 +0000
commitb0a11fe104a0ad4cbfcb5d90e8c0fbdfd46e46ac (patch)
tree2cbeabf127fee1719e3bf8cf2e33d9f3c034ed05 /sv.h
parente3749539d04912af50a86b1d1e5ae9962c3a882c (diff)
downloadperl-b0a11fe104a0ad4cbfcb5d90e8c0fbdfd46e46ac.tar.gz
Add a new macro SvVSTRING_mg that returns vstring magic, if any.
SvVOK used to do that, in stealth mode, but now it returns a boolean like it used to. Patch suggested by John Peacock. p4raw-id: //depot/perl@28218
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index 92a8e7fa26..554fe69ea3 100644
--- a/sv.h
+++ b/sv.h
@@ -949,7 +949,11 @@ in gv.h: */
SvFLAGS(sv) |= (SVf_POK|SVp_POK))
#define SvVOK(sv) (SvMAGICAL(sv) \
+ && mg_find(sv,PERL_MAGIC_vstring))
+/* returns the vstring magic, if any */
+#define SvVSTRING_mg(sv) (SvMAGICAL(sv) \
? mg_find(sv,PERL_MAGIC_vstring) : NULL)
+
#define SvOOK(sv) (SvFLAGS(sv) & SVf_OOK)
#define SvOOK_on(sv) ((void)SvIOK_off(sv), SvFLAGS(sv) |= SVf_OOK)
#define SvOOK_off(sv) ((void)(SvOOK(sv) && sv_backoff(sv)))