/*
-=for apidoc Am|STRLEN|isUTF8_CHAR|const U8 *s|const U8 *e
+=for apidoc isUTF8_CHAR
Evaluates to non-zero if the first few bytes of the string starting at C<s> and
looking no further than S<C<e - 1>> are well-formed UTF-8, as extended by Perl,
/*
-=for apidoc Am|STRLEN|isC9_STRICT_UTF8_CHAR|const U8 *s|const U8 *e
+=for apidoc isC9_STRICT_UTF8_CHAR
Evaluates to non-zero if the first few bytes of the string starting at C<s> and
looking no further than S<C<e - 1>> are well-formed UTF-8 that represents some
return _utf8n_to_uvchr_msgs_helper(s0, curlen, retlen, flags, errors, msgs);
}
+PERL_STATIC_INLINE UV
+S__utf8_to_uvchr_buf(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen)
+{
+ PERL_ARGS_ASSERT__UTF8_TO_UVCHR_BUF;
+
+ assert(s < send);
+
+ if (! ckWARN_d(WARN_UTF8)) {
+ return utf8n_to_uvchr(s, send - s, retlen,
+ (UTF8_ALLOW_ANY & ~UTF8_ALLOW_EMPTY));
+ }
+ else {
+ UV ret = utf8n_to_uvchr(s, send - s, retlen, 0);
+ if (retlen && ret == 0 && *s != '\0') {
+ *retlen = (STRLEN) -1;
+ }
+
+ return ret;
+ }
+}
+
/* ------------------------------- perl.h ----------------------------- */
/*
=head1 Miscellaneous Functions
-=for apidoc AiR|bool|is_safe_syscall|const char *pv|STRLEN len|const char *what|const char *op_name
+=for apidoc is_safe_syscall
Test that the given C<pv> doesn't contain any internal C<NUL> characters.
If it does, set C<errno> to C<ENOENT>, optionally warn, and return FALSE.