summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-08-26 13:35:28 -0600
committerKarl Williamson <khw@cpan.org>2016-08-31 20:32:35 -0600
commit8871a094916837597c6a703c2e1b2306314df4fa (patch)
tree4cb3c73457238950fee9f8472683b570934bd763 /utf8.c
parente950ecba8e797ce46fe4f568b0f08811002f3d95 (diff)
downloadperl-8871a094916837597c6a703c2e1b2306314df4fa.tar.gz
Add new synonym 'is_utf8_invariant_string'
This is clearer as to its meaning than the existing 'is_ascii_string' and 'is_invariant_string', which are retained for back compat. The thread context variable is removed as it is not used.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/utf8.c b/utf8.c
index dd0fe65994..b3c4c0083a 100644
--- a/utf8.c
+++ b/utf8.c
@@ -52,7 +52,7 @@ within non-zero characters.
*/
/*
-=for apidoc is_invariant_string
+=for apidoc is_utf8_invariant_string
Returns true iff the first C<len> bytes of the string C<s> are the same
regardless of the UTF-8 encoding of the string (or UTF-EBCDIC encoding on
@@ -66,18 +66,19 @@ If C<len> is 0, it will be calculated using C<strlen(s)>, (which means if you
use this option, that C<s> can't have embedded C<NUL> characters and has to
have a terminating C<NUL> byte).
-See also L</is_utf8_string>(), L</is_utf8_string_loclen>(), and L</is_utf8_string_loc>().
+See also L</is_utf8_string>(), L</is_utf8_string_loclen>(), and
+L</is_utf8_string_loc>().
=cut
*/
bool
-Perl_is_invariant_string(const U8 *s, STRLEN len)
+Perl_is_utf8_invariant_string(const U8 *s, STRLEN len)
{
const U8* const send = s + (len ? len : strlen((const char *)s));
const U8* x = s;
- PERL_ARGS_ASSERT_IS_INVARIANT_STRING;
+ PERL_ARGS_ASSERT_IS_UTF8_INVARIANT_STRING;
for (; x < send; ++x) {
if (!UTF8_IS_INVARIANT(*x))
@@ -380,7 +381,8 @@ using C<strlen(s)> (which means if you use this option, that C<s> can't have
embedded C<NUL> characters and has to have a terminating C<NUL> byte). Note
that all characters being ASCII constitute 'a valid UTF-8 string'.
-See also L</is_invariant_string>(), L</is_utf8_string_loclen>(), and L</is_utf8_string_loc>().
+See also L</is_utf8_invariant_string>(), L</is_utf8_string_loclen>(), and
+L</is_utf8_string_loc>().
=cut
*/