This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactor \x processing to single function
[perl5.git] / proto.h
diff --git a/proto.h b/proto.h
index 5423fe4..3188170 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -29,7 +29,7 @@ PERL_CALLCONV bool    Perl__is_utf8__perl_idstart(pTHX_ const U8 *p)
 #define PERL_ARGS_ASSERT__IS_UTF8__PERL_IDSTART        \
        assert(p)
 
 #define PERL_ARGS_ASSERT__IS_UTF8__PERL_IDSTART        \
        assert(p)
 
-PERL_CALLCONV UV       Perl__to_uni_fold_flags(pTHX_ UV c, U8 *p, STRLEN *lenp, const bool flags)
+PERL_CALLCONV UV       Perl__to_uni_fold_flags(pTHX_ UV c, U8 *p, STRLEN *lenp, const U8 flags)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 #define PERL_ARGS_ASSERT__TO_UNI_FOLD_FLAGS    \
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 #define PERL_ARGS_ASSERT__TO_UNI_FOLD_FLAGS    \
@@ -646,6 +646,7 @@ PERL_CALLCONV void  Perl_croak_xs_usage(pTHX_ const CV *const cv, const char *con
 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE        \
        assert(cv); assert(params)
 
 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE        \
        assert(cv); assert(params)
 
+PERL_CALLCONV regexp_engine const *    Perl_current_re_engine(pTHX);
 PERL_CALLCONV const char *     Perl_custom_op_desc(pTHX_ const OP *o)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 PERL_CALLCONV const char *     Perl_custom_op_desc(pTHX_ const OP *o)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
@@ -1913,7 +1914,7 @@ PERL_CALLCONV bool        Perl_is_utf8_string(const U8 *s, STRLEN len)
 #define PERL_ARGS_ASSERT_IS_UTF8_STRING        \
        assert(s)
 
 #define PERL_ARGS_ASSERT_IS_UTF8_STRING        \
        assert(s)
 
-/* PERL_CALLCONV bool  Perl_is_utf8_string_loc(const U8 *s, STRLEN len, const U8 **p)
+/* PERL_CALLCONV bool  Perl_is_utf8_string_loc(const U8 *s, STRLEN len, const U8 **ep)
                        __attribute__nonnull__(1); */
 #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOC    \
        assert(s)
                        __attribute__nonnull__(1); */
 #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOC    \
        assert(s)
@@ -2215,12 +2216,6 @@ PERL_CALLCONV int        Perl_magic_set_all_env(pTHX_ SV* sv, MAGIC* mg)
 #define PERL_ARGS_ASSERT_MAGIC_SET_ALL_ENV     \
        assert(sv); assert(mg)
 
 #define PERL_ARGS_ASSERT_MAGIC_SET_ALL_ENV     \
        assert(sv); assert(mg)
 
-PERL_CALLCONV int      Perl_magic_setamagic(pTHX_ SV* sv, MAGIC* mg)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
-#define PERL_ARGS_ASSERT_MAGIC_SETAMAGIC       \
-       assert(sv); assert(mg)
-
 PERL_CALLCONV int      Perl_magic_setarylen(pTHX_ SV* sv, MAGIC* mg)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 PERL_CALLCONV int      Perl_magic_setarylen(pTHX_ SV* sv, MAGIC* mg)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
@@ -2481,11 +2476,6 @@ PERL_CALLCONV SV*        Perl_mro_set_private_data(pTHX_ struct mro_meta *const smeta,
 #define PERL_ARGS_ASSERT_MRO_SET_PRIVATE_DATA  \
        assert(smeta); assert(which); assert(data)
 
 #define PERL_ARGS_ASSERT_MRO_SET_PRIVATE_DATA  \
        assert(smeta); assert(which); assert(data)
 
-PERL_CALLCONV void     Perl_munge_qwlist_to_paren_list(pTHX_ OP* qwlist)
-                       __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_MUNGE_QWLIST_TO_PAREN_LIST    \
-       assert(qwlist)
-
 PERL_CALLCONV NV       Perl_my_atof(pTHX_ const char *s)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_MY_ATOF       \
 PERL_CALLCONV NV       Perl_my_atof(pTHX_ const char *s)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_MY_ATOF       \
@@ -2724,6 +2714,11 @@ PERL_CALLCONV OP*        Perl_newSTATEOP(pTHX_ I32 flags, char* label, OP* o)
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 
+PERL_CALLCONV CV*      Perl_newSTUB(pTHX_ GV *gv, bool fake)
+                       __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_NEWSTUB       \
+       assert(gv)
+
 /* PERL_CALLCONV CV*   Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block); */
 PERL_CALLCONV SV*      Perl_newSV(pTHX_ const STRLEN len)
                        __attribute__malloc__
 /* PERL_CALLCONV CV*   Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block); */
 PERL_CALLCONV SV*      Perl_newSV(pTHX_ const STRLEN len)
                        __attribute__malloc__
@@ -3051,7 +3046,7 @@ PERL_CALLCONV int perl_run(PerlInterpreter *my_perl)
        assert(my_perl)
 
 PERL_CALLCONV void     Perl_pmop_dump(pTHX_ PMOP* pm);
        assert(my_perl)
 
 PERL_CALLCONV void     Perl_pmop_dump(pTHX_ PMOP* pm);
-PERL_CALLCONV OP*      Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg)
+PERL_CALLCONV OP*      Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg, I32 floor)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_PMRUNTIME     \
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_PMRUNTIME     \
@@ -3143,7 +3138,7 @@ PERL_CALLCONV void        Perl_qerror(pTHX_ SV* err)
 #define PERL_ARGS_ASSERT_QERROR        \
        assert(err)
 
 #define PERL_ARGS_ASSERT_QERROR        \
        assert(err)
 
-PERL_CALLCONV REGEXP*  Perl_re_compile(pTHX_ SV * const pattern, U32 flags)
+PERL_CALLCONV REGEXP*  Perl_re_compile(pTHX_ SV * const pattern, U32 orig_rx_flags)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_RE_COMPILE    \
        assert(pattern)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_RE_COMPILE    \
        assert(pattern)
@@ -3160,10 +3155,23 @@ PERL_CALLCONV SV*       Perl_re_intuit_string(pTHX_ REGEXP  *const r)
 #define PERL_ARGS_ASSERT_RE_INTUIT_STRING      \
        assert(r)
 
 #define PERL_ARGS_ASSERT_RE_INTUIT_STRING      \
        assert(r)
 
+PERL_CALLCONV REGEXP*  Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, OP *expr, const regexp_engine* eng, REGEXP *VOL old_re, bool *is_bare_re, U32 rx_flags, U32 pm_flags)
+                       __attribute__nonnull__(pTHX_4);
+#define PERL_ARGS_ASSERT_RE_OP_COMPILE \
+       assert(eng)
+
 PERL_CALLCONV Malloc_t Perl_realloc(Malloc_t where, MEM_SIZE nbytes)
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 
 PERL_CALLCONV Malloc_t Perl_realloc(Malloc_t where, MEM_SIZE nbytes)
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 
+PERL_CALLCONV void     Perl_reentrant_free(pTHX);
+PERL_CALLCONV void     Perl_reentrant_init(pTHX);
+PERL_CALLCONV void*    Perl_reentrant_retry(const char *f, ...)
+                       __attribute__nonnull__(1);
+#define PERL_ARGS_ASSERT_REENTRANT_RETRY       \
+       assert(f)
+
+PERL_CALLCONV void     Perl_reentrant_size(pTHX);
 /* PERL_CALLCONV OP*   Perl_ref(pTHX_ OP* o, I32 type); */
 PERL_CALLCONV HV *     Perl_refcounted_he_chain_2hv(pTHX_ const struct refcounted_he *c, U32 flags);
 PERL_CALLCONV SV *     Perl_refcounted_he_fetch_pv(pTHX_ const struct refcounted_he *chain, const char *key, U32 hash, U32 flags)
 /* PERL_CALLCONV OP*   Perl_ref(pTHX_ OP* o, I32 type); */
 PERL_CALLCONV HV *     Perl_refcounted_he_chain_2hv(pTHX_ const struct refcounted_he *c, U32 flags);
 PERL_CALLCONV SV *     Perl_refcounted_he_fetch_pv(pTHX_ const struct refcounted_he *chain, const char *key, U32 hash, U32 flags)
@@ -3641,7 +3649,11 @@ PERL_CALLCONV void       Perl_set_context(void *t)
 PERL_CALLCONV void     Perl_set_numeric_local(pTHX);
 PERL_CALLCONV void     Perl_set_numeric_radix(pTHX);
 PERL_CALLCONV void     Perl_set_numeric_standard(pTHX);
 PERL_CALLCONV void     Perl_set_numeric_local(pTHX);
 PERL_CALLCONV void     Perl_set_numeric_radix(pTHX);
 PERL_CALLCONV void     Perl_set_numeric_standard(pTHX);
-PERL_CALLCONV void     Perl_setdefout(pTHX_ GV* gv);
+PERL_CALLCONV void     Perl_setdefout(pTHX_ GV* gv)
+                       __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_SETDEFOUT     \
+       assert(gv)
+
 PERL_CALLCONV HEK*     Perl_share_hek(pTHX_ const char* str, I32 len, U32 hash)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_SHARE_HEK     \
 PERL_CALLCONV HEK*     Perl_share_hek(pTHX_ const char* str, I32 len, U32 hash)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_SHARE_HEK     \
