This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move words and revcharmap out of struct _rev_trie_data and duplicate
[perl5.git] / proto.h
diff --git a/proto.h b/proto.h
index 760caa1..14fec7e 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -227,7 +227,7 @@ PERL_CALLCONV OP*   Perl_convert(pTHX_ I32 optype, I32 flags, OP* o)
 PERL_CALLCONV PERL_CONTEXT*    Perl_create_eval_scope(pTHX_ U32 flags);
 PERL_CALLCONV void     Perl_croak(pTHX_ const char* pat, ...)
                        __attribute__noreturn__
-                       __attribute__format__(__printf__,pTHX_1,pTHX_2);
+                       __attribute__format__null_ok__(__printf__,pTHX_1,pTHX_2);
 
 PERL_CALLCONV void     Perl_vcroak(pTHX_ const char* pat, va_list* args)
                        __attribute__noreturn__
@@ -385,7 +385,7 @@ PERL_CALLCONV void  Perl_deprecate_old(pTHX_ const char* s)
                        __attribute__nonnull__(pTHX_1);
 
 PERL_CALLCONV OP*      Perl_die(pTHX_ const char* pat, ...)
-                       __attribute__format__(__printf__,pTHX_1,pTHX_2);
+                       __attribute__format__null_ok__(__printf__,pTHX_1,pTHX_2);
 
 PERL_CALLCONV OP*      Perl_vdie(pTHX_ const char* pat, va_list* args);
 PERL_CALLCONV OP*      Perl_die_where(pTHX_ const char* message, STRLEN msglen);
@@ -405,9 +405,7 @@ PERL_CALLCONV void  Perl_do_chop(pTHX_ SV* asv, SV* sv)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-PERL_CALLCONV bool     Perl_do_close(pTHX_ GV* gv, bool not_implicit)
-                       __attribute__nonnull__(pTHX_1);
-
+PERL_CALLCONV bool     Perl_do_close(pTHX_ GV* gv, bool not_implicit);
 PERL_CALLCONV bool     Perl_do_eof(pTHX_ GV* gv)
                        __attribute__nonnull__(pTHX_1);
 
@@ -441,6 +439,11 @@ PERL_CALLCONV bool Perl_do_exec3(pTHX_ const char* cmd, int fd, int do_report)
 
 #endif
 PERL_CALLCONV void     Perl_do_execfree(pTHX);
+#ifdef PERL_IN_DOIO_C
+STATIC void    S_exec_failed(pTHX_ const char *cmd, int fd, int do_report)
+                       __attribute__nonnull__(pTHX_1);
+
+#endif
 #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
 PERL_CALLCONV I32      Perl_do_ipcctl(pTHX_ I32 optype, SV** mark, SV** sp)
                        __attribute__nonnull__(pTHX_2)
@@ -600,7 +603,7 @@ PERL_CALLCONV GV*   Perl_gv_autoload4(pTHX_ HV* stash, const char* name, STRLEN le
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_2);
 
-PERL_CALLCONV void     Perl_gv_check(pTHX_ HV* stash)
+PERL_CALLCONV void     Perl_gv_check(pTHX_ const HV* stash)
                        __attribute__nonnull__(pTHX_1);
 
 PERL_CALLCONV void     Perl_gv_efullname(pTHX_ SV* sv, const GV* gv)
@@ -645,12 +648,16 @@ PERL_CALLCONV void        Perl_gv_fullname4(pTHX_ SV* sv, const GV* gv, const char* pre
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
+PERL_CALLCONV GP *     Perl_newGP(pTHX_ GV *const gv)
+                       __attribute__nonnull__(pTHX_1);
+
 PERL_CALLCONV void     Perl_gv_init(pTHX_ GV* gv, HV* stash, const char* name, STRLEN len, int multi)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_3);
 
 PERL_CALLCONV void     Perl_gv_name_set(pTHX_ GV* gv, const char *name, U32 len, U32 flags)
-                       __attribute__nonnull__(pTHX_1);
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
 
 PERL_CALLCONV HV*      Perl_gv_stashpv(pTHX_ const char* name, I32 create)
                        __attribute__nonnull__(pTHX_1);
