From 37e7596b5cfb8d1be7030a330e12df2c13405f7a Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 4 Sep 2013 22:31:01 -0600 Subject: [PATCH] Move functions prematurely placed into mathoms back to utf8.c These functions are still called by some CPAN-upstream modules, so can't go into mathoms until those are fixed. There are other changes needed in these modules, so I'm deferring sending patching to their maintainers until I know all the necessary changes. --- mathoms.c | 54 ------------------------------------------------------ utf8.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 54 deletions(-) diff --git a/mathoms.c b/mathoms.c index e33d0c6..cfb0d5b 100644 --- a/mathoms.c +++ b/mathoms.c @@ -704,14 +704,6 @@ Perl_init_i18nl14n(pTHX_ int printwarn) return init_i18nl10n(printwarn); } -U8 * -Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv) -{ - PERL_ARGS_ASSERT_UVUNI_TO_UTF8; - - return Perl_uvoffuni_to_utf8_flags(aTHX_ d, uv, 0); -} - bool Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **ep) { @@ -1227,52 +1219,6 @@ ASCII_TO_NEED(const UV enc, const UV ch) return ch; } -/* -=for apidoc uvuni_to_utf8_flags - -Instead you almost certainly want to use L or -L>. - -This function is a deprecated synonym for L, -which itself, while not deprecated, should be used only in isolated -circumstances. These functions were useful for code that wanted to handle -both EBCDIC and ASCII platforms with Unicode properties, but starting in Perl -v5.20, the distinctions between the platforms have mostly been made invisible -to most code, so this function is quite unlikely to be what you want. - -=cut -*/ - -U8 * -Perl_uvuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags) -{ - PERL_ARGS_ASSERT_UVUNI_TO_UTF8_FLAGS; - - return uvoffuni_to_utf8_flags(d, uv, flags); -} - -/* -=for apidoc utf8n_to_uvuni - -Instead use L, or rarely, L. - -This function was usefulfor code that wanted to handle both EBCDIC and -ASCII platforms with Unicode properties, but starting in Perl v5.20, the -distinctions between the platforms have mostly been made invisible to most -code, so this function is quite unlikely to be what you want. -C> instead. - -=cut -*/ - -UV -Perl_utf8n_to_uvuni(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags) -{ - PERL_ARGS_ASSERT_UTF8N_TO_UVUNI; - - return NATIVE_TO_UNI(utf8n_to_uvchr(s, curlen, retlen, flags)); -} - END_EXTERN_C #endif /* NO_MATHOMS */ diff --git a/utf8.c b/utf8.c index 0bfb886..51b9822 100644 --- a/utf8.c +++ b/utf8.c @@ -4713,6 +4713,64 @@ Perl_foldEQ_utf8_flags(pTHX_ const char *s1, char **pe1, UV l1, bool u1, const c return 1; } +/* XXX The next four functions should likely be moved to mathoms.c once all + * occurrences of them are removed from the core; some cpan-upstream modules + * still use them */ + +U8 * +Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv) +{ + PERL_ARGS_ASSERT_UVUNI_TO_UTF8; + + return Perl_uvoffuni_to_utf8_flags(aTHX_ d, uv, 0); +} + +UV +Perl_utf8n_to_uvuni(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags) +{ + PERL_ARGS_ASSERT_UTF8N_TO_UVUNI; + + return NATIVE_TO_UNI(utf8n_to_uvchr(s, curlen, retlen, flags)); +} + +/* +=for apidoc uvuni_to_utf8_flags + +Instead you almost certainly want to use L or +L>. + +This function is a deprecated synonym for L, +which itself, while not deprecated, should be used only in isolated +circumstances. These functions were useful for code that wanted to handle +both EBCDIC and ASCII platforms with Unicode properties, but starting in Perl +v5.20, the distinctions between the platforms have mostly been made invisible +to most code, so this function is quite unlikely to be what you want. + +=cut +*/ + +U8 * +Perl_uvuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags) +{ + PERL_ARGS_ASSERT_UVUNI_TO_UTF8_FLAGS; + + return uvoffuni_to_utf8_flags(d, uv, flags); +} + +/* +=for apidoc utf8n_to_uvuni + +Instead use L, or rarely, L. + +This function was usefulfor code that wanted to handle both EBCDIC and +ASCII platforms with Unicode properties, but starting in Perl v5.20, the +distinctions between the platforms have mostly been made invisible to most +code, so this function is quite unlikely to be what you want. +C> instead. + +=cut +*/ + /* * Local variables: * c-indentation-style: bsd -- 2.7.4