summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-05-03 10:12:00 -0600
committerJesse Vincent <jesse@bestpractical.com>2011-05-03 17:14:06 -0400
commit36bb2ab64fa2ef022d7870082c0dcc6db902c86e (patch)
treebfee85e71c3f52ac7076a8148880d5a3a62d693c /utf8.c
parent7bee57f6d73fe07d73dd9b4a538e4ffd60c7eed8 (diff)
downloadperl-36bb2ab64fa2ef022d7870082c0dcc6db902c86e.tar.gz
utf8.c: Add _flags version of to_utf8_fold()
And also to_uni_fold(). The flag allows retrieving either simple or full folds. The interface is subject to change, so these are marked experimental and their names begin with underscore. The old versions are turned into macros calling the new versions with the correct extra parameter.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/utf8.c b/utf8.c
index 9c2061ddae..11c2fa40bd 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1341,12 +1341,12 @@ Perl_to_uni_lower(pTHX_ UV c, U8* p, STRLEN *lenp)
}
UV
-Perl_to_uni_fold(pTHX_ UV c, U8* p, STRLEN *lenp)
+Perl__to_uni_fold_flags(pTHX_ UV c, U8* p, STRLEN *lenp, U8 flags)
{
- PERL_ARGS_ASSERT_TO_UNI_FOLD;
+ PERL_ARGS_ASSERT__TO_UNI_FOLD_FLAGS;
uvchr_to_utf8(p, c);
- return to_utf8_fold(p, p, lenp);
+ return _to_utf8_fold_flags(p, p, lenp, flags);
}
/* for now these all assume no locale info available for Unicode > 255 */
@@ -1799,7 +1799,7 @@ of the result.
The "swashp" is a pointer to the swash to use.
-Both the special and normal mappings are stored lib/unicore/To/Foo.pl,
+Both the special and normal mappings are stored in lib/unicore/To/Foo.pl,
and loaded by SWASHNEW, using lib/utf8_heavy.pl. The special (usually,
but not always, a multicharacter mapping), is tried first.
@@ -2026,15 +2026,20 @@ The first character of the foldcased version is returned
=cut */
+/* Not currently externally documented is 'flags', which currently is non-zero
+ * if full case folds are to be used; otherwise simple folds */
+
UV
-Perl_to_utf8_fold(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp)
+Perl__to_utf8_fold_flags(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, U8 flags)
{
+ const char *specials = (flags) ? "utf8::ToSpecFold" : NULL;
+
dVAR;
- PERL_ARGS_ASSERT_TO_UTF8_FOLD;
+ PERL_ARGS_ASSERT__TO_UTF8_FOLD_FLAGS;
return Perl_to_utf8_case(aTHX_ p, ustrp, lenp,
- &PL_utf8_tofold, "ToFold", "utf8::ToSpecFold");
+ &PL_utf8_tofold, "ToFold", specials);
}
/* Note: