PERL_CALLCONV int Perl_bytes_cmp_utf8(pTHX_ const U8 *b, STRLEN blen, const U8 *u, STRLEN ulen);
#define PERL_ARGS_ASSERT_BYTES_CMP_UTF8 \
assert(b); assert(u)
-PERL_CALLCONV U8* Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *len, bool *is_utf8);
+PERL_CALLCONV U8* Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *lenp, bool *is_utf8p);
#define PERL_ARGS_ASSERT_BYTES_FROM_UTF8 \
- assert(s); assert(len)
-PERL_CALLCONV U8* Perl_bytes_to_utf8(pTHX_ const U8 *s, STRLEN *len);
+ assert(s); assert(lenp); assert(is_utf8p)
+PERL_CALLCONV U8* Perl_bytes_from_utf8_loc(const U8 *s, STRLEN *lenp, bool *is_utf8p, const U8 ** first_unconverted);
+#define PERL_ARGS_ASSERT_BYTES_FROM_UTF8_LOC \
+ assert(s); assert(lenp); assert(is_utf8p)
+PERL_CALLCONV U8* Perl_bytes_to_utf8(pTHX_ const U8 *s, STRLEN *lenp);
#define PERL_ARGS_ASSERT_BYTES_TO_UTF8 \
- assert(s); assert(len)
+ assert(s); assert(lenp)
PERL_CALLCONV I32 Perl_call_argv(pTHX_ const char* sub_name, I32 flags, char** argv);
#define PERL_ARGS_ASSERT_CALL_ARGV \
assert(sub_name); assert(argv)
__attribute__warn_unused_result__;
PERL_CALLCONV bool Perl_do_seek(pTHX_ GV* gv, Off_t pos, int whence);
-PERL_CALLCONV void Perl_do_sprintf(pTHX_ SV* sv, I32 len, SV** sarg);
+PERL_CALLCONV void Perl_do_sprintf(pTHX_ SV* sv, SSize_t len, SV** sarg);
#define PERL_ARGS_ASSERT_DO_SPRINTF \
assert(sv); assert(sarg)
PERL_CALLCONV void Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim);
#define PERL_ARGS_ASSERT_IS_UTF8_IDFIRST \
assert(p)
+/* PERL_CALLCONV bool is_utf8_invariant_string(const U8* const s, STRLEN const len)
+ __attribute__warn_unused_result__; */
+
#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool S_is_utf8_invariant_string(const U8* const s, STRLEN const len)
+PERL_STATIC_INLINE bool S_is_utf8_invariant_string_loc(const U8* const s, STRLEN const len, const U8 ** ep)
__attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_INVARIANT_STRING \
+#define PERL_ARGS_ASSERT_IS_UTF8_INVARIANT_STRING_LOC \
assert(s)
#endif
PERL_CALLCONV void Perl_sv_vcatpvf_mg(pTHX_ SV *const sv, const char *const pat, va_list *const args);
#define PERL_ARGS_ASSERT_SV_VCATPVF_MG \
assert(sv); assert(pat)
-PERL_CALLCONV void Perl_sv_vcatpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen, va_list *const args, SV **const svargs, const I32 svmax, bool *const maybe_tainted);
+PERL_CALLCONV void Perl_sv_vcatpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen, va_list *const args, SV **const svargs, const Size_t sv_count, bool *const maybe_tainted);
#define PERL_ARGS_ASSERT_SV_VCATPVFN \
assert(sv); assert(pat)
-PERL_CALLCONV void Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen, va_list *const args, SV **const svargs, const I32 svmax, bool *const maybe_tainted, const U32 flags);
+PERL_CALLCONV void Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen, va_list *const args, SV **const svargs, const Size_t sv_count, bool *const maybe_tainted, const U32 flags);
#define PERL_ARGS_ASSERT_SV_VCATPVFN_FLAGS \
assert(sv); assert(pat)
PERL_CALLCONV void Perl_sv_vsetpvf(pTHX_ SV *const sv, const char *const pat, va_list *const args);
PERL_CALLCONV void Perl_sv_vsetpvf_mg(pTHX_ SV *const sv, const char *const pat, va_list *const args);
#define PERL_ARGS_ASSERT_SV_VSETPVF_MG \
assert(sv); assert(pat)
-PERL_CALLCONV void Perl_sv_vsetpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen, va_list *const args, SV **const svargs, const I32 svmax, bool *const maybe_tainted);
+PERL_CALLCONV void Perl_sv_vsetpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN patlen, va_list *const args, SV **const svargs, const Size_t sv_count, bool *const maybe_tainted);
#define PERL_ARGS_ASSERT_SV_VSETPVFN \
assert(sv); assert(pat)
PERL_CALLCONV UV Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8);
#define PERL_ARGS_ASSERT_UTF8_LENGTH \
assert(s); assert(e)
-PERL_CALLCONV U8* Perl_utf8_to_bytes(pTHX_ U8 *s, STRLEN *len);
+PERL_CALLCONV U8* Perl_utf8_to_bytes(pTHX_ U8 *s, STRLEN *lenp);
#define PERL_ARGS_ASSERT_UTF8_TO_BYTES \
- assert(s); assert(len)
+ assert(s); assert(lenp)
PERL_CALLCONV UV Perl_utf8_to_uvchr(pTHX_ const U8 *s, STRLEN *retlen)
__attribute__deprecated__;
#define PERL_ARGS_ASSERT_UTF8_TO_UVCHR \
STATIC NV S_mulexp10(NV value, I32 exponent);
# endif
#endif
+#if !defined(UV_IS_QUAD)
+# if defined(PERL_IN_UTF8_C)
+STATIC int S_is_utf8_cp_above_31_bits(const U8 * const s, const U8 * const e, const bool consider_overlongs)
+ __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_IS_UTF8_CP_ABOVE_31_BITS \
+ assert(s); assert(e)
+
+# endif
+#endif
#if !defined(WIN32)
PERL_CALLCONV bool Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report);
#define PERL_ARGS_ASSERT_DO_EXEC3 \
# endif
# if defined(USE_LOCALE) && defined(PERL_IN_LOCALE_C)
+STATIC void S_print_bytes_for_locale(pTHX_ const char * const s, const char * const e, const bool is_utf8);
+#define PERL_ARGS_ASSERT_PRINT_BYTES_FOR_LOCALE \
+ assert(s); assert(e)
STATIC void S_print_collxfrm_input_and_return(pTHX_ const char * const s, const char * const e, const STRLEN * const xlen, const bool is_utf8);
#define PERL_ARGS_ASSERT_PRINT_COLLXFRM_INPUT_AND_RETURN \
assert(s); assert(e)
STATIC void S_clear_placeholders(pTHX_ HV *hv, U32 items);
#define PERL_ARGS_ASSERT_CLEAR_PLACEHOLDERS \
assert(hv)
-STATIC void S_hfreeentries(pTHX_ HV *hv);
-#define PERL_ARGS_ASSERT_HFREEENTRIES \
- assert(hv)
STATIC void S_hsplit(pTHX_ HV *hv, STRLEN const oldsize, STRLEN newsize);
#define PERL_ARGS_ASSERT_HSPLIT \
assert(hv)
STATIC SV* S_hv_free_ent_ret(pTHX_ HV *hv, HE *entry);
#define PERL_ARGS_ASSERT_HV_FREE_ENT_RET \
assert(hv); assert(entry)
+STATIC void S_hv_free_entries(pTHX_ HV *hv);
+#define PERL_ARGS_ASSERT_HV_FREE_ENTRIES \
+ assert(hv)
STATIC void S_hv_magic_check(HV *hv, bool *needs_copy, bool *needs_store);
#define PERL_ARGS_ASSERT_HV_MAGIC_CHECK \
assert(hv); assert(needs_copy); assert(needs_store)
STATIC bool S_curse(pTHX_ SV * const sv, const bool check_refcnt);
#define PERL_ARGS_ASSERT_CURSE \
assert(sv)
-STATIC STRLEN S_expect_number(pTHX_ char **const pattern)
+STATIC STRLEN S_expect_number(pTHX_ const char **const pattern)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_EXPECT_NUMBER \
assert(pattern)
assert(p); assert(ustrp); assert(lenp)
#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool S_does_utf8_overflow(const U8 * const s, const U8 * e)
+PERL_STATIC_INLINE int S_does_utf8_overflow(const U8 * const s, const U8 * e, const bool consider_overlongs)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_DOES_UTF8_OVERFLOW \
assert(s); assert(e)
#endif
#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool S_isFF_OVERLONG(const U8 * const s, const STRLEN len)
+PERL_STATIC_INLINE int S_isFF_OVERLONG(const U8 * const s, const STRLEN len)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_ISFF_OVERLONG \
assert(s)
#endif
#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool S_is_utf8_cp_above_31_bits(const U8 * const s, const U8 * const e)
- __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_CP_ABOVE_31_BITS \
- assert(s); assert(e)
-#endif
-
-#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool S_is_utf8_overlong_given_start_byte_ok(const U8 * const s, const STRLEN len)
+PERL_STATIC_INLINE int S_is_utf8_overlong_given_start_byte_ok(const U8 * const s, const STRLEN len)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_IS_UTF8_OVERLONG_GIVEN_START_BYTE_OK \
assert(s)