summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-07-15 22:01:52 -0600
committerKarl Williamson <public@khwilliamson.com>2012-07-19 09:39:06 -0600
commitafb790dd4ff01f57e25399cc548ef7f9609a1ad2 (patch)
treeb1f089df75cf221a9e9b045d879755b8046b7842 /utf8.c
parent8b27d3db700fc2fce268e3d78e221a16ccaca2e8 (diff)
downloadperl-afb790dd4ff01f57e25399cc548ef7f9609a1ad2.tar.gz
utf8.c: Create API so internals can be hidden
This creates a function to hide some of the internal details of swashes from the regex engine, which is the only authorized user, enforced through #ifdefs in embed.fnc. These work closely together, but it's best to have a clean interface.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/utf8.c b/utf8.c
index 2592728e6b..5797f8e010 100644
--- a/utf8.c
+++ b/utf8.c
@@ -4090,6 +4090,19 @@ Perl__swash_to_invlist(pTHX_ SV* const swash)
return invlist;
}
+bool
+Perl__is_swash_user_defined(pTHX_ SV* const swash)
+{
+ SV** ptr = hv_fetchs(MUTABLE_HV(SvRV(swash)), "USER_DEFINED", FALSE);
+
+ PERL_ARGS_ASSERT__IS_SWASH_USER_DEFINED;
+
+ if (! ptr) {
+ return FALSE;
+ }
+ return cBOOL(SvUV(*ptr));
+}
+
/*
=for apidoc uvchr_to_utf8