@@ -3670,13 +3682,6 @@ PERL_CALLCONV PerlIO*    Perl_start_glob(pTHX_ SV *tmpglob, IO *io)
        assert(tmpglob); assert(io)
 
 PERL_CALLCONV I32      Perl_start_subparse(pTHX_ I32 is_format, U32 flags);
        assert(tmpglob); assert(io)
 
 PERL_CALLCONV I32      Perl_start_subparse(pTHX_ I32 is_format, U32 flags);
-PERL_CALLCONV bool     Perl_stashpv_hvname_match(pTHX_ const COP *c, const HV *hv)
-                       __attribute__warn_unused_result__
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
-#define PERL_ARGS_ASSERT_STASHPV_HVNAME_MATCH  \
-       assert(c); assert(hv)
-
 PERL_CALLCONV NV       Perl_str_to_version(pTHX_ SV *sv)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 PERL_CALLCONV NV       Perl_str_to_version(pTHX_ SV *sv)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
@@ -3847,23 +3852,6 @@ PERL_CALLCONV I32        Perl_sv_cmp(pTHX_ SV *const sv1, SV *const sv2);
 PERL_CALLCONV I32      Perl_sv_cmp_flags(pTHX_ SV *const sv1, SV *const sv2, const U32 flags);
 PERL_CALLCONV I32      Perl_sv_cmp_locale(pTHX_ SV *const sv1, SV *const sv2);
 PERL_CALLCONV I32      Perl_sv_cmp_locale_flags(pTHX_ SV *const sv1, SV *const sv2, const U32 flags);
 PERL_CALLCONV I32      Perl_sv_cmp_flags(pTHX_ SV *const sv1, SV *const sv2, const U32 flags);
 PERL_CALLCONV I32      Perl_sv_cmp_locale(pTHX_ SV *const sv1, SV *const sv2);
 PERL_CALLCONV I32      Perl_sv_cmp_locale_flags(pTHX_ SV *const sv1, SV *const sv2, const U32 flags);
-PERL_CALLCONV OP*      Perl_sv_compile_2op(pTHX_ SV *sv, OP **startop, const char *code, PAD **padp)
-                       __attribute__deprecated__
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2)
-                       __attribute__nonnull__(pTHX_3)
-                       __attribute__nonnull__(pTHX_4);
-#define PERL_ARGS_ASSERT_SV_COMPILE_2OP        \
-       assert(sv); assert(startop); assert(code); assert(padp)
-
-PERL_CALLCONV OP*      Perl_sv_compile_2op_is_broken(pTHX_ SV *sv, OP **startop, const char *code, PAD **padp)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2)
-                       __attribute__nonnull__(pTHX_3)
-                       __attribute__nonnull__(pTHX_4);
-#define PERL_ARGS_ASSERT_SV_COMPILE_2OP_IS_BROKEN      \
-       assert(sv); assert(startop); assert(code); assert(padp)
-
 PERL_CALLCONV void     Perl_sv_copypv(pTHX_ SV *const dsv, SV *const ssv)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 PERL_CALLCONV void     Perl_sv_copypv(pTHX_ SV *const dsv, SV *const ssv)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
