This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Inline dfa for translating from UTF-8
[perl5.git] / proto.h
diff --git a/proto.h b/proto.h
index 8c58a08..c9d47ff 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -35,6 +35,21 @@ PERL_CALLCONV UV     NATIVE_TO_NEED(const UV enc, const UV ch)
 #endif
 
 PERL_CALLCONV const char *     Perl_PerlIO_context_layers(pTHX_ const char *mode);
+PERL_CALLCONV int      Perl_PerlLIO_dup2_cloexec(pTHX_ int oldfd, int newfd);
+PERL_CALLCONV int      Perl_PerlLIO_dup_cloexec(pTHX_ int oldfd)
+                       __attribute__warn_unused_result__;
+
+PERL_CALLCONV int      Perl_PerlLIO_open3_cloexec(pTHX_ const char *file, int flag, int perm)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_PERLLIO_OPEN3_CLOEXEC \
+       assert(file)
+
+PERL_CALLCONV int      Perl_PerlLIO_open_cloexec(pTHX_ const char *file, int flag)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_PERLLIO_OPEN_CLOEXEC  \
+       assert(file)
+
+PERL_CALLCONV const char*      Perl_setlocale(const int category, const char* locale);
 PERL_CALLCONV void*    Perl_Slab_Alloc(pTHX_ size_t sz)
                        __attribute__warn_unused_result__;
 