@@ -727,6 +734,9 @@ PERL_CALLCONV void  Perl_hv_ksplit(pTHX_ HV* hv, IV newmax)
                        __attribute__nonnull__(pTHX_1); */
 
 PERL_CALLCONV HV *     Perl_refcounted_he_chain_2hv(pTHX_ const struct refcounted_he *c);
+PERL_CALLCONV SV *     Perl_refcounted_he_fetch(pTHX_ const struct refcounted_he *chain, SV *keysv, const char *key, STRLEN klen, int flags, U32 hash)
+                       __attribute__nonnull__(pTHX_1);
+
 PERL_CALLCONV void     Perl_refcounted_he_free(pTHX_ struct refcounted_he *he);
 PERL_CALLCONV struct refcounted_he *   Perl_refcounted_he_new(pTHX_ struct refcounted_he *const parent, SV *const key, SV *const value);
 PERL_CALLCONV SV**     Perl_hv_store(pTHX_ HV* tb, const char* key, I32 klen, SV* val, U32 hash);
@@ -997,7 +1007,7 @@ PERL_CALLCONV bool Perl_is_utf8_mark(pTHX_ const U8 *p)
 PERL_CALLCONV OP*      Perl_jmaybe(pTHX_ OP* arg)
                        __attribute__nonnull__(pTHX_1);
 
-PERL_CALLCONV I32      Perl_keyword(pTHX_ const char* d, I32 len)
+PERL_CALLCONV I32      Perl_keyword(pTHX_ const char* d, I32 len, bool all_keywords)
                        __attribute__pure__
                        __attribute__nonnull__(pTHX_1);
 
@@ -1075,7 +1085,7 @@ PERL_CALLCONV int Perl_magic_clearsig(pTHX_ SV* sv, MAGIC* mg)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-PERL_CALLCONV int      Perl_magic_existspack(pTHX_ SV* sv, MAGIC* mg)
+PERL_CALLCONV int      Perl_magic_existspack(pTHX_ SV* sv, const MAGIC* mg)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
@@ -1477,6 +1487,10 @@ PERL_CALLCONV OP*        Perl_newSTATEOP(pTHX_ I32 flags, char* label, OP* o)
                        __attribute__warn_unused_result__;
 
 PERL_CALLCONV CV*      Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block);
+PERL_CALLCONV CV *     Perl_newXS_flags(pTHX_ const char *name, XSUBADDR_t subaddr, const char *const filename, const char *const proto, U32 flags)
+                       __attribute__nonnull__(pTHX_2)
+                       __attribute__nonnull__(pTHX_3);
+
 PERL_CALLCONV CV*      Perl_newXS(pTHX_ const char* name, XSUBADDR_t f, const char* filename)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
@@ -1687,7 +1701,7 @@ PERL_CALLCONV void        Perl_package(pTHX_ OP* o)
 
 #endif
 PERL_CALLCONV PADOFFSET        Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype);
-PERL_CALLCONV PADOFFSET        Perl_allocmy(pTHX_ char* name)
+PERL_CALLCONV PADOFFSET        Perl_allocmy(pTHX_ const char *const name)
                        __attribute__nonnull__(pTHX_1);
 
 PERL_CALLCONV PADOFFSET        Perl_pad_findmy(pTHX_ const char* name)