@@ -3965,6 +3953,11 @@ PERL_CALLCONV char*      Perl_sv_gets(pTHX_ SV *const sv, PerlIO *const fp, I32 appen
 #define PERL_ARGS_ASSERT_SV_GETS       \
        assert(sv); assert(fp)
 
 #define PERL_ARGS_ASSERT_SV_GETS       \
        assert(sv); assert(fp)
 
+PERL_CALLCONV bool     Perl_sv_gmagical_2iv_please(pTHX_ SV *sv)
+                       __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_SV_GMAGICAL_2IV_PLEASE        \
+       assert(sv)
+
 PERL_CALLCONV char*    Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_SV_GROW       \
 PERL_CALLCONV char*    Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_SV_GROW       \
@@ -5496,6 +5489,15 @@ STATIC bool      S_grok_bslash_o(pTHX_ const char* s, UV* uv, STRLEN* len, const char
 #define PERL_ARGS_ASSERT_GROK_BSLASH_O \
        assert(s); assert(uv); assert(len); assert(error_msg)
 
 #define PERL_ARGS_ASSERT_GROK_BSLASH_O \
        assert(s); assert(uv); assert(len); assert(error_msg)
 
+PERL_STATIC_INLINE bool        S_grok_bslash_x(pTHX_ const char* s, UV* uv, STRLEN* len, const char** error_msg, const bool output_warning)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2)
+                       __attribute__nonnull__(pTHX_3)
+                       __attribute__nonnull__(pTHX_4);
+#define PERL_ARGS_ASSERT_GROK_BSLASH_X \
+       assert(s); assert(uv); assert(len); assert(error_msg)
+
 PERL_STATIC_INLINE I32 S_regcurly(pTHX_ const char *s)
                        __attribute__warn_unused_result__
                        __attribute__pure__
 PERL_STATIC_INLINE I32 S_regcurly(pTHX_ const char *s)
                        __attribute__warn_unused_result__
                        __attribute__pure__
@@ -6041,7 +6043,7 @@ STATIC OP*        S_do_smartmatch(pTHX_ HV* seen_this, HV* seen_other, const bool copie
 STATIC OP*     S_docatch(pTHX_ OP *o)
                        __attribute__warn_unused_result__;
 
 STATIC OP*     S_docatch(pTHX_ OP *o)
                        __attribute__warn_unused_result__;
 
-STATIC bool    S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq, HV* hh);
+STATIC bool    S_doeval(pTHX_ int gimme, CV* outside, U32 seq, HV* hh);
 STATIC OP*     S_dofindlabel(pTHX_ OP *o, const char *label, STRLEN len, U32 flags, OP **opstack, OP **oplimit)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
 STATIC OP*     S_dofindlabel(pTHX_ OP *o, const char *label, STRLEN len, U32 flags, OP **opstack, OP **oplimit)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
@@ -6709,12 +6711,16 @@ STATIC I32      S_reg_check_named_buff_matched(pTHX_ const regexp *rex, const regnode
 #define PERL_ARGS_ASSERT_REG_CHECK_NAMED_BUFF_MATCHED  \
        assert(rex); assert(scan)
 
 #define PERL_ARGS_ASSERT_REG_CHECK_NAMED_BUFF_MATCHED  \
        assert(rex); assert(scan)
 
-STATIC char*   S_regcppop(pTHX_ const regexp *rex)
+STATIC void    S_regcppop(pTHX_ regexp *rex)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_REGCPPOP      \
        assert(rex)
 
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_REGCPPOP      \
        assert(rex)
 
-STATIC CHECKPOINT      S_regcppush(pTHX_ I32 parenfloor);
+STATIC CHECKPOINT      S_regcppush(pTHX_ const regexp *rex, I32 parenfloor)
+                       __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_REGCPPUSH     \
+       assert(rex)
+
 STATIC U8*     S_reghop3(U8 *s, I32 off, const U8 *lim)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(1)
 STATIC U8*     S_reghop3(U8 *s, I32 off, const U8 *lim)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(1)
@@ -7076,7 +7082,7 @@ STATIC char*      S_scan_pat(pTHX_ char *start, I32 type)
 #define PERL_ARGS_ASSERT_SCAN_PAT      \
        assert(start)
 
 #define PERL_ARGS_ASSERT_SCAN_PAT      \
        assert(start)
 
-STATIC char*   S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims)
+STATIC char*   S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims, int re_reparse)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_SCAN_STR      \
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_SCAN_STR      \
@@ -7476,6 +7482,11 @@ PERL_CALLCONV I32        Perl_unlnk(pTHX_ const char* f)
 
 #endif
 #if defined(USE_ITHREADS)
 
 #endif
 #if defined(USE_ITHREADS)
+PERL_CALLCONV PADOFFSET        Perl_alloccopstash(pTHX_ HV *hv)
+                       __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_ALLOCCOPSTASH \
+       assert(hv)
+
 PERL_CALLCONV void*    Perl_any_dup(pTHX_ void* v, const PerlInterpreter* proto_perl)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_2);
 PERL_CALLCONV void*    Perl_any_dup(pTHX_ void* v, const PerlInterpreter* proto_perl)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_2);
@@ -7682,16 +7693,6 @@ PERL_CALLCONV SSize_t    Perl_PerlIO_write(pTHX_ PerlIO *f, const void *vbuf, Size_
        assert(vbuf)
 
 #endif
        assert(vbuf)
 
 #endif
-#if defined(USE_REENTRANT_API)
-PERL_CALLCONV void     Perl_reentrant_free(pTHX);
-PERL_CALLCONV void     Perl_reentrant_init(pTHX);
-PERL_CALLCONV void*    Perl_reentrant_retry(const char *f, ...)
-                       __attribute__nonnull__(1);
-#define PERL_ARGS_ASSERT_REENTRANT_RETRY       \
-       assert(f)
-
-PERL_CALLCONV void     Perl_reentrant_size(pTHX);
-#endif
 #if defined(WIN32) || defined(__SYMBIAN32__) || defined(VMS)
 PERL_CALLCONV int      Perl_do_aspawn(pTHX_ SV* really, SV** mark, SV** sp)
                        __attribute__nonnull__(pTHX_2)
 #if defined(WIN32) || defined(__SYMBIAN32__) || defined(VMS)
 PERL_CALLCONV int      Perl_do_aspawn(pTHX_ SV* really, SV** mark, SV** sp)
                        __attribute__nonnull__(pTHX_2)