@@ -47,6 +62,11 @@ PERL_CALLCONV char * Perl__byte_dump_string(pTHX_ const U8 * const start, const
 PERL_CALLCONV void     Perl__force_out_malformed_utf8_message(pTHX_ const U8 *const p, const U8 * const e, const U32 flags, const bool die_here);
 #define PERL_ARGS_ASSERT__FORCE_OUT_MALFORMED_UTF8_MESSAGE     \
        assert(p); assert(e)
+PERL_CALLCONV Size_t   Perl__inverse_folds(pTHX_ const UV cp, unsigned int * first_folds_to, const unsigned int ** remaining_folds_to)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT__INVERSE_FOLDS        \
+       assert(first_folds_to); assert(remaining_folds_to)
+
 PERL_CALLCONV bool     Perl__is_in_locale_category(pTHX_ const bool compiling, const int category);
 PERL_CALLCONV bool     Perl__is_uni_FOO(pTHX_ const U8 classnum, const UV c)
                        __attribute__warn_unused_result__;
@@ -123,6 +143,9 @@ PERL_CALLCONV UV    Perl__to_utf8_title_flags(pTHX_ const U8 *p, const U8* e, U8* u
 PERL_CALLCONV UV       Perl__to_utf8_upper_flags(pTHX_ const U8 *p, const U8 *e, U8* ustrp, STRLEN *lenp, bool flags, const char * const file, const int line);
 #define PERL_ARGS_ASSERT__TO_UTF8_UPPER_FLAGS  \
        assert(p); assert(ustrp); assert(file)
+PERL_CALLCONV UV       Perl__utf8n_to_uvchr_msgs_helper(const U8 *s, STRLEN curlen, STRLEN *retlen, const U32 flags, U32 * errors, AV ** msgs);
+#define PERL_ARGS_ASSERT__UTF8N_TO_UVCHR_MSGS_HELPER   \
+       assert(s)
 PERL_CALLCONV void     Perl__warn_problematic_locale(void);
 PERL_CALLCONV_NO_RET void      Perl_abort_execution(pTHX_ const char * const msg, const char * const name)
                        __attribute__noreturn__;
@@ -200,6 +223,9 @@ PERL_CALLCONV AV*   Perl_av_make(pTHX_ SSize_t size, SV **strp)
 #define PERL_ARGS_ASSERT_AV_MAKE       \
        assert(strp)
 
+PERL_CALLCONV SV*      Perl_av_nonelem(pTHX_ AV *av, SSize_t ix);
+#define PERL_ARGS_ASSERT_AV_NONELEM    \
+       assert(av)
 PERL_CALLCONV SV*      Perl_av_pop(pTHX_ AV *av);
 #define PERL_ARGS_ASSERT_AV_POP        \
        assert(av)
@@ -616,20 +642,24 @@ PERL_CALLCONV_NO_RET void Perl_croak_xs_usage(const CV *const cv, const char *co
        assert(cv); assert(params)
 
 PERL_CALLCONV regexp_engine const *    Perl_current_re_engine(pTHX);
+#ifndef NO_MATHOMS
 PERL_CALLCONV const char *     Perl_custom_op_desc(pTHX_ const OP *o)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_CUSTOM_OP_DESC        \
        assert(o)
+#endif
 
 PERL_CALLCONV XOPRETANY        Perl_custom_op_get_field(pTHX_ const OP *o, const xop_flags_enum field)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_CUSTOM_OP_GET_FIELD   \
        assert(o)
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV const char *     Perl_custom_op_name(pTHX_ const OP *o)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_CUSTOM_OP_NAME        \
        assert(o)
+#endif
 
 PERL_CALLCONV void     Perl_custom_op_register(pTHX_ Perl_ppaddr_t ppaddr, const XOP *xop);
 #define PERL_ARGS_ASSERT_CUSTOM_OP_REGISTER    \
@@ -734,9 +764,11 @@ PERL_CALLCONV bool Perl_do_aexec(pTHX_ SV* really, SV** mark, SV** sp);
 PERL_CALLCONV bool     Perl_do_aexec5(pTHX_ SV* really, SV** mark, SV** sp, int fd, int do_report);
 #define PERL_ARGS_ASSERT_DO_AEXEC5     \
        assert(mark); assert(sp)
+#ifndef NO_MATHOMS
 PERL_CALLCONV int      Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int mode);
 #define PERL_ARGS_ASSERT_DO_BINMODE    \
        assert(fp)
+#endif
 PERL_CALLCONV bool     Perl_do_close(pTHX_ GV* gv, bool not_implicit);
 PERL_CALLCONV void     Perl_do_dump_pad(pTHX_ I32 level, PerlIO *file, PADLIST *padlist, int full);
 #define PERL_ARGS_ASSERT_DO_DUMP_PAD   \
@@ -744,7 +776,6 @@ PERL_CALLCONV void  Perl_do_dump_pad(pTHX_ I32 level, PerlIO *file, PADLIST *padl
 PERL_CALLCONV bool     Perl_do_eof(pTHX_ GV* gv);
 #define PERL_ARGS_ASSERT_DO_EOF        \
        assert(gv)
-PERL_CALLCONV void     Perl_do_execfree(pTHX);
 PERL_CALLCONV void     Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, const char *name, GV *sv);
 #define PERL_ARGS_ASSERT_DO_GV_DUMP    \
        assert(file); assert(name)
@@ -776,9 +807,11 @@ PERL_CALLCONV bool Perl_do_open(pTHX_ GV* gv, const char* name, I32 len, int as_
 PERL_CALLCONV bool     Perl_do_open6(pTHX_ GV *gv, const char *oname, STRLEN len, PerlIO *supplied_fp, SV **svp, U32 num);
 #define PERL_ARGS_ASSERT_DO_OPEN6      \
        assert(gv); assert(oname)
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_do_open9(pTHX_ GV *gv, const char *name, I32 len, int as_raw, int rawmode, int rawperm, PerlIO *supplied_fp, SV *svs, I32 num);
 #define PERL_ARGS_ASSERT_DO_OPEN9      \
        assert(gv); assert(name); assert(svs)
+#endif
 PERL_CALLCONV bool     Perl_do_open_raw(pTHX_ GV *gv, const char *oname, STRLEN len, int rawmode, int rawperm, Stat_t *statbufp);
 #define PERL_ARGS_ASSERT_DO_OPEN_RAW   \
        assert(gv); assert(oname)
@@ -809,7 +842,7 @@ PERL_CALLCONV Off_t Perl_do_tell(pTHX_ GV* gv)
 #define PERL_ARGS_ASSERT_DO_TELL       \
        assert(gv)
 
-PERL_CALLCONV I32      Perl_do_trans(pTHX_ SV* sv);
+PERL_CALLCONV Size_t   Perl_do_trans(pTHX_ SV* sv);
 #define PERL_ARGS_ASSERT_DO_TRANS      \
        assert(sv)
 PERL_CALLCONV UV       Perl_do_vecget(pTHX_ SV* sv, STRLEN offset, int size);
@@ -1054,9 +1087,11 @@ PERL_CALLCONV SV*        Perl_gv_const_sv(pTHX_ GV* gv)
        assert(gv)
 
 PERL_CALLCONV void     Perl_gv_dump(pTHX_ GV* gv);
+#ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_gv_efullname(pTHX_ SV* sv, const GV* gv);
 #define PERL_ARGS_ASSERT_GV_EFULLNAME  \
        assert(sv); assert(gv)
+#endif
 #ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_gv_efullname3(pTHX_ SV* sv, const GV* gv, const char* prefix);
 #define PERL_ARGS_ASSERT_GV_EFULLNAME3 \
@@ -1117,9 +1152,11 @@ PERL_CALLCONV GV*        Perl_gv_fetchpvn_flags(pTHX_ const char* name, STRLEN len, I32
 PERL_CALLCONV GV*      Perl_gv_fetchsv(pTHX_ SV *name, I32 flags, const svtype sv_type);
 #define PERL_ARGS_ASSERT_GV_FETCHSV    \
        assert(name)
+#ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_gv_fullname(pTHX_ SV* sv, const GV* gv);
 #define PERL_ARGS_ASSERT_GV_FULLNAME   \
        assert(sv); assert(gv)
+#endif
 #ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_gv_fullname3(pTHX_ SV* sv, const GV* gv, const char* prefix);
 #define PERL_ARGS_ASSERT_GV_FULLNAME3  \
@@ -1343,11 +1380,17 @@ PERL_CALLCONV void      Perl_init_constants(pTHX);
 PERL_CALLCONV void     Perl_init_dbargs(pTHX);
 PERL_CALLCONV void     Perl_init_debugger(pTHX);
 PERL_CALLCONV int      Perl_init_i18nl10n(pTHX_ int printwarn);
+#ifndef NO_MATHOMS
 PERL_CALLCONV int      Perl_init_i18nl14n(pTHX_ int printwarn);
+#endif
+PERL_CALLCONV void     Perl_init_named_cv(pTHX_ CV *cv, OP *nameop);
+#define PERL_ARGS_ASSERT_INIT_NAMED_CV \
+       assert(cv); assert(nameop)
 PERL_CALLCONV void     Perl_init_stacks(pTHX);
 PERL_CALLCONV void     Perl_init_tm(pTHX_ struct tm *ptm);
 #define PERL_ARGS_ASSERT_INIT_TM       \
        assert(ptm)
+PERL_CALLCONV void     Perl_init_uniprops(pTHX);
 #ifndef NO_MATHOMS
 PERL_CALLCONV char*    Perl_instr(const char* big, const char* little)
                        __attribute__warn_unused_result__
@@ -1363,36 +1406,27 @@ PERL_CALLCONV OP*       Perl_invert(pTHX_ OP* cmd)
 PERL_CALLCONV bool     Perl_io_close(pTHX_ IO* io, GV *gv, bool not_implicit, bool warn_on_fail);
 #define PERL_ARGS_ASSERT_IO_CLOSE      \
        assert(io)
-PERL_CALLCONV bool     Perl_isALNUM_lazy(pTHX_ const char* p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_ISALNUM_LAZY  \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_isIDFIRST_lazy(pTHX_ const char* p)
-                       __attribute__deprecated__
+#ifndef PERL_NO_INLINE_FUNCTIONS
+PERL_STATIC_INLINE Size_t      S_isUTF8_CHAR(const U8 * const s0, const U8 * const e)
                        __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_ISIDFIRST_LAZY        \
-       assert(p)
+#define PERL_ARGS_ASSERT_ISUTF8_CHAR   \
+       assert(s0); assert(e)
+#endif
 
-/* PERL_CALLCONV bool  Perl_is_ascii_string(const U8* const s, const STRLEN len)
+/* PERL_CALLCONV bool  Perl_is_ascii_string(const U8* const s, STRLEN len)
                        __attribute__warn_unused_result__
                        __attribute__pure__; */
 
-#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool        S_is_c9strict_utf8_string(const U8 *s, const STRLEN len)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_C9STRICT_UTF8_STRING       \
-       assert(s)
-#endif
+/* PERL_CALLCONV bool  Perl_is_c9strict_utf8_string(const U8 *s, STRLEN len)
+                       __attribute__warn_unused_result__; */
 
-/* PERL_CALLCONV bool  is_c9strict_utf8_string_loc(const U8 *s, const STRLEN len, const U8 **ep); */
+/* PERL_CALLCONV bool  is_c9strict_utf8_string_loc(const U8 *s, STRLEN len, const U8 **ep); */
 #ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool        S_is_c9strict_utf8_string_loclen(const U8 *s, const STRLEN len, const U8 **ep, STRLEN *el);
+PERL_STATIC_INLINE bool        S_is_c9strict_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el);
 #define PERL_ARGS_ASSERT_IS_C9STRICT_UTF8_STRING_LOCLEN        \
        assert(s)
 #endif
-/* PERL_CALLCONV bool  Perl_is_invariant_string(const U8* const s, const STRLEN len)
+/* PERL_CALLCONV bool  Perl_is_invariant_string(const U8* const s, STRLEN len)
                        __attribute__warn_unused_result__
                        __attribute__pure__; */
 
@@ -1406,293 +1440,239 @@ PERL_STATIC_INLINE bool       S_is_safe_syscall(pTHX_ const char *pv, STRLEN len, cons
        assert(pv); assert(what); assert(op_name)
 #endif
 
-#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool        S_is_strict_utf8_string(const U8 *s, const STRLEN len)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_STRICT_UTF8_STRING \
-       assert(s)
-#endif
+/* PERL_CALLCONV bool  Perl_is_strict_utf8_string(const U8 *s, STRLEN len)
+                       __attribute__warn_unused_result__; */
 
-/* PERL_CALLCONV bool  is_strict_utf8_string_loc(const U8 *s, const STRLEN len, const U8 **ep); */
+/* PERL_CALLCONV bool  is_strict_utf8_string_loc(const U8 *s, STRLEN len, const U8 **ep); */
 #ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool        S_is_strict_utf8_string_loclen(const U8 *s, const STRLEN len, const U8 **ep, STRLEN *el);
+PERL_STATIC_INLINE bool        S_is_strict_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el);
 #define PERL_ARGS_ASSERT_IS_STRICT_UTF8_STRING_LOCLEN  \
        assert(s)
 #endif
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_alnum(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_alnum_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_alnumc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_alnumc_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_alpha(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_alpha_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_ascii(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_ascii_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_blank(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_blank_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_cntrl(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_cntrl_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_digit(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_digit_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_graph(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_graph_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_idfirst(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_idfirst_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_lower(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_lower_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_print(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_print_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_punct(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_punct_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_space(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_space_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_upper(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_upper_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_xdigit(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__;
+#endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_uni_xdigit_lc(pTHX_ UV c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__;
+#endif
 
-PERL_CALLCONV bool     Perl_is_utf8_alnum(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_ALNUM \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_alnumc(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_ALNUMC        \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_alpha(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_ALPHA \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_ascii(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_ASCII \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_blank(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_BLANK \
-       assert(p)
-
+#ifndef NO_MATHOMS
 PERL_CALLCONV STRLEN   Perl_is_utf8_char(const U8 *s)
                        __attribute__deprecated__;
 #define PERL_ARGS_ASSERT_IS_UTF8_CHAR  \
        assert(s)
+#endif
 
 #ifndef NO_MATHOMS
 PERL_CALLCONV STRLEN   Perl_is_utf8_char_buf(const U8 *buf, const U8 *buf_end);
 #define PERL_ARGS_ASSERT_IS_UTF8_CHAR_BUF      \
        assert(buf); assert(buf_end)
 #endif
-PERL_CALLCONV bool     Perl_is_utf8_cntrl(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_CNTRL \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_digit(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_DIGIT \
-       assert(p)
-
-/* PERL_CALLCONV bool  is_utf8_fixed_width_buf_flags(const U8 * const s, const STRLEN len, const U32 flags); */
-/* PERL_CALLCONV bool  is_utf8_fixed_width_buf_loc_flags(const U8 * const s, const STRLEN len, const U8 **ep, const U32 flags); */
+/* PERL_CALLCONV bool  is_utf8_fixed_width_buf_flags(const U8 * const s, STRLEN len, const U32 flags); */
+/* PERL_CALLCONV bool  is_utf8_fixed_width_buf_loc_flags(const U8 * const s, STRLEN len, const U8 **ep, const U32 flags); */
 #ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool        S_is_utf8_fixed_width_buf_loclen_flags(const U8 * const s, const STRLEN len, const U8 **ep, STRLEN *el, const U32 flags);
+PERL_STATIC_INLINE bool        S_is_utf8_fixed_width_buf_loclen_flags(const U8 * const s, STRLEN len, const U8 **ep, STRLEN *el, const U32 flags);
 #define PERL_ARGS_ASSERT_IS_UTF8_FIXED_WIDTH_BUF_LOCLEN_FLAGS  \
        assert(s)
 #endif
-PERL_CALLCONV bool     Perl_is_utf8_graph(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_GRAPH \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_idcont(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_IDCONT        \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_idfirst(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_IDFIRST       \
-       assert(p)
-
-/* PERL_CALLCONV bool  is_utf8_invariant_string(const U8* const s, STRLEN const len)
+/* PERL_CALLCONV bool  is_utf8_invariant_string(const U8* const s, STRLEN len)
                        __attribute__warn_unused_result__; */
 
 #ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool        S_is_utf8_invariant_string_loc(const U8* const s, STRLEN const len, const U8 ** ep)
+PERL_STATIC_INLINE bool        S_is_utf8_invariant_string_loc(const U8* const s, STRLEN len, const U8 ** ep)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_IS_UTF8_INVARIANT_STRING_LOC  \
        assert(s)
 #endif
 
-PERL_CALLCONV bool     Perl_is_utf8_lower(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_LOWER \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_mark(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_MARK  \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_perl_space(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_PERL_SPACE    \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_perl_word(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_PERL_WORD     \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_posix_digit(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_POSIX_DIGIT   \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_print(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_PRINT \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_punct(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_PUNCT \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_space(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_SPACE \
-       assert(p)
-
-#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool        Perl_is_utf8_string(const U8 *s, const STRLEN len)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_STRING        \
-       assert(s)
-#endif
+/* PERL_CALLCONV bool  Perl_is_utf8_string(const U8 *s, STRLEN len)
+                       __attribute__warn_unused_result__; */
 
 #ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool        S_is_utf8_string_flags(const U8 *s, const STRLEN len, const U32 flags)
+PERL_STATIC_INLINE bool        S_is_utf8_string_flags(const U8 *s, STRLEN len, const U32 flags)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_IS_UTF8_STRING_FLAGS  \
        assert(s)
@@ -1703,23 +1683,17 @@ PERL_CALLCONV bool      Perl_is_utf8_string_loc(const U8 *s, const STRLEN len, const
 #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOC    \
        assert(s); assert(ep)
 #endif
-/* PERL_CALLCONV bool  is_utf8_string_loc_flags(const U8 *s, const STRLEN len, const U8 **ep, const U32 flags); */
+/* PERL_CALLCONV bool  is_utf8_string_loc_flags(const U8 *s, STRLEN len, const U8 **ep, const U32 flags); */
 #ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool        Perl_is_utf8_string_loclen(const U8 *s, const STRLEN len, const U8 **ep, STRLEN *el);
+PERL_STATIC_INLINE bool        Perl_is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el);
 #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN \
        assert(s)
 #endif
 #ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE bool        S_is_utf8_string_loclen_flags(const U8 *s, const STRLEN len, const U8 **ep, STRLEN *el, const U32 flags);
+PERL_STATIC_INLINE bool        S_is_utf8_string_loclen_flags(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el, const U32 flags);
 #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN_FLAGS   \
        assert(s)
 #endif
-PERL_CALLCONV bool     Perl_is_utf8_upper(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_UPPER \
-       assert(p)
-
 /* PERL_CALLCONV bool  is_utf8_valid_partial_char(const U8 * const s, const U8 * const e)
                        __attribute__warn_unused_result__
                        __attribute__pure__; */
@@ -1731,24 +1705,6 @@ PERL_STATIC_INLINE bool  S_is_utf8_valid_partial_char_flags(const U8 * const s, c
        assert(s); assert(e)
 #endif
 
-PERL_CALLCONV bool     Perl_is_utf8_xdigit(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_XDIGIT        \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_xidcont(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_XIDCONT       \
-       assert(p)
-
-PERL_CALLCONV bool     Perl_is_utf8_xidfirst(pTHX_ const U8 *p)
-                       __attribute__deprecated__
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_IS_UTF8_XIDFIRST      \
-       assert(p)
-
 PERL_CALLCONV bool     Perl_isinfnan(NV nv)
                        __attribute__warn_unused_result__
                        __attribute__pure__;
@@ -1936,6 +1892,9 @@ PERL_CALLCONV int Perl_magic_setmglob(pTHX_ SV* sv, MAGIC* mg);
 PERL_CALLCONV int      Perl_magic_setnkeys(pTHX_ SV* sv, MAGIC* mg);
 #define PERL_ARGS_ASSERT_MAGIC_SETNKEYS        \
        assert(sv); assert(mg)
+PERL_CALLCONV int      Perl_magic_setnonelem(pTHX_ SV* sv, MAGIC* mg);
+#define PERL_ARGS_ASSERT_MAGIC_SETNONELEM      \
+       assert(sv); assert(mg)
 PERL_CALLCONV int      Perl_magic_setpack(pTHX_ SV* sv, MAGIC* mg);
 #define PERL_ARGS_ASSERT_MAGIC_SETPACK \
        assert(sv); assert(mg)
@@ -2076,9 +2035,12 @@ PERL_CALLCONV SV*        Perl_multideref_stringify(pTHX_ const OP* o, CV *cv);
 PERL_CALLCONV NV       Perl_my_atof(pTHX_ const char *s);
 #define PERL_ARGS_ASSERT_MY_ATOF       \
        assert(s)
-PERL_CALLCONV char*    Perl_my_atof2(pTHX_ const char *s, NV* value);
+PERL_CALLCONV char*    Perl_my_atof2(pTHX_ const char *orig, NV* value);
 #define PERL_ARGS_ASSERT_MY_ATOF2      \
-       assert(s); assert(value)
+       assert(orig); assert(value)
+PERL_CALLCONV char*    Perl_my_atof3(pTHX_ const char *orig, NV* value, const STRLEN len);
+#define PERL_ARGS_ASSERT_MY_ATOF3      \
+       assert(orig); assert(value)
 PERL_CALLCONV OP *     Perl_my_attrs(pTHX_ OP *o, OP *attrs);
 #define PERL_ARGS_ASSERT_MY_ATTRS      \
        assert(o)
@@ -2096,6 +2058,11 @@ PERL_CALLCONV Pid_t      Perl_my_fork(void);
 PERL_CALLCONV I32      Perl_my_lstat(pTHX);
 #endif
 PERL_CALLCONV I32      Perl_my_lstat_flags(pTHX_ const U32 flags);
+PERL_CALLCONV int      Perl_my_mkstemp_cloexec(char *templte)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_MY_MKSTEMP_CLOEXEC    \
+       assert(templte)
+
 PERL_CALLCONV PerlIO*  Perl_my_popen_list(pTHX_ const char* mode, int n, SV ** args);
 #define PERL_ARGS_ASSERT_MY_POPEN_LIST \
        assert(mode); assert(args)
@@ -2375,7 +2342,6 @@ PERL_CALLCONV CV *        Perl_newXS_flags(pTHX_ const char *name, XSUBADDR_t subaddr,
 PERL_CALLCONV CV *     Perl_newXS_len_flags(pTHX_ const char *name, STRLEN len, XSUBADDR_t subaddr, const char *const filename, const char *const proto, SV **const_svp, U32 flags);
 #define PERL_ARGS_ASSERT_NEWXS_LEN_FLAGS       \
        assert(subaddr)
-PERL_CALLCONV void     Perl_new_numeric(pTHX_ const char* newcoll);
 PERL_CALLCONV PERL_SI* Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems)
                        __attribute__warn_unused_result__;
 
@@ -2441,9 +2407,11 @@ PERL_CALLCONV OP*        Perl_op_unscope(pTHX_ OP* o);
 PERL_CALLCONV void     Perl_optimize_optree(pTHX_ OP* o);
 #define PERL_ARGS_ASSERT_OPTIMIZE_OPTREE       \
        assert(o)
+#ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_pack_cat(pTHX_ SV *cat, const char *pat, const char *patend, SV **beglist, SV **endlist, SV ***next_in_list, U32 flags);
 #define PERL_ARGS_ASSERT_PACK_CAT      \
        assert(cat); assert(pat); assert(patend); assert(beglist); assert(endlist); assert(next_in_list)
+#endif
 PERL_CALLCONV void     Perl_package(pTHX_ OP* o);
 #define PERL_ARGS_ASSERT_PACKAGE       \
        assert(o)
@@ -2526,6 +2494,9 @@ PERL_CALLCONV OP* Perl_parse_termexpr(pTHX_ U32 flags);
 PERL_CALLCONV U32      Perl_parse_unicode_opts(pTHX_ const char **popt);
 #define PERL_ARGS_ASSERT_PARSE_UNICODE_OPTS    \
        assert(popt)
+PERL_CALLCONV SV *     Perl_parse_uniprop_string(pTHX_ const char * const name, const Size_t len, const bool to_fold, bool * invert);
+#define PERL_ARGS_ASSERT_PARSE_UNIPROP_STRING  \
+       assert(name); assert(invert)
 PERL_CALLCONV void     Perl_parser_free(pTHX_ const yy_parser *parser);
 #define PERL_ARGS_ASSERT_PARSER_FREE   \
        assert(parser)
@@ -2820,20 +2791,26 @@ PERL_CALLCONV void      Perl_save_item(pTHX_ SV* item);
 PERL_CALLCONV void     Perl_save_iv(pTHX_ IV *ivp);
 #define PERL_ARGS_ASSERT_SAVE_IV       \
        assert(ivp)
+#ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_save_list(pTHX_ SV** sarg, I32 maxsarg);
 #define PERL_ARGS_ASSERT_SAVE_LIST     \
        assert(sarg)
+#endif
+#ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_save_long(pTHX_ long* longp);
 #define PERL_ARGS_ASSERT_SAVE_LONG     \
        assert(longp)
+#endif
 #ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_save_mortalizesv(pTHX_ SV* sv);
 #define PERL_ARGS_ASSERT_SAVE_MORTALIZESV      \
        assert(sv)
 #endif
+#ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_save_nogv(pTHX_ GV* gv);
 #define PERL_ARGS_ASSERT_SAVE_NOGV     \
        assert(gv)
+#endif
 #ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_save_op(pTHX);
 #endif
@@ -2930,7 +2907,11 @@ PERL_CALLCONV void       Perl_set_numeric_underlying(pTHX);
 PERL_CALLCONV void     Perl_setdefout(pTHX_ GV* gv);
 #define PERL_ARGS_ASSERT_SETDEFOUT     \
        assert(gv)
-PERL_CALLCONV char*    Perl_setlocale(int category, const char* locale);
+PERL_CALLCONV void     Perl_setfd_cloexec(int fd);
+PERL_CALLCONV void     Perl_setfd_cloexec_for_nonsysfd(pTHX_ int fd);
+PERL_CALLCONV void     Perl_setfd_cloexec_or_inhexec_by_sysfdness(pTHX_ int fd);
+PERL_CALLCONV void     Perl_setfd_inhexec(int fd);
+PERL_CALLCONV void     Perl_setfd_inhexec_for_sysfd(pTHX_ int fd);
 PERL_CALLCONV HEK*     Perl_share_hek(pTHX_ const char* str, SSize_t len, U32 hash);
 #define PERL_ARGS_ASSERT_SHARE_HEK     \
        assert(str)
@@ -2955,7 +2936,11 @@ PERL_CALLCONV NV Perl_str_to_version(pTHX_ SV *sv)
 PERL_CALLCONV void     Perl_sub_crush_depth(pTHX_ CV* cv);
 #define PERL_ARGS_ASSERT_SUB_CRUSH_DEPTH       \
        assert(cv)
-/* PERL_CALLCONV bool  sv_2bool(pTHX_ SV *const sv); */
+#ifndef NO_MATHOMS
+PERL_CALLCONV bool     Perl_sv_2bool(pTHX_ SV *const sv);
+#define PERL_ARGS_ASSERT_SV_2BOOL      \
+       assert(sv)
+#endif
 PERL_CALLCONV bool     Perl_sv_2bool_flags(pTHX_ SV *sv, I32 flags);
 #define PERL_ARGS_ASSERT_SV_2BOOL_FLAGS        \
        assert(sv)
@@ -3145,7 +3130,9 @@ PERL_CALLCONV bool        Perl_sv_does_sv(pTHX_ SV* sv, SV* namesv, U32 flags)
        assert(sv); assert(namesv)
 
 PERL_CALLCONV void     Perl_sv_dump(pTHX_ SV* sv);
-/* PERL_CALLCONV I32   sv_eq(pTHX_ SV* sv1, SV* sv2); */
+#ifndef NO_MATHOMS
+PERL_CALLCONV I32      Perl_sv_eq(pTHX_ SV* sv1, SV* sv2);
+#endif
 PERL_CALLCONV I32      Perl_sv_eq_flags(pTHX_ SV* sv1, SV* sv2, const U32 flags);
 #ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_sv_force_normal(pTHX_ SV *sv);
@@ -3183,9 +3170,11 @@ PERL_CALLCONV int        Perl_sv_isa(pTHX_ SV* sv, const char *const name);
 #define PERL_ARGS_ASSERT_SV_ISA        \
        assert(name)
 PERL_CALLCONV int      Perl_sv_isobject(pTHX_ SV* sv);
+#ifndef NO_MATHOMS
 PERL_CALLCONV IV       Perl_sv_iv(pTHX_ SV* sv);
 #define PERL_ARGS_ASSERT_SV_IV \
        assert(sv)
+#endif
 PERL_CALLCONV STRLEN   Perl_sv_len(pTHX_ SV *const sv);
 PERL_CALLCONV STRLEN   Perl_sv_len_utf8(pTHX_ SV *const sv);
 PERL_CALLCONV STRLEN   Perl_sv_len_utf8_nomg(pTHX_ SV *const sv);
@@ -3219,9 +3208,11 @@ PERL_CALLCONV void       Perl_sv_nosharing(pTHX_ SV *sv);
 #ifndef NO_MATHOMS
 PERL_CALLCONV void     Perl_sv_nounlocking(pTHX_ SV *sv);
 #endif
+#ifndef NO_MATHOMS
 PERL_CALLCONV NV       Perl_sv_nv(pTHX_ SV* sv);
 #define PERL_ARGS_ASSERT_SV_NV \
        assert(sv)
+#endif
 #ifndef PERL_NO_INLINE_FUNCTIONS
 PERL_STATIC_INLINE bool        S_sv_only_taint_gmagic(SV *sv);
 #define PERL_ARGS_ASSERT_SV_ONLY_TAINT_GMAGIC  \
@@ -3254,15 +3245,19 @@ PERL_CALLCONV char*     Perl_sv_pvbyte(pTHX_ SV *sv)
        assert(sv)
 #endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV char*    Perl_sv_pvbyten(pTHX_ SV *sv, STRLEN *lp);
 #define PERL_ARGS_ASSERT_SV_PVBYTEN    \
        assert(sv); assert(lp)
+#endif
 PERL_CALLCONV char*    Perl_sv_pvbyten_force(pTHX_ SV *const sv, STRLEN *const lp);
 #define PERL_ARGS_ASSERT_SV_PVBYTEN_FORCE      \
        assert(sv)
+#ifndef NO_MATHOMS
 PERL_CALLCONV char*    Perl_sv_pvn(pTHX_ SV *sv, STRLEN *lp);
 #define PERL_ARGS_ASSERT_SV_PVN        \
        assert(sv); assert(lp)
+#endif
 #ifndef NO_MATHOMS
 PERL_CALLCONV char*    Perl_sv_pvn_force(pTHX_ SV* sv, STRLEN* lp);
 #define PERL_ARGS_ASSERT_SV_PVN_FORCE  \
@@ -3271,9 +3266,11 @@ PERL_CALLCONV char*      Perl_sv_pvn_force(pTHX_ SV* sv, STRLEN* lp);
 PERL_CALLCONV char*    Perl_sv_pvn_force_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags);
 #define PERL_ARGS_ASSERT_SV_PVN_FORCE_FLAGS    \
        assert(sv)
+#ifndef NO_MATHOMS
 PERL_CALLCONV char*    Perl_sv_pvn_nomg(pTHX_ SV* sv, STRLEN* lp);
 #define PERL_ARGS_ASSERT_SV_PVN_NOMG   \
        assert(sv)
+#endif
 #ifndef NO_MATHOMS
 PERL_CALLCONV char*    Perl_sv_pvutf8(pTHX_ SV *sv)
                        __attribute__warn_unused_result__;
@@ -3281,9 +3278,11 @@ PERL_CALLCONV char*      Perl_sv_pvutf8(pTHX_ SV *sv)
        assert(sv)
 #endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV char*    Perl_sv_pvutf8n(pTHX_ SV *sv, STRLEN *lp);
 #define PERL_ARGS_ASSERT_SV_PVUTF8N    \
        assert(sv); assert(lp)
+#endif
 PERL_CALLCONV char*    Perl_sv_pvutf8n_force(pTHX_ SV *const sv, STRLEN *const lp);
 #define PERL_ARGS_ASSERT_SV_PVUTF8N_FORCE      \
        assert(sv)
@@ -3466,9 +3465,11 @@ PERL_CALLCONV STRLEN     Perl_sv_utf8_upgrade_flags_grow(pTHX_ SV *const sv, const I
 #define PERL_ARGS_ASSERT_SV_UTF8_UPGRADE_FLAGS_GROW    \
        assert(sv)
 /* PERL_CALLCONV STRLEN        sv_utf8_upgrade_nomg(pTHX_ SV *sv); */
+#ifndef NO_MATHOMS
 PERL_CALLCONV UV       Perl_sv_uv(pTHX_ SV* sv);
 #define PERL_ARGS_ASSERT_SV_UV \
        assert(sv)
+#endif
 PERL_CALLCONV void     Perl_sv_vcatpvf(pTHX_ SV *const sv, const char *const pat, va_list *const args);
 #define PERL_ARGS_ASSERT_SV_VCATPVF    \
        assert(sv); assert(pat)
@@ -3498,7 +3499,8 @@ PERL_CALLCONV SV* Perl_swash_init(pTHX_ const char* pkg, const char* name, SV* l
 #define PERL_ARGS_ASSERT_SWASH_INIT    \
        assert(pkg); assert(name); assert(listsv)
 
-PERL_CALLCONV void     Perl_sync_locale(pTHX);
+PERL_CALLCONV void     Perl_switch_to_global_locale(void);
+PERL_CALLCONV bool     Perl_sync_locale(void);
 PERL_CALLCONV void     Perl_sys_init(int* argc, char*** argv);
 #define PERL_ARGS_ASSERT_SYS_INIT      \
        assert(argc); assert(argv)
@@ -3510,6 +3512,8 @@ PERL_CALLCONV void        Perl_taint_env(pTHX);
 PERL_CALLCONV void     Perl_taint_proper(pTHX_ const char* f, const char *const s);
 #define PERL_ARGS_ASSERT_TAINT_PROPER  \
        assert(s)
+PERL_CALLCONV void     Perl_thread_locale_init(void);
+PERL_CALLCONV void     Perl_thread_locale_term(void);
 PERL_CALLCONV OP *     Perl_tied_method(pTHX_ SV *methname, SV **sp, SV *const sv, const MAGIC *const mg, const U32 flags, U32 argc, ...);
 #define PERL_ARGS_ASSERT_TIED_METHOD   \
        assert(methname); assert(sp); assert(sv); assert(mg)
@@ -3518,58 +3522,38 @@ PERL_CALLCONV SSize_t   Perl_tmps_grow_p(pTHX_ SSize_t ix);
 PERL_CALLCONV UV       Perl_to_uni_lower(pTHX_ UV c, U8 *p, STRLEN *lenp);
 #define PERL_ARGS_ASSERT_TO_UNI_LOWER  \
        assert(p); assert(lenp)
+#ifndef NO_MATHOMS
 PERL_CALLCONV U32      Perl_to_uni_lower_lc(pTHX_ U32 c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
 PERL_CALLCONV UV       Perl_to_uni_title(pTHX_ UV c, U8 *p, STRLEN *lenp);
 #define PERL_ARGS_ASSERT_TO_UNI_TITLE  \
        assert(p); assert(lenp)
+#ifndef NO_MATHOMS
 PERL_CALLCONV U32      Perl_to_uni_title_lc(pTHX_ U32 c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
+#endif
 
 PERL_CALLCONV UV       Perl_to_uni_upper(pTHX_ UV c, U8 *p, STRLEN *lenp);
 #define PERL_ARGS_ASSERT_TO_UNI_UPPER  \
        assert(p); assert(lenp)
+#ifndef NO_MATHOMS
 PERL_CALLCONV U32      Perl_to_uni_upper_lc(pTHX_ U32 c)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__;
-
-#ifndef NO_MATHOMS
-PERL_CALLCONV UV       Perl_to_utf8_fold(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp)
-                       __attribute__deprecated__;
-#define PERL_ARGS_ASSERT_TO_UTF8_FOLD  \
-       assert(p); assert(ustrp)
-#endif
-
-#ifndef NO_MATHOMS
-PERL_CALLCONV UV       Perl_to_utf8_lower(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp)
-                       __attribute__deprecated__;
-#define PERL_ARGS_ASSERT_TO_UTF8_LOWER \
-       assert(p); assert(ustrp)
-#endif
-
-#ifndef NO_MATHOMS
-PERL_CALLCONV UV       Perl_to_utf8_title(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp)
-                       __attribute__deprecated__;
-#define PERL_ARGS_ASSERT_TO_UTF8_TITLE \
-       assert(p); assert(ustrp)
-#endif
-
-#ifndef NO_MATHOMS
-PERL_CALLCONV UV       Perl_to_utf8_upper(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp)
-                       __attribute__deprecated__;
-#define PERL_ARGS_ASSERT_TO_UTF8_UPPER \
-       assert(p); assert(ustrp)
 #endif
 
 PERL_CALLCONV bool     Perl_try_amagic_bin(pTHX_ int method, int flags);
 PERL_CALLCONV bool     Perl_try_amagic_un(pTHX_ int method, int flags);
-PERL_CALLCONV I32      Perl_unpack_str(pTHX_ const char *pat, const char *patend, const char *s, const char *strbeg, const char *strend, char **new_s, I32 ocnt, U32 flags);
+#ifndef NO_MATHOMS
+PERL_CALLCONV SSize_t  Perl_unpack_str(pTHX_ const char *pat, const char *patend, const char *s, const char *strbeg, const char *strend, char **new_s, I32 ocnt, U32 flags);
 #define PERL_ARGS_ASSERT_UNPACK_STR    \
        assert(pat); assert(patend); assert(s); assert(strend)
-PERL_CALLCONV I32      Perl_unpackstring(pTHX_ const char *pat, const char *patend, const char *s, const char *strend, U32 flags);
+#endif
+PERL_CALLCONV SSize_t  Perl_unpackstring(pTHX_ const char *pat, const char *patend, const char *s, const char *strend, U32 flags);
 #define PERL_ARGS_ASSERT_UNPACKSTRING  \
        assert(pat); assert(patend); assert(s); assert(strend)
 PERL_CALLCONV void     Perl_unshare_hek(pTHX_ HEK* hek);
@@ -3619,8 +3603,7 @@ PERL_STATIC_INLINE U8*    Perl_utf8_hop_safe(const U8 *s, SSize_t off, const U8 *st
 #endif
 
 PERL_CALLCONV STRLEN   Perl_utf8_length(pTHX_ const U8* s, const U8 *e)
-                       __attribute__warn_unused_result__
-                       __attribute__pure__;
+                       __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_UTF8_LENGTH   \
        assert(s); assert(e)
 
@@ -3635,22 +3618,29 @@ PERL_CALLCONV UV        Perl_utf8_to_uvchr(pTHX_ const U8 *s, STRLEN *retlen)
 PERL_CALLCONV UV       Perl_utf8_to_uvchr_buf(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen);
 #define PERL_ARGS_ASSERT_UTF8_TO_UVCHR_BUF     \
        assert(s); assert(send)
+#ifndef NO_MATHOMS
 PERL_CALLCONV UV       Perl_utf8_to_uvuni(pTHX_ const U8 *s, STRLEN *retlen)
                        __attribute__deprecated__;
 #define PERL_ARGS_ASSERT_UTF8_TO_UVUNI \
        assert(s)
+#endif
 
 PERL_CALLCONV UV       Perl_utf8_to_uvuni_buf(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen)
                        __attribute__deprecated__;
 #define PERL_ARGS_ASSERT_UTF8_TO_UVUNI_BUF     \
        assert(s); assert(send)
 
-PERL_CALLCONV UV       Perl_utf8n_to_uvchr(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, const U32 flags);
+PERL_CALLCONV UV       Perl_utf8n_to_uvchr(const U8 *s, STRLEN curlen, STRLEN *retlen, const U32 flags);
 #define PERL_ARGS_ASSERT_UTF8N_TO_UVCHR        \
        assert(s)
-PERL_CALLCONV UV       Perl_utf8n_to_uvchr_error(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, const U32 flags, U32 * errors);
+PERL_CALLCONV UV       Perl_utf8n_to_uvchr_error(const U8 *s, STRLEN curlen, STRLEN *retlen, const U32 flags, U32 * errors);
 #define PERL_ARGS_ASSERT_UTF8N_TO_UVCHR_ERROR  \
        assert(s)
+#ifndef PERL_NO_INLINE_FUNCTIONS
+PERL_STATIC_INLINE UV  S_utf8n_to_uvchr_msgs(const U8 *s, STRLEN curlen, STRLEN *retlen, const U32 flags, U32 * errors, AV ** msgs);
+#define PERL_ARGS_ASSERT_UTF8N_TO_UVCHR_MSGS   \
+       assert(s)
+#endif
 PERL_CALLCONV UV       Perl_utf8n_to_uvuni(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags);
 #define PERL_ARGS_ASSERT_UTF8N_TO_UVUNI        \
        assert(s)
@@ -3659,9 +3649,13 @@ PERL_CALLCONV void       Perl_utilize(pTHX_ int aver, I32 floor, OP* version, OP* idop
        assert(idop)
 /* PERL_CALLCONV U8*   uvchr_to_utf8(pTHX_ U8 *d, UV uv); */
 /* PERL_CALLCONV U8*   uvchr_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags); */
+/* PERL_CALLCONV U8*   uvchr_to_utf8_flags_msgs(pTHX_ U8 *d, UV uv, UV flags, HV ** msgs); */
 PERL_CALLCONV U8*      Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, const UV flags);
 #define PERL_ARGS_ASSERT_UVOFFUNI_TO_UTF8_FLAGS        \
        assert(d)
+PERL_CALLCONV U8*      Perl_uvoffuni_to_utf8_flags_msgs(pTHX_ U8 *d, UV uv, const UV flags, HV** msgs);
+#define PERL_ARGS_ASSERT_UVOFFUNI_TO_UTF8_FLAGS_MSGS   \
+       assert(d)
 PERL_CALLCONV U8*      Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv);
 #define PERL_ARGS_ASSERT_UVUNI_TO_UTF8 \
        assert(d)
@@ -3675,10 +3669,12 @@ PERL_STATIC_INLINE UV   Perl_valid_utf8_to_uvchr(const U8 *s, STRLEN *retlen)
        assert(s)
 #endif
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV UV       Perl_valid_utf8_to_uvuni(pTHX_ const U8 *s, STRLEN *retlen)
                        __attribute__deprecated__;
 #define PERL_ARGS_ASSERT_VALID_UTF8_TO_UVUNI   \
        assert(s)
+#endif
 
 PERL_CALLCONV bool     Perl_validate_proto(pTHX_ SV *name, SV *proto, bool warn, bool curstash);
 #define PERL_ARGS_ASSERT_VALIDATE_PROTO        \
@@ -3843,6 +3839,13 @@ PERL_CALLCONV_NO_RET int Perl_magic_regdatum_set(pTHX_ SV* sv, MAGIC* mg)
        assert(sv); assert(mg)
 
 #endif
+#if !defined(EBCDIC)
+#ifndef PERL_NO_INLINE_FUNCTIONS
+PERL_STATIC_INLINE unsigned int        S__variant_byte_number(PERL_UINTMAX_T word)
+                       __attribute__warn_unused_result__;
+#endif
+
+#endif
 #if !defined(HAS_GETENV_LEN)
 PERL_CALLCONV char*    Perl_getenv_len(pTHX_ const char *env_elem, unsigned long *len);
 #define PERL_ARGS_ASSERT_GETENV_LEN    \
@@ -3857,6 +3860,11 @@ STATIC int       S_dooneliner(pTHX_ const char *cmd, const char *filename)
 
 #  endif
 #endif
+#if !defined(HAS_MKOSTEMP)
+PERL_CALLCONV int      Perl_my_mkostemp(char *templte, int flags);
+#define PERL_ARGS_ASSERT_MY_MKOSTEMP   \
+       assert(templte)
+#endif
 #if !defined(HAS_MKSTEMP)
 PERL_CALLCONV int      Perl_my_mkstemp(char *templte);
 #define PERL_ARGS_ASSERT_MY_MKSTEMP    \
@@ -4104,6 +4112,13 @@ PERL_CALLCONV bool       Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
 #define PERL_ARGS_ASSERT_DO_EXEC3      \
        assert(incmd)
 #endif
+#if defined (HAS_SOCKETPAIR) ||     (defined (HAS_SOCKET) && defined(SOCK_DGRAM) &&    defined(AF_INET) && defined(PF_INET))
+PERL_CALLCONV int      Perl_PerlSock_socketpair_cloexec(pTHX_ int domain, int type, int protocol, int *pairfd)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_PERLSOCK_SOCKETPAIR_CLOEXEC   \
+       assert(pairfd)
+
+#endif
 #if defined(DEBUGGING)
 PERL_CALLCONV int      Perl_get_debug_opts(pTHX_ const char **s, bool givehelp)
                        __attribute__warn_unused_result__;
@@ -4153,7 +4168,7 @@ STATIC const regnode*     S_dumpuntil(pTHX_ const regexp *r, const regnode *start, c
        assert(r); assert(start); assert(node); assert(sv)
 STATIC bool    S_put_charclass_bitmap_innards(pTHX_ SV* sv, char* bitmap, SV* nonbitmap_invlist, SV* only_utf8_locale_invlist, const regnode * const node, const bool force_as_is_display);
 #define PERL_ARGS_ASSERT_PUT_CHARCLASS_BITMAP_INNARDS  \
-       assert(sv); assert(bitmap)
+       assert(sv)
 STATIC SV*     S_put_charclass_bitmap_innards_common(pTHX_ SV* invlist, SV* posixes, SV* only_utf8, SV* not_utf8, SV* only_utf8_locale, const bool invert);
 #define PERL_ARGS_ASSERT_PUT_CHARCLASS_BITMAP_INNARDS_COMMON   \
        assert(invlist)
@@ -4250,10 +4265,25 @@ STATIC const char*      S_my_nl_langinfo(const nl_item item, bool toggle);
 #if defined(HAS_NL_LANGINFO) && defined(PERL_LANGINFO_H)
 PERL_CALLCONV const char*      Perl_langinfo(const nl_item item);
 #endif
+#if defined(HAS_PIPE)
+PERL_CALLCONV int      Perl_PerlProc_pipe_cloexec(pTHX_ int *pipefd)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_PERLPROC_PIPE_CLOEXEC \
+       assert(pipefd)
+
+#endif
 #if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
 PERL_CALLCONV Signal_t Perl_csighandler(int sig, siginfo_t *info, void *uap);
 PERL_CALLCONV Signal_t Perl_sighandler(int sig, siginfo_t *info, void *uap);
 #endif
+#if defined(HAS_SOCKET)
+PERL_CALLCONV int      Perl_PerlSock_accept_cloexec(pTHX_ int listenfd, struct sockaddr *addr, Sock_size_t *addrlen)
+                       __attribute__warn_unused_result__;
+
+PERL_CALLCONV int      Perl_PerlSock_socket_cloexec(pTHX_ int domain, int type, int protocol)
+                       __attribute__warn_unused_result__;
+
+#endif
 #if defined(HAVE_INTERP_INTERN)
 PERL_CALLCONV void     Perl_sys_intern_clear(pTHX);
 PERL_CALLCONV void     Perl_sys_intern_init(pTHX);
@@ -4315,11 +4345,32 @@ PERL_CALLCONV void      Perl_Slab_to_rw(pTHX_ OPSLAB *const slab);
 #endif
 #if defined(PERL_CORE) || defined (PERL_EXT)
 #ifndef PERL_NO_INLINE_FUNCTIONS
+PERL_STATIC_INLINE bool        S_is_utf8_non_invariant_string(const U8* const s, STRLEN len)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_IS_UTF8_NON_INVARIANT_STRING  \
+       assert(s)
+#endif
+
+#ifndef PERL_NO_INLINE_FUNCTIONS
 PERL_STATIC_INLINE STRLEN      S_sv_or_pv_pos_u2b(pTHX_ SV *sv, const char *pv, STRLEN pos, STRLEN *lenp);
 #define PERL_ARGS_ASSERT_SV_OR_PV_POS_U2B      \
        assert(sv); assert(pv)
 #endif
 #endif
+#if defined(PERL_CORE) || defined(PERL_EXT)
+PERL_CALLCONV bool     Perl_isSCRIPT_RUN(pTHX_ const U8 *s, const U8 *send, const bool utf8_target)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_ISSCRIPT_RUN  \
+       assert(s); assert(send)
+
+#ifndef PERL_NO_INLINE_FUNCTIONS
+PERL_STATIC_INLINE Size_t      S_variant_under_utf8_count(const U8* const s, const U8* const e)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_VARIANT_UNDER_UTF8_COUNT      \
+       assert(s); assert(e)
+#endif
+
+#endif
 #if defined(PERL_CR_FILTER)
 #  if defined(PERL_IN_TOKE_C)
 STATIC I32     S_cr_textfilter(pTHX_ int idx, SV *sv, int maxlen);
@@ -4388,10 +4439,12 @@ PERL_CALLCONV char*     Perl_form_nocontext(const char* pat, ...)
 #define PERL_ARGS_ASSERT_FORM_NOCONTEXT        \
        assert(pat)
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV int      Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...)
                        __attribute__format__(__printf__,2,3);
 #define PERL_ARGS_ASSERT_FPRINTF_NOCONTEXT     \
        assert(stream); assert(format)
+#endif
 
 PERL_CALLCONV void     Perl_load_module_nocontext(U32 flags, SV* name, SV* ver, ...);
 #define PERL_ARGS_ASSERT_LOAD_MODULE_NOCONTEXT \
@@ -4406,10 +4459,12 @@ PERL_CALLCONV SV*       Perl_newSVpvf_nocontext(const char *const pat, ...)
 #define PERL_ARGS_ASSERT_NEWSVPVF_NOCONTEXT    \
        assert(pat)
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV int      Perl_printf_nocontext(const char *format, ...)
                        __attribute__format__(__printf__,1,2);
 #define PERL_ARGS_ASSERT_PRINTF_NOCONTEXT      \
        assert(format)
+#endif
 
 PERL_CALLCONV void     Perl_sv_catpvf_mg_nocontext(SV *const sv, const char *const pat, ...)
                        __attribute__format__(__printf__,2,3);
@@ -4477,32 +4532,32 @@ STATIC IO *     S_openn_setup(pTHX_ GV *gv, char *mode, PerlIO **saveifp, PerlIO **s
        assert(gv); assert(mode); assert(saveifp); assert(saveofp); assert(savefd); assert(savetype)
 #endif
 #if defined(PERL_IN_DOOP_C)
-STATIC I32     S_do_trans_complex(pTHX_ SV * const sv)
+STATIC Size_t  S_do_trans_complex(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_DO_TRANS_COMPLEX      \
        assert(sv)
 
-STATIC I32     S_do_trans_complex_utf8(pTHX_ SV * const sv)
+STATIC Size_t  S_do_trans_complex_utf8(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_DO_TRANS_COMPLEX_UTF8 \
        assert(sv)
 
-STATIC I32     S_do_trans_count(pTHX_ SV * const sv)
+STATIC Size_t  S_do_trans_count(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_DO_TRANS_COUNT        \
        assert(sv)
 
-STATIC I32     S_do_trans_count_utf8(pTHX_ SV * const sv)
+STATIC Size_t  S_do_trans_count_utf8(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_DO_TRANS_COUNT_UTF8   \
        assert(sv)
 
-STATIC I32     S_do_trans_simple(pTHX_ SV * const sv)
+STATIC Size_t  S_do_trans_simple(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_DO_TRANS_SIMPLE       \
        assert(sv)
 
-STATIC I32     S_do_trans_simple_utf8(pTHX_ SV * const sv)
+STATIC Size_t  S_do_trans_simple_utf8(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_DO_TRANS_SIMPLE_UTF8  \
        assert(sv)
@@ -4627,19 +4682,28 @@ PERL_CALLCONV SV*       Perl_hfree_next_entry(pTHX_ HV *hv, STRLEN *indexp);
 #endif
 #if defined(PERL_IN_LOCALE_C)
 #ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE const char *        S_save_to_buffer(const char * string, char **buf, Size_t *buf_size, const Size_t offset);
+PERL_STATIC_INLINE const char *        S_save_to_buffer(const char * string, char **buf, Size_t *buf_size, const Size_t offset)
+                       __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_SAVE_TO_BUFFER        \
-       assert(string); assert(buf_size)
+       assert(buf_size)
 #endif
+
 #  if defined(USE_LOCALE)
+STATIC const char*     S_category_name(const int category);
 STATIC void    S_new_collate(pTHX_ const char* newcoll);
 STATIC void    S_new_ctype(pTHX_ const char* newctype);
 #define PERL_ARGS_ASSERT_NEW_CTYPE     \
        assert(newctype)
+STATIC void    S_new_numeric(pTHX_ const char* newnum);
+STATIC void    S_restore_switched_locale(pTHX_ const int category, const char * const original_locale);
 STATIC void    S_set_numeric_radix(pTHX_ const bool use_locale);
 STATIC char*   S_stdize_locale(pTHX_ char* locs);
 #define PERL_ARGS_ASSERT_STDIZE_LOCALE \
        assert(locs)
+STATIC const char*     S_switch_category_locale_to_template(pTHX_ const int switch_category, const int template_category, const char * template_locale);
+#    if defined(USE_POSIX_2008_LOCALE)
+STATIC const char*     S_emulate_setlocale(const int category, const char* locale, unsigned int index, const bool is_index_valid);
+#    endif
 #    if defined(WIN32)
 STATIC char*   S_win32_setlocale(pTHX_ int category, const char* locale);
 #    endif
@@ -4990,7 +5054,7 @@ STATIC int        S_div128(pTHX_ SV *pnum, bool *done);
 STATIC char    S_first_symbol(const char *pat, const char *patend);
 #define PERL_ARGS_ASSERT_FIRST_SYMBOL  \
        assert(pat); assert(patend)
-STATIC const char *    S_get_num(pTHX_ const char *patptr, I32 *lenptr)
+STATIC const char *    S_get_num(pTHX_ const char *patptr, SSize_t *lenptr)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_GET_NUM       \
        assert(patptr); assert(lenptr)
@@ -5003,7 +5067,7 @@ STATIC SV*        S_is_an_int(pTHX_ const char *s, STRLEN l)
 #define PERL_ARGS_ASSERT_IS_AN_INT     \
        assert(s)
 
-STATIC I32     S_measure_struct(pTHX_ struct tempsym* symptr);
+STATIC SSize_t S_measure_struct(pTHX_ struct tempsym* symptr);
 #define PERL_ARGS_ASSERT_MEASURE_STRUCT        \
        assert(symptr)
 STATIC SV*     S_mul128(pTHX_ SV *sv, U8 m);
@@ -5028,7 +5092,7 @@ STATIC char *     S_sv_exp_grow(pTHX_ SV *sv, STRLEN needed)
 #define PERL_ARGS_ASSERT_SV_EXP_GROW   \
        assert(sv)
 
-STATIC I32     S_unpack_rec(pTHX_ struct tempsym* symptr, const char *s, const char *strbeg, const char *strend, const char **new_s);
+STATIC SSize_t S_unpack_rec(pTHX_ struct tempsym* symptr, const char *s, const char *strbeg, const char *strend, const char **new_s);
 #define PERL_ARGS_ASSERT_UNPACK_REC    \
        assert(symptr); assert(s); assert(strbeg); assert(strend)
 #endif
@@ -5042,9 +5106,6 @@ STATIC I32        S_amagic_i_ncmp(pTHX_ SV *const a, SV *const b);
 STATIC I32     S_amagic_ncmp(pTHX_ SV *const a, SV *const b);
 #define PERL_ARGS_ASSERT_AMAGIC_NCMP   \
        assert(a); assert(b)
-STATIC void    S_qsortsvu(pTHX_ SV** array, size_t num_elts, SVCOMPARE_t compare);
-#define PERL_ARGS_ASSERT_QSORTSVU      \
-       assert(compare)
 STATIC I32     S_sortcv(pTHX_ SV *const a, SV *const b);
 #define PERL_ARGS_ASSERT_SORTCV        \
        assert(a); assert(b)
@@ -5115,6 +5176,11 @@ STATIC int       S_edit_distance(const UV *src, const UV *tgt, const STRLEN x, const S
 #define PERL_ARGS_ASSERT_EDIT_DISTANCE \
        assert(src); assert(tgt)
 
+STATIC SV *    S_get_ANYOFM_contents(pTHX_ const regnode * n)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_GET_ANYOFM_CONTENTS   \
+       assert(n)
+
 STATIC SV*     S_get_ANYOF_cp_list_for_ssc(pTHX_ const RExC_state_t *pRExC_state, const regnode_charclass* const node);
 #define PERL_ARGS_ASSERT_GET_ANYOF_CP_LIST_FOR_SSC     \
        assert(pRExC_state); assert(node)
@@ -5342,7 +5408,6 @@ PERL_CALLCONV SV* Perl__new_invlist_C_array(pTHX_ const UV* const list)
 PERL_CALLCONV SV*      Perl__get_regclass_nonbitmap_data(pTHX_ const regexp *prog, const struct regnode *node, bool doinit, SV **listsvp, SV **lonly_utf8_locale, SV **output_invlist);
 #define PERL_ARGS_ASSERT__GET_REGCLASS_NONBITMAP_DATA  \
        assert(node)
-PERL_CALLCONV void     Perl__load_PL_utf8_foldclosures(pTHX);
 PERL_CALLCONV int      Perl_re_printf(pTHX_ const char *fmt, ...);
 #define PERL_ARGS_ASSERT_RE_PRINTF     \
        assert(fmt)
@@ -5350,7 +5415,7 @@ PERL_CALLCONV void        Perl_regprop(pTHX_ const regexp *prog, SV* sv, const regnode*
 #define PERL_ARGS_ASSERT_REGPROP       \
        assert(sv); assert(o)
 #endif
-#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C)
+#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_TOKE_C) || defined(PERL_IN_UTF8_C)
 PERL_CALLCONV SV*      Perl__get_swash_invlist(pTHX_ SV* const swash)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT__GET_SWASH_INVLIST    \
@@ -5375,11 +5440,6 @@ PERL_CALLCONV SSize_t    Perl__invlist_search(SV* const invlist, const UV cp)
 #define PERL_ARGS_ASSERT__INVLIST_SEARCH       \
        assert(invlist)
 
-PERL_CALLCONV HV*      Perl__swash_inversion_hash(pTHX_ SV* const swash)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT__SWASH_INVERSION_HASH \
-       assert(swash)
-
 #ifndef PERL_NO_INLINE_FUNCTIONS
 PERL_STATIC_INLINE bool*       S_get_invlist_offset_addr(SV* invlist)
                        __attribute__warn_unused_result__;
@@ -5503,10 +5563,35 @@ STATIC char*    S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s, cons
 #define PERL_ARGS_ASSERT_FIND_BYCLASS  \
        assert(prog); assert(c); assert(s); assert(strend)
 
-STATIC bool    S_isFOO_utf8_lc(pTHX_ const U8 classnum, const U8* character)
+STATIC char *  S_find_next_ascii(char* s, const char * send, const bool is_utf8)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_FIND_NEXT_ASCII       \
+       assert(s); assert(send)
+
+STATIC U8 *    S_find_next_masked(U8 * s, const U8 * send, const U8 byte, const U8 mask)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_FIND_NEXT_MASKED      \
+       assert(s); assert(send)
+
+STATIC char *  S_find_next_non_ascii(char* s, const char * send, const bool is_utf8)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_FIND_NEXT_NON_ASCII   \
+       assert(s); assert(send)
+
+STATIC U8 *    S_find_span_end(U8* s, const U8 * send, const U8 span_byte)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_FIND_SPAN_END \
+       assert(s); assert(send)
+
+STATIC U8 *    S_find_span_end_mask(U8 * s, const U8 * send, const U8 span_byte, const U8 mask)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_FIND_SPAN_END_MASK    \
+       assert(s); assert(send)
+
+STATIC bool    S_isFOO_utf8_lc(pTHX_ const U8 classnum, const U8* character, const U8* e)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_ISFOO_UTF8_LC \
-       assert(character)
+       assert(character); assert(e)
 
 STATIC bool    S_isGCB(pTHX_ const GCB_enum before, const GCB_enum after, const U8 * const strbeg, const U8 * const curpos, const bool utf8_target)
                        __attribute__warn_unused_result__;
@@ -5753,7 +5838,7 @@ STATIC int        S_intuit_more(pTHX_ char *s, char *e);
 STATIC I32     S_lop(pTHX_ I32 f, U8 x, char *s);
 #define PERL_ARGS_ASSERT_LOP   \
        assert(s)
-PERL_STATIC_NO_RET void        S_missingterm(pTHX_ char *s, const STRLEN len)
+PERL_STATIC_NO_RET void        S_missingterm(pTHX_ char *s, STRLEN len)
                        __attribute__noreturn__;
 
 STATIC SV*     S_new_constant(pTHX_ const char *s, STRLEN len, const char *key, STRLEN keylen, SV *sv, SV *pv, const char *type, STRLEN typelen);
@@ -5762,7 +5847,7 @@ STATIC SV*        S_new_constant(pTHX_ const char *s, STRLEN len, const char *key, STRL
 STATIC void    S_no_op(pTHX_ const char *const what, char *s);
 #define PERL_ARGS_ASSERT_NO_OP \
        assert(what)
-STATIC void    S_parse_ident(pTHX_ char **s, char **d, char * const e, int allow_package, bool is_utf8, bool check_dollar);
+STATIC void    S_parse_ident(pTHX_ char **s, char **d, char * const e, int allow_package, bool is_utf8, bool check_dollar, bool tick_warn);
 #define PERL_ARGS_ASSERT_PARSE_IDENT   \
        assert(s); assert(d); assert(e)
 STATIC int     S_pending_ident(pTHX);
@@ -5850,9 +5935,9 @@ STATIC bool       S_isa_lookup(pTHX_ HV *stash, const char * const name, STRLEN len, U
        assert(stash); assert(name)
 #endif
 #if defined(PERL_IN_UTF8_C)
-STATIC UV      S__to_utf8_case(pTHX_ const UV uv1, const U8 *p, U8* ustrp, STRLEN *lenp, SV **swashp, const char *normal, const char *special);
+STATIC UV      S__to_utf8_case(pTHX_ const UV uv1, const U8 *p, U8* ustrp, STRLEN *lenp, SV *invlist, const int * const invmap, const unsigned int * const * const aux_tables, const U8 * const aux_table_lengths, const char * const normal);
 #define PERL_ARGS_ASSERT__TO_UTF8_CASE \
-       assert(p); assert(ustrp); assert(swashp); assert(normal)
+       assert(p); assert(ustrp); assert(invlist); assert(invmap); assert(normal)
 STATIC U32     S_check_and_deprecate(pTHX_ const U8 * p, const U8 ** e, const unsigned type, const bool use_locale, const char * const file, const unsigned line);
 #define PERL_ARGS_ASSERT_CHECK_AND_DEPRECATE   \
        assert(p); assert(e); assert(file)
@@ -5879,14 +5964,14 @@ PERL_STATIC_INLINE int  S_isFF_OVERLONG(const U8 * const s, const STRLEN len)
 PERL_STATIC_INLINE bool        S_is_utf8_common(pTHX_ const U8 *const p, SV **swash, const char * const swashname, SV* const invlist)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_IS_UTF8_COMMON        \
-       assert(p); assert(swash); assert(swashname)
+       assert(p); assert(swashname)
 #endif
 
 #ifndef PERL_NO_INLINE_FUNCTIONS
 PERL_STATIC_INLINE bool        S_is_utf8_common_with_len(pTHX_ const U8 *const p, const U8 *const e, SV **swash, const char * const swashname, SV* const invlist)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_IS_UTF8_COMMON_WITH_LEN       \
-       assert(p); assert(e); assert(swash); assert(swashname)
+       assert(p); assert(e); assert(swashname)
 #endif
 
 #ifndef PERL_NO_INLINE_FUNCTIONS
@@ -5896,6 +5981,11 @@ PERL_STATIC_INLINE int   S_is_utf8_overlong_given_start_byte_ok(const U8 * const s
        assert(s)
 #endif
 
+STATIC HV *    S_new_msg_hv(pTHX_ const char * const message, U32 categories, U32 flag)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_NEW_MSG_HV    \
+       assert(message)
+
 STATIC U8*     S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val, const bool wants_value, const U8* const typestr)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_SWASH_SCAN_LIST_LINE  \
@@ -5924,7 +6014,7 @@ PERL_CALLCONV UV  Perl__to_upper_title_latin1(pTHX_ const U8 c, U8 *p, STRLEN *le
        assert(p); assert(lenp)
 #endif
 #if defined(PERL_IN_UTF8_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C)
-PERL_CALLCONV UV       Perl__to_fold_latin1(pTHX_ const U8 c, U8 *p, STRLEN *lenp, const unsigned int flags);
+PERL_CALLCONV UV       Perl__to_fold_latin1(const U8 c, U8 *p, STRLEN *lenp, const unsigned int flags);
 #define PERL_ARGS_ASSERT__TO_FOLD_LATIN1       \
        assert(p); assert(lenp)
 #endif
@@ -6097,7 +6187,7 @@ PERL_CALLCONV SV* Perl_sv_dup_inc(pTHX_ const SV *const sstr, CLONE_PARAMS *cons
        assert(param)
 
 #endif
-#if defined(USE_LOCALE)                    && (   defined(PERL_IN_LOCALE_C)            || defined(PERL_IN_MG_C)                || defined (PERL_EXT_POSIX))
+#if defined(USE_LOCALE)                    && (   defined(PERL_IN_LOCALE_C)            || defined(PERL_IN_MG_C)                || defined (PERL_EXT_POSIX)             || defined (PERL_EXT_LANGINFO))
 PERL_CALLCONV bool     Perl__is_cur_LC_category_utf8(pTHX_ int category);
 #endif
 #if defined(USE_LOCALE_COLLATE)
@@ -6109,7 +6199,11 @@ PERL_CALLCONV char*      Perl_mem_collxfrm(pTHX_ const char* input_string, STRLEN len
 #define PERL_ARGS_ASSERT_MEM_COLLXFRM  \
        assert(input_string); assert(xlen)
 #endif
-/* PERL_CALLCONV char* sv_collxfrm(pTHX_ SV *const sv, STRLEN *const nxp); */
+#ifndef NO_MATHOMS
+PERL_CALLCONV char*    Perl_sv_collxfrm(pTHX_ SV *const sv, STRLEN *const nxp);
+#define PERL_ARGS_ASSERT_SV_COLLXFRM   \
+       assert(sv); assert(nxp)
+#endif
 PERL_CALLCONV char*    Perl_sv_collxfrm_flags(pTHX_ SV *const sv, STRLEN *const nxp, I32 const flags);
 #define PERL_ARGS_ASSERT_SV_COLLXFRM_FLAGS     \
        assert(sv); assert(nxp)