@@ -1819,6 +1833,15 @@ PERL_CALLCONV I32        Perl_pregexec(pTHX_ regexp* prog, char* stringarg, char* stren
                        __attribute__nonnull__(pTHX_6);
 
 PERL_CALLCONV void     Perl_pregfree(pTHX_ struct regexp* r);
+PERL_CALLCONV char *   Perl_reg_stringify(pTHX_ MAGIC *mg, STRLEN *lp, U32 *flags, I32 *haseval)
+                       __attribute__nonnull__(pTHX_1);
+
+#if defined(USE_ITHREADS)
+PERL_CALLCONV regexp*  Perl_regdupe(pTHX_ const regexp* r, CLONE_PARAMS* param)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+
+#endif
 PERL_CALLCONV regexp*  Perl_pregcomp(pTHX_ char* exp, char* xend, PMOP* pm)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
@@ -1843,6 +1866,9 @@ PERL_CALLCONV regnode*    Perl_regnext(pTHX_ regnode* p)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
+PERL_CALLCONV SV*      Perl_reg_named_buff_sv(pTHX_ SV* namesv)
+                       __attribute__nonnull__(pTHX_1);
+
 PERL_CALLCONV void     Perl_regprop(pTHX_ const regexp *prog, SV* sv, const regnode* o)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
@@ -2064,7 +2090,10 @@ PERL_CALLCONV IO*        Perl_sv_2io(pTHX_ SV* sv)
                        __attribute__nonnull__(pTHX_1);
 
 #ifdef PERL_IN_SV_C
-STATIC char*   S_glob_2inpuv(pTHX_ GV* gv, STRLEN *len, bool want_number)
+STATIC bool    S_glob_2number(pTHX_ GV* const gv)
+                       __attribute__nonnull__(pTHX_1);
+
+STATIC char*   S_glob_2pv(pTHX_ GV* const gv, STRLEN * const len)
                        __attribute__nonnull__(pTHX_1);
 
 #endif
@@ -2193,6 +2222,11 @@ PERL_CALLCONV bool       Perl_sv_derived_from(pTHX_ SV* sv, const char* name)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
+PERL_CALLCONV bool     Perl_sv_does(pTHX_ SV* sv, const char* name)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+
 PERL_CALLCONV I32      Perl_sv_eq(pTHX_ SV* sv1, SV* sv2);
 PERL_CALLCONV void     Perl_sv_free(pTHX_ SV* sv);
 PERL_CALLCONV void     Perl_sv_free2(pTHX_ SV* sv)
@@ -2260,7 +2294,7 @@ PERL_CALLCONV bool        Perl_sv_cat_decode(pTHX_ SV* dsv, SV *encoding, SV *ssv, int
                        __attribute__nonnull__(pTHX_4)
                        __attribute__nonnull__(pTHX_5);
 
-PERL_CALLCONV char*    Perl_sv_reftype(pTHX_ const SV* sv, int ob)
+PERL_CALLCONV const char*      Perl_sv_reftype(pTHX_ const SV* sv, int ob)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
@@ -2337,7 +2371,7 @@ PERL_CALLCONV void        Perl_sv_unref_flags(pTHX_ SV* sv, U32 flags)
 PERL_CALLCONV void     Perl_sv_untaint(pTHX_ SV* sv)
                        __attribute__nonnull__(pTHX_1);
 
-PERL_CALLCONV void     Perl_sv_upgrade(pTHX_ SV* sv, U32 mt)
+PERL_CALLCONV void     Perl_sv_upgrade(pTHX_ SV* sv, svtype new_type)
                        __attribute__nonnull__(pTHX_1);
 
 /* PERL_CALLCONV void  Perl_sv_usepvn(pTHX_ SV* sv, char* ptr, STRLEN len)
@@ -2650,6 +2684,14 @@ PERL_CALLCONV char*      Perl_pv_display(pTHX_ SV *dsv, const char *pv, STRLEN cur, S
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
+PERL_CALLCONV char*    Perl_pv_escape(pTHX_ SV *dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+
+PERL_CALLCONV char*    Perl_pv_pretty(pTHX_ SV *dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+
 PERL_CALLCONV void     Perl_dump_indent(pTHX_ I32 level, PerlIO *file, const char* pat, ...)
                        __attribute__format__(__printf__,pTHX_3,pTHX_4)
                        __attribute__nonnull__(pTHX_2)
@@ -2865,27 +2907,27 @@ PERL_CALLCONV int       Perl_nothreadhook(pTHX);
 END_EXTERN_C
 
 #if defined(PERL_IN_DOOP_C) || defined(PERL_DECL_PROT)
-STATIC I32     S_do_trans_simple(pTHX_ SV *sv)
+STATIC I32     S_do_trans_simple(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
-STATIC I32     S_do_trans_count(pTHX_ SV *sv)
+STATIC I32     S_do_trans_count(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
-STATIC I32     S_do_trans_complex(pTHX_ SV *sv)
+STATIC I32     S_do_trans_complex(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
-STATIC I32     S_do_trans_simple_utf8(pTHX_ SV *sv)
+STATIC I32     S_do_trans_simple_utf8(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
-STATIC I32     S_do_trans_count_utf8(pTHX_ SV *sv)
+STATIC I32     S_do_trans_count_utf8(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
-STATIC I32     S_do_trans_complex_utf8(pTHX_ SV *sv)
+STATIC I32     S_do_trans_complex_utf8(pTHX_ SV * const sv)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
@@ -2931,6 +2973,11 @@ STATIC HEK*      S_share_hek_flags(pTHX_ const char* sv, I32 len, U32 hash, int flags
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
+STATIC SV*     S_hv_magic_uvar_xkey(pTHX_ HV* hv, SV* keysv, int action)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+
 STATIC void    S_hv_notallowed(pTHX_ int flags, const char *key, I32 klen, const char *msg)
                        __attribute__noreturn__
                        __attribute__nonnull__(pTHX_2)
@@ -2944,6 +2991,9 @@ STATIC HE*        S_hv_fetch_common(pTHX_ HV* tb, SV* keysv, const char* key, STRLEN kl
 STATIC void    S_clear_placeholders(pTHX_ HV* hb, U32 items)
                        __attribute__nonnull__(pTHX_1);
 
+STATIC SV *    S_refcounted_he_value(pTHX_ const struct refcounted_he *he)
+                       __attribute__nonnull__(pTHX_1);
+
 #endif
 
 #if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
@@ -3094,10 +3144,6 @@ PERL_CALLCONV OP*        Perl_ck_sassign(pTHX_ OP *o)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
-PERL_CALLCONV OP*      Perl_ck_say(pTHX_ OP *o)
-                       __attribute__warn_unused_result__
-                       __attribute__nonnull__(pTHX_1);
-
 PERL_CALLCONV OP*      Perl_ck_select(pTHX_ OP *o)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
@@ -3261,12 +3307,6 @@ STATIC void*     S_parse_body(pTHX_ char **env, XSINIT_t xsinit);
 STATIC void    S_run_body(pTHX_ I32 oldscope)
                        __attribute__noreturn__;
 
-STATIC void    S_call_body(pTHX_ const OP *myop, bool is_eval)
-                       __attribute__nonnull__(pTHX_1);
-
-STATIC void*   S_call_list_body(pTHX_ CV *cv)
-                       __attribute__nonnull__(pTHX_1);
-
 STATIC SV *    S_incpush_if_exists(pTHX_ SV *dir)
                        __attribute__nonnull__(pTHX_1);
 
@@ -3330,6 +3370,11 @@ STATIC char *    S_sv_exp_grow(pTHX_ SV *sv, STRLEN needed)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 
+STATIC char *  S_bytes_to_uni(const U8 *start, STRLEN len, char *dest)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(3);
+
 #endif
 
 #if defined(PERL_IN_PP_CTL_C) || defined(PERL_DECL_PROT)
@@ -3467,6 +3512,10 @@ STATIC I32       S_sortcv_stacked(pTHX_ SV *a, SV *b)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
+STATIC void    S_qsortsvu(pTHX_ SV** array, size_t num_elts, SVCOMPARE_t compare)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_3);
+
 #endif
 
 #if defined(PERL_IN_PP_SYS_C) || defined(PERL_DECL_PROT)
@@ -3491,27 +3540,26 @@ STATIC SV *     S_space_join_names_mortal(pTHX_ char *const *array)
 #endif
 
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_DECL_PROT)
-STATIC regnode*        S_reg(pTHX_ struct RExC_state_t *state, I32 paren, I32 *flagp)
+STATIC regnode*        S_reg(pTHX_ struct RExC_state_t *state, I32 paren, I32 *flagp, U32 depth)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_3);
 
 STATIC regnode*        S_reganode(pTHX_ struct RExC_state_t *state, U8 op, U32 arg)
                        __attribute__nonnull__(pTHX_1);
 
-STATIC regnode*        S_regatom(pTHX_ struct RExC_state_t *state, I32 *flagp)
+STATIC regnode*        S_regatom(pTHX_ struct RExC_state_t *state, I32 *flagp, U32 depth)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-STATIC regnode*        S_regbranch(pTHX_ struct RExC_state_t *state, I32 *flagp, I32 first)
+STATIC regnode*        S_regbranch(pTHX_ struct RExC_state_t *state, I32 *flagp, I32 first, U32 depth)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-STATIC void    S_reguni(pTHX_ const struct RExC_state_t *state, UV uv, char *s, STRLEN *lenp)
+STATIC STRLEN  S_reguni(pTHX_ const struct RExC_state_t *state, UV uv, char *s)
                        __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_3)
-                       __attribute__nonnull__(pTHX_4);
+                       __attribute__nonnull__(pTHX_3);
 
-STATIC regnode*        S_regclass(pTHX_ struct RExC_state_t *state)
+STATIC regnode*        S_regclass(pTHX_ struct RExC_state_t *state, U32 depth)
                        __attribute__nonnull__(pTHX_1);
 
 STATIC I32     S_regcurly(const char *)
@@ -3521,20 +3569,27 @@ STATIC I32      S_regcurly(const char *)
 STATIC regnode*        S_reg_node(pTHX_ struct RExC_state_t *state, U8 op)
                        __attribute__nonnull__(pTHX_1);
 
-STATIC regnode*        S_regpiece(pTHX_ struct RExC_state_t *state, I32 *flagp)
+STATIC UV      S_reg_recode(pTHX_ const char value, SV **encp);
+STATIC regnode*        S_regpiece(pTHX_ struct RExC_state_t *state, I32 *flagp, U32 depth)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-STATIC void    S_reginsert(pTHX_ struct RExC_state_t *state, U8 op, regnode *opnd)
+STATIC regnode*        S_reg_namedseq(pTHX_ struct RExC_state_t *state, UV *valuep)
+                       __attribute__nonnull__(pTHX_1);
+
+STATIC void    S_reginsert(pTHX_ struct RExC_state_t *state, U8 op, regnode *opnd, U32 depth)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_3);
 
-STATIC void    S_regoptail(pTHX_ const struct RExC_state_t *state, regnode *p, const regnode *val)
+STATIC void    S_regtail(pTHX_ struct RExC_state_t *state, regnode *p, const regnode *val, U32 depth)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 
-STATIC void    S_regtail(pTHX_ const struct RExC_state_t *state, regnode *p, const regnode *val)
+STATIC SV *    S_reg_scan_name(pTHX_ struct RExC_state_t *state, U32 flags)
+                       __attribute__nonnull__(pTHX_1);
+
+STATIC U32     S_join_exact(pTHX_ struct RExC_state_t *state, regnode *scan, I32 *min, U32 flags, regnode *val, U32 depth)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
@@ -3547,20 +3602,10 @@ STATIC char*    S_regwhite(char *p, const char *e)
 STATIC char*   S_nextchar(pTHX_ struct RExC_state_t *state)
                        __attribute__nonnull__(pTHX_1);
 
-#  ifdef DEBUGGING
-STATIC const regnode*  S_dumpuntil(pTHX_ const regexp *r, const regnode *start, const regnode *node, const regnode *last, SV* sv, I32 l)
+STATIC void    S_scan_commit(pTHX_ const struct RExC_state_t* state, struct scan_data_t *data, I32 *minlenp)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
-                       __attribute__nonnull__(pTHX_3)
-                       __attribute__nonnull__(pTHX_5);
-
-STATIC void    S_put_byte(pTHX_ SV* sv, int c)
-                       __attribute__nonnull__(pTHX_1);
-
-#  endif
-STATIC void    S_scan_commit(pTHX_ const struct RExC_state_t* state, struct scan_data_t *data)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
+                       __attribute__nonnull__(pTHX_3);
 
 STATIC void    S_cl_anything(const struct RExC_state_t* state, struct regnode_charclass_class *cl)
                        __attribute__nonnull__(1)
@@ -3587,13 +3632,14 @@ STATIC void     S_cl_or(const struct RExC_state_t* state, struct regnode_charclass_c
                        __attribute__nonnull__(2)
                        __attribute__nonnull__(3);
 
-STATIC I32     S_study_chunk(pTHX_ struct RExC_state_t* state, regnode **scanp, I32 *deltap, regnode *last, struct scan_data_t *data, U32 flags, U32 depth)
+STATIC I32     S_study_chunk(pTHX_ struct RExC_state_t* state, regnode **scanp, I32 *minlenp, I32 *deltap, regnode *last, struct scan_data_t *data, I32 stopparen, U8* recursed, struct regnode_charclass_class *and_withp, U32 flags, U32 depth)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3)
-                       __attribute__nonnull__(pTHX_4);
+                       __attribute__nonnull__(pTHX_4)
+                       __attribute__nonnull__(pTHX_5);
 
-STATIC I32     S_add_data(struct RExC_state_t* state, I32 n, const char *s)
+STATIC U32     S_add_data(struct RExC_state_t* state, U32 n, const char *s)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(1)
                        __attribute__nonnull__(3);
@@ -3609,28 +3655,60 @@ STATIC I32      S_regpposixcc(pTHX_ struct RExC_state_t* state, I32 value)
 STATIC void    S_checkposixcc(pTHX_ struct RExC_state_t* state)
                        __attribute__nonnull__(pTHX_1);
 
-
-STATIC I32     S_make_trie(pTHX_ struct RExC_state_t* state, regnode *startbranch, regnode *first, regnode *last, regnode *tail, U32 flags)
+STATIC I32     S_make_trie(pTHX_ struct RExC_state_t* state, regnode *startbranch, regnode *first, regnode *last, regnode *tail, U32 word_count, U32 flags, U32 depth)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3)
                        __attribute__nonnull__(pTHX_4)
                        __attribute__nonnull__(pTHX_5);
 
+STATIC void    S_make_trie_failtable(pTHX_ struct RExC_state_t* state, regnode *source, regnode *node, U32 depth)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2)
+                       __attribute__nonnull__(pTHX_3);
+
+#  ifdef DEBUGGING
+STATIC const regnode*  S_dumpuntil(pTHX_ const regexp *r, const regnode *start, const regnode *node, const regnode *last, const regnode *plast, SV* sv, I32 indent, U32 depth)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2)
+                       __attribute__nonnull__(pTHX_3)
+                       __attribute__nonnull__(pTHX_6);
+
+STATIC void    S_put_byte(pTHX_ SV* sv, int c)
+                       __attribute__nonnull__(pTHX_1);
+
+STATIC void    S_dump_trie(pTHX_ const struct _reg_trie_data *trie, HV* widecharmap, AV *revcharmap, U32 depth)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_3);
+
+STATIC void    S_dump_trie_interim_list(pTHX_ const struct _reg_trie_data *trie, HV* widecharmap, AV *revcharmap, U32 next_alloc, U32 depth)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_3);
+
+STATIC void    S_dump_trie_interim_table(pTHX_ const struct _reg_trie_data *trie, HV* widecharmap, AV *revcharmap, U32 next_alloc, U32 depth)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_3);
+
+STATIC U8      S_regtail_study(pTHX_ struct RExC_state_t *state, regnode *p, const regnode *val, U32 depth)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2)
+                       __attribute__nonnull__(pTHX_3);
+
+#  endif
 #endif
 
 #if defined(PERL_IN_REGEXEC_C) || defined(PERL_DECL_PROT)
-STATIC I32     S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog)
+STATIC I32     S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-STATIC I32     S_regrepeat(pTHX_ const regexp *prog, const regnode *p, I32 max)
+STATIC I32     S_regrepeat(pTHX_ const regexp *prog, const regnode *p, I32 max, int depth)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-STATIC I32     S_regtry(pTHX_ const regmatch_info *reginfo, char *startpos)
+STATIC I32     S_regtry(pTHX_ regmatch_info *reginfo, char **startpos)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
@@ -3644,17 +3722,25 @@ STATIC CHECKPOINT       S_regcppush(pTHX_ I32 parenfloor);
 STATIC char*   S_regcppop(pTHX_ const regexp *rex)
                        __attribute__nonnull__(pTHX_1);
 
-STATIC U8*     S_reghop3(U8 *pos, I32 off, U8 *lim)
+STATIC U8*     S_reghop3(U8 *pos, I32 off, const U8 *lim)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(1)
                        __attribute__nonnull__(3);
 
-STATIC U8*     S_reghopmaybe3(U8 *pos, I32 off, U8 *lim)
+#ifdef XXX_dmq
+STATIC U8*     S_reghop4(U8 *pos, I32 off, const U8 *llim, const U8 *rlim)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(3)
+                       __attribute__nonnull__(4);
+
+#endif
+STATIC U8*     S_reghopmaybe3(U8 *pos, I32 off, const U8 *lim)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(1)
                        __attribute__nonnull__(3);
 
-STATIC char*   S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s, const char *strend, const regmatch_info *reginfo)
+STATIC char*   S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s, const char *strend, regmatch_info *reginfo)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
@@ -3667,6 +3753,26 @@ STATIC void      S_to_utf8_substr(pTHX_ regexp * prog)
 STATIC void    S_to_byte_substr(pTHX_ regexp * prog)
                        __attribute__nonnull__(pTHX_1);
 
+STATIC I32     S_reg_check_named_buff_matched(pTHX_ const regexp *rex, const regnode *prog)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+
+#  ifdef DEBUGGING
+STATIC void    S_dump_exec_pos(pTHX_ const char *locinput, const regnode *scan, const char *loc_regeol, const char *loc_bostr, const char *loc_reg_starttry, const bool do_utf8)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2)
+                       __attribute__nonnull__(pTHX_3)
+                       __attribute__nonnull__(pTHX_4)
+                       __attribute__nonnull__(pTHX_5);
+
+STATIC void    S_debug_start_match(pTHX_ const regexp *prog, const bool do_utf8, const char *start, const char *end, const char *blurb)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_3)
+                       __attribute__nonnull__(pTHX_4)
+                       __attribute__nonnull__(pTHX_5);
+
+#  endif
 #endif
 
 #if defined(PERL_IN_DUMP_C) || defined(PERL_DECL_PROT)
@@ -3675,6 +3781,7 @@ STATIC void       S_debprof(pTHX_ const OP *o)
                        __attribute__nonnull__(pTHX_1);
 
 STATIC void    S_sequence(pTHX_ const OP *o);
+STATIC void    S_sequence_tail(pTHX_ const OP *o);
 STATIC UV      S_sequence_num(pTHX_ const OP *o);
 STATIC SV*     S_pm_description(pTHX_ const PMOP *pm)
                        __attribute__nonnull__(pTHX_1);
@@ -3738,13 +3845,13 @@ STATIC I32      S_expect_number(pTHX_ char** pattern)
                        __attribute__nonnull__(pTHX_1);
 
 #
-STATIC STRLEN  S_sv_pos_u2b_forwards(pTHX_ const U8 *const start, const U8 *const send, STRLEN uoffset)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
+STATIC STRLEN  S_sv_pos_u2b_forwards(const U8 *const start, const U8 *const send, STRLEN uoffset)
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(2);
 
-STATIC STRLEN  S_sv_pos_u2b_midway(pTHX_ const U8 *const start, const U8 *send, STRLEN uoffset, STRLEN uend)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
+STATIC STRLEN  S_sv_pos_u2b_midway(const U8 *const start, const U8 *send, STRLEN uoffset, STRLEN uend)
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(2);
 
 STATIC STRLEN  S_sv_pos_u2b_cached(pTHX_ SV *sv, MAGIC **mgp, const U8 *const start, const U8 *const send, STRLEN uoffset, STRLEN uoffset0, STRLEN boffset0)
                        __attribute__nonnull__(pTHX_1)
@@ -3756,19 +3863,11 @@ STATIC void     S_utf8_mg_pos_cache_update(pTHX_ SV *sv, MAGIC **mgp, STRLEN byte, S
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-STATIC STRLEN  S_sv_pos_b2u_forwards(pTHX_ const U8 *s, const U8 *const target)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
-
 STATIC STRLEN  S_sv_pos_b2u_midway(pTHX_ const U8 *s, const U8 *const target, const U8 *end, STRLEN endu)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 
-STATIC char *  S_stringify_regexp(pTHX_ SV *sv, MAGIC *mg, STRLEN *lp)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
-
 STATIC char *  S_F0convert(NV nv, char *endbuf, STRLEN *len)
                        __attribute__nonnull__(2)
                        __attribute__nonnull__(3);
@@ -3800,13 +3899,6 @@ STATIC PTR_TBL_ENT_t *   S_ptr_table_find(PTR_TBL_t *tbl, const void *sv)
                        __attribute__nonnull__(2);
 
 #  endif
-STATIC SV *    S_find_hash_subscript(pTHX_ HV *hv, SV *val)
-                       __attribute__nonnull__(pTHX_2);
-
-STATIC I32     S_find_array_subscript(pTHX_ AV *av, SV *val)
-                       __attribute__nonnull__(pTHX_2);
-
-STATIC SV *    S_find_uninit_var(pTHX_ OP *obase, SV *uninit_sv, bool match);
 #endif
 
 #if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT)
@@ -3822,6 +3914,7 @@ STATIC SV*        S_tokeq(pTHX_ SV *sv)
                        __attribute__nonnull__(pTHX_1);
 
 STATIC int     S_pending_ident(pTHX);
+STATIC void    S_readpipe_override(pTHX);
 STATIC char*   S_scan_const(pTHX_ char *start)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
@@ -3938,11 +4031,15 @@ STATIC void     S_strip_return(pTHX_ SV *sv)
 #  endif
 #  if defined(DEBUGGING)
 STATIC int     S_tokereport(pTHX_ I32 rv);
+STATIC void    S_printbuf(pTHX_ const char* fmt, const char* s)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+
 #  endif
 #endif
 
 #if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
-STATIC bool    S_isa_lookup(pTHX_ HV *stash, const char *name, HV *name_stash, int len, int level)
+STATIC bool    S_isa_lookup(pTHX_ HV *stash, const char *name, const HV * const name_stash, int len, int level)
                        __attribute__nonnull__(pTHX_2);
 
 #endif
@@ -4022,6 +4119,8 @@ PERL_CALLCONV SV* Perl_sv_setsv_cow(pTHX_ SV* dsv, SV* ssv)
 
 #endif
 
+PERL_CALLCONV const char *     Perl_PerlIO_context_layers(pTHX_ const char *mode);
+
 #if defined(USE_PERLIO) && !defined(USE_SFIO)
 PERL_CALLCONV int      Perl_PerlIO_close(pTHX_ PerlIO *f);
 PERL_CALLCONV int      Perl_PerlIO_fill(pTHX_ PerlIO *f);
@@ -4081,7 +4180,7 @@ PERL_CALLCONV PADLIST*    Perl_pad_new(pTHX_ int flags)
 PERL_CALLCONV void     Perl_pad_undef(pTHX_ CV* cv)
                        __attribute__nonnull__(pTHX_1);
 
-PERL_CALLCONV PADOFFSET        Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool clone)
+PERL_CALLCONV PADOFFSET        Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool clone, bool state)
                        __attribute__nonnull__(pTHX_1);
 
 PERL_CALLCONV PADOFFSET        Perl_pad_add_anon(pTHX_ SV* sv, OPCODE op_type)
@@ -4191,7 +4290,14 @@ PERL_CALLCONV SV*        Perl_magic_scalarpack(pTHX_ HV* hv, MAGIC* mg)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-#ifdef PERL_IN_SV_C
+
+#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
+STATIC SV *    S_find_hash_subscript(pTHX_ HV *hv, SV *val)
+                       __attribute__nonnull__(pTHX_2);
+
+STATIC I32     S_find_array_subscript(pTHX_ AV *av, SV *val)
+                       __attribute__nonnull__(pTHX_2);
+
 STATIC SV*     S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool top);
 #endif
 
@@ -4320,6 +4426,16 @@ PERL_CALLCONV int        Perl_my_sprintf(char *buffer, const char *pat, ...)
 
 #endif
 
+PERL_CALLCONV int      Perl_my_snprintf(char *buffer, const Size_t len, const char *format, ...)
+                       __attribute__format__(__printf__,3,4)
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(3);
+
+PERL_CALLCONV int      Perl_my_vsnprintf(char *buffer, const Size_t len, const char *format, va_list ap)
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(3);
+
+
 PERL_CALLCONV void     Perl_my_clearenv(pTHX);
 
 #ifdef PERL_IMPLICIT_CONTEXT
@@ -4328,6 +4444,14 @@ PERL_CALLCONV void*      Perl_my_cxt_init(pTHX_ int *index, size_t size)
 
 #endif
 
+#ifndef HAS_STRLCAT
+PERL_CALLCONV Size_t   Perl_my_strlcat(char *dst, const char *src, Size_t size);
+#endif
+
+#ifndef HAS_STRLCPY
+PERL_CALLCONV Size_t   Perl_my_strlcpy(char *dst, const char *src, Size_t size);
+#endif
+
 #ifdef PERL_MAD
 PERL_CALLCONV void     Perl_pad_peg(const char* s)
                        __attribute__nonnull__(1);