summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-07-05 00:12:02 -0300
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:00:56 -0700
commitf246260499cb1d0203cb449bbdf048074a0126a9 (patch)
treeac6ba55aeac14f0090a5bc0067749bb03453abe9 /hv.h
parentda83cd31bebb3ad6dd8af3d05f0c93caf37a2187 (diff)
downloadperl-f246260499cb1d0203cb449bbdf048074a0126a9.tar.gz
UTF-8 related macros in hv.h and gv.h
Groundwork for the following commits.
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/hv.h b/hv.h
index 358c8d8f29..f97f159ee6 100644
--- a/hv.h
+++ b/hv.h
@@ -258,7 +258,11 @@ C<SV*>.
#define HvRITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_riter : -1)
#define HvEITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_eiter : NULL)
#define HvNAME(hv) HvNAME_get(hv)
+#define HvNAMELEN(hv) HvNAMELEN_get(hv)
+#define HvNAMEUTF8(hv) HvNAMEUTF8_get(hv)
#define HvENAME(hv) HvENAME_get(hv)
+#define HvENAMELEN(hv) HvENAMELEN_get(hv)
+#define HvENAMEUTF8(hv) HvENAMEUTF8_get(hv)
/* Checking that hv is a valid package stash is the
caller's responsibility */
@@ -283,6 +287,9 @@ C<SV*>.
#define HvNAMELEN_get(hv) \
((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvNAME_HEK_NN(hv)) \
? HEK_LEN(HvNAME_HEK_NN(hv)) : 0)
+#define HvNAMEUTF8_get(hv) \
+ ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvNAME_HEK_NN(hv)) \
+ ? HEK_UTF8(HvNAME_HEK_NN(hv)) : 0)
#define HvENAME_HEK_NN(hv) \
( \
HvAUX(hv)->xhv_name_count > 0 ? HvAUX(hv)->xhv_name_u.xhvnameu_names[0] : \
@@ -298,6 +305,9 @@ C<SV*>.
#define HvENAMELEN_get(hv) \
((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvENAME_HEK_NN(hv)) \
? HEK_LEN(HvENAME_HEK_NN(hv)) : 0)
+#define HvENAMEUTF8_get(hv) \
+ ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvENAME_HEK_NN(hv)) \
+ ? HEK_UTF8(HvENAME_HEK_NN(hv)) : 0)
/* the number of keys (including any placeholders) */
#define XHvTOTALKEYS(xhv) ((xhv)->xhv_keys)