This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
refactor pp_tied
[perl5.git] / proto.h
diff --git a/proto.h b/proto.h
index 1b0591a..eb60a4f 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -57,6 +57,25 @@ PERL_CALLCONV bool   Perl__is_utf8_FOO(pTHX_ const U8 classnum, const U8 *p)
 #define PERL_ARGS_ASSERT__IS_UTF8_FOO  \
        assert(p)
 
+PERL_STATIC_INLINE STRLEN      S__is_utf8_char_slow(const U8 *s, const U8 *e)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(2);
+#define PERL_ARGS_ASSERT__IS_UTF8_CHAR_SLOW    \
+       assert(s); assert(e)
+
+PERL_CALLCONV bool     Perl__is_utf8_idcont(pTHX_ const U8 *p)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT__IS_UTF8_IDCONT       \
+       assert(p)
+
+PERL_CALLCONV bool     Perl__is_utf8_idstart(pTHX_ const U8 *p)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT__IS_UTF8_IDSTART      \
+       assert(p)
+
 PERL_CALLCONV bool     Perl__is_utf8_mark(pTHX_ const U8 *p)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
@@ -75,6 +94,18 @@ PERL_CALLCONV bool   Perl__is_utf8_perl_idstart(pTHX_ const U8 *p)
 #define PERL_ARGS_ASSERT__IS_UTF8_PERL_IDSTART \
        assert(p)
 
+PERL_CALLCONV bool     Perl__is_utf8_xidcont(pTHX_ const U8 *p)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT__IS_UTF8_XIDCONT      \
+       assert(p)
+
+PERL_CALLCONV bool     Perl__is_utf8_xidstart(pTHX_ const U8 *p)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT__IS_UTF8_XIDSTART     \
+       assert(p)
+
 PERL_CALLCONV UV       Perl__to_uni_fold_flags(pTHX_ UV c, U8 *p, STRLEN *lenp, U8 flags)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
@@ -934,6 +965,12 @@ PERL_CALLCONV void Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o)
 #define PERL_ARGS_ASSERT_DO_OPEN       \
        assert(gv); assert(name)
 
+PERL_CALLCONV bool     Perl_do_open6(pTHX_ GV *gv, const char *oname, STRLEN len, PerlIO *supplied_fp, SV **svp, U32 num)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_DO_OPEN6      \
+       assert(gv); assert(oname)
+
 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)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
@@ -941,6 +978,12 @@ PERL_CALLCONV bool Perl_do_open9(pTHX_ GV *gv, const char *name, I32 len, int as
 #define PERL_ARGS_ASSERT_DO_OPEN9      \
        assert(gv); assert(name); assert(svs)
 
+PERL_CALLCONV bool     Perl_do_open_raw(pTHX_ GV *gv, const char *oname, STRLEN len, int rawmode, int rawperm)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_DO_OPEN_RAW   \
+       assert(gv); assert(oname)
+
 PERL_CALLCONV bool     Perl_do_openn(pTHX_ GV *gv, const char *oname, I32 len, int as_raw, int rawmode, int rawperm, PerlIO *supplied_fp, SV **svp, I32 num)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
@@ -1750,7 +1793,7 @@ PERL_CALLCONV bool        Perl_io_close(pTHX_ IO* io, bool not_implicit)
 #define PERL_ARGS_ASSERT_IO_CLOSE      \
        assert(io)
 
-PERL_STATIC_INLINE bool        S_isALNUM_lazy(pTHX_ const char* p)
+PERL_CALLCONV bool     Perl_isALNUM_lazy(pTHX_ const char* p)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__
@@ -1758,7 +1801,7 @@ PERL_STATIC_INLINE bool   S_isALNUM_lazy(pTHX_ const char* p)
 #define PERL_ARGS_ASSERT_ISALNUM_LAZY  \
        assert(p)
 
-PERL_STATIC_INLINE bool        S_isIDFIRST_lazy(pTHX_ const char* p)
+PERL_CALLCONV bool     Perl_isIDFIRST_lazy(pTHX_ const char* p)
                        __attribute__deprecated__
                        __attribute__warn_unused_result__
                        __attribute__pure__
@@ -1973,9 +2016,9 @@ PERL_CALLCONV STRLEN      Perl_is_utf8_char(const U8 *s)
 #define PERL_ARGS_ASSERT_IS_UTF8_CHAR  \
        assert(s)
 
-PERL_CALLCONV STRLEN   Perl_is_utf8_char_buf(const U8 *buf, const U8 *buf_end)
+/* PERL_CALLCONV STRLEN        Perl_is_utf8_char_buf(const U8 *buf, const U8 *buf_end)
                        __attribute__nonnull__(1)
-                       __attribute__nonnull__(2);
+                       __attribute__nonnull__(2); */
 #define PERL_ARGS_ASSERT_IS_UTF8_CHAR_BUF      \
        assert(buf); assert(buf_end)
 
@@ -3052,7 +3095,7 @@ PERL_CALLCONV void        Perl_op_clear(pTHX_ OP* o)
 #define PERL_ARGS_ASSERT_OP_CLEAR      \
        assert(o)
 
-PERL_CALLCONV SV*      Perl_op_const_sv(pTHX_ const OP* o)
+PERL_CALLCONV SV*      Perl_op_const_sv(pTHX_ const OP* o, CV* cv)
                        __attribute__warn_unused_result__;
 
 PERL_CALLCONV OP*      Perl_op_contextualize(pTHX_ OP* o, I32 context)
@@ -5483,6 +5526,12 @@ PERL_CALLCONV void       Perl_parser_free_nexttoke_ops(pTHX_ yy_parser *parser, OPSLAB
 #define PERL_ARGS_ASSERT_PARSER_FREE_NEXTTOKE_OPS      \
        assert(parser); assert(slab)
 
+PERL_STATIC_INLINE bool        S_should_warn_nl(const char *pv)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(1);
+#define PERL_ARGS_ASSERT_SHOULD_WARN_NL        \
+       assert(pv)
+
 #  if defined(PERL_DEBUG_READONLY_OPS)
 PERL_CALLCONV void     Perl_Slab_to_ro(pTHX_ OPSLAB *slab)
                        __attribute__nonnull__(pTHX_1);
@@ -5712,6 +5761,14 @@ STATIC void      S_exec_failed(pTHX_ const char *cmd, int fd, int do_report)
 STATIC bool    S_ingroup(pTHX_ Gid_t testgid, bool effective)
                        __attribute__warn_unused_result__;
 
+STATIC bool    S_openn_cleanup(pTHX_ GV *gv, IO *io, PerlIO *fp, char *mode, const char *oname, PerlIO *saveifp, PerlIO *saveofp, int savefd, char savetype, int writing, bool was_fdopen, const char *type)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2)
+                       __attribute__nonnull__(pTHX_4)
+                       __attribute__nonnull__(pTHX_5);
+#define PERL_ARGS_ASSERT_OPENN_CLEANUP \
+       assert(gv); assert(io); assert(mode); assert(oname)
+
 STATIC IO *    S_openn_setup(pTHX_ GV *gv, char *mode, PerlIO **saveifp, PerlIO **saveofp, int *savefd, char *savetype)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
@@ -6616,6 +6673,12 @@ PERL_STATIC_INLINE UV*   S__invlist_array_init(pTHX_ SV* const invlist, const bool
 #define PERL_ARGS_ASSERT__INVLIST_ARRAY_INIT   \
        assert(invlist)
 
+STATIC void    S_add_above_Latin1_folds(pTHX_ RExC_state_t *pRExC_state, const U8 cp, SV** invlist)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_3);
+#define PERL_ARGS_ASSERT_ADD_ABOVE_LATIN1_FOLDS        \
+       assert(pRExC_state); assert(invlist)
+
 PERL_STATIC_INLINE SV* S_add_cp_to_invlist(pTHX_ SV* invlist, const UV cp)
                        __attribute__warn_unused_result__;
 
@@ -6638,6 +6701,12 @@ PERL_STATIC_INLINE U8    S_compute_EXACTish(pTHX_ RExC_state_t *pRExC_state)
 #define PERL_ARGS_ASSERT_COMPUTE_EXACTISH      \
        assert(pRExC_state)
 
+STATIC regnode *       S_construct_ahocorasick_from_trie(pTHX_ RExC_state_t *pRExC_state, regnode *source, U32 depth)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_CONSTRUCT_AHOCORASICK_FROM_TRIE       \
+       assert(pRExC_state); assert(source)
+
 STATIC bool    S_could_it_be_a_POSIX_class(pTHX_ RExC_state_t *pRExC_state)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_COULD_IT_BE_A_POSIX_CLASS     \
@@ -6765,13 +6834,6 @@ STATIC I32       S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, re
 #define PERL_ARGS_ASSERT_MAKE_TRIE     \
        assert(pRExC_state); assert(startbranch); assert(first); assert(last); assert(tail)
 
-STATIC void    S_make_trie_failtable(pTHX_ RExC_state_t *pRExC_state, regnode *source, regnode *stclass, U32 depth)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2)
-                       __attribute__nonnull__(pTHX_3);
-#define PERL_ARGS_ASSERT_MAKE_TRIE_FAILTABLE   \
-       assert(pRExC_state); assert(source); assert(stclass)
-
 STATIC char *  S_nextchar(pTHX_ RExC_state_t *pRExC_state)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_NEXTCHAR      \
@@ -6816,10 +6878,11 @@ STATIC SV *     S_reg_scan_name(pTHX_ RExC_state_t *pRExC_state, U32 flags)
 #define PERL_ARGS_ASSERT_REG_SCAN_NAME \
        assert(pRExC_state)
 
-STATIC bool    S_reg_skipcomment(pTHX_ RExC_state_t *pRExC_state)
-                       __attribute__nonnull__(pTHX_1);
+PERL_STATIC_INLINE char *      S_reg_skipcomment(pTHX_ RExC_state_t *pRExC_state, char * p)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_REG_SKIPCOMMENT       \
-       assert(pRExC_state)
+       assert(pRExC_state); assert(p)
 
 STATIC regnode*        S_reganode(pTHX_ RExC_state_t *pRExC_state, U8 op, U32 arg)
                        __attribute__nonnull__(pTHX_1);
@@ -6850,10 +6913,10 @@ STATIC void     S_reginsert(pTHX_ RExC_state_t *pRExC_state, U8 op, regnode *opnd, U
 #define PERL_ARGS_ASSERT_REGINSERT     \
        assert(pRExC_state); assert(opnd)
 
-STATIC char *  S_regpatws(RExC_state_t *pRExC_state, char *p, const bool recognize_comment)
+STATIC char *  S_regpatws(pTHX_ RExC_state_t *pRExC_state, char *p, const bool recognize_comment)
                        __attribute__warn_unused_result__
-                       __attribute__nonnull__(1)
-                       __attribute__nonnull__(2);
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_REGPATWS      \
        assert(pRExC_state); assert(p)
 
@@ -6881,13 +6944,6 @@ PERL_STATIC_INLINE STRLEN        S_reguni(pTHX_ const RExC_state_t *pRExC_state, UV uv,
 #define PERL_ARGS_ASSERT_REGUNI        \
        assert(pRExC_state); assert(s)
 
-STATIC char *  S_regwhite(RExC_state_t *pRExC_state, char *p)
-                       __attribute__warn_unused_result__
-                       __attribute__nonnull__(1)
-                       __attribute__nonnull__(2);
-#define PERL_ARGS_ASSERT_REGWHITE      \
-       assert(pRExC_state); assert(p)
-
 STATIC void    S_scan_commit(pTHX_ const RExC_state_t *pRExC_state, struct scan_data_t *data, SSize_t *minlenp, int is_inf)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
@@ -7005,6 +7061,7 @@ PERL_CALLCONV SV* Perl__get_regclass_nonbitmap_data(pTHX_ const regexp *prog, co
 #define PERL_ARGS_ASSERT__GET_REGCLASS_NONBITMAP_DATA  \
        assert(node)
 
+PERL_CALLCONV void     Perl__load_PL_utf8_foldclosures(pTHX);
 #endif
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C)
 PERL_CALLCONV SV*      Perl__get_swash_invlist(pTHX_ SV* const swash)
@@ -7325,11 +7382,6 @@ STATIC void      S_not_a_number(pTHX_ SV *const sv)
 #define PERL_ARGS_ASSERT_NOT_A_NUMBER  \
        assert(sv)
 
-STATIC void    S_not_incrementable(pTHX_ SV *const sv)
-                       __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_NOT_INCREMENTABLE     \
-       assert(sv)
-
 STATIC PTR_TBL_ENT_t * S_ptr_table_find(PTR_TBL_t *const tbl, const void *const sv)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(1);
@@ -7346,12 +7398,6 @@ STATIC void      S_sv_add_arena(pTHX_ char *const ptr, const U32 size, const U32 flag
 #define PERL_ARGS_ASSERT_SV_ADD_ARENA  \
        assert(ptr)
 
-STATIC const char *    S_sv_display(pTHX_ SV *const sv, char *tmpbuf, STRLEN tmpbuf_size)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
-#define PERL_ARGS_ASSERT_SV_DISPLAY    \
-       assert(sv); assert(tmpbuf)
-
 STATIC STRLEN  S_sv_pos_b2u_midway(pTHX_ const U8 *const s, const U8 *const target, const U8 *end, STRLEN endu)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
@@ -7676,12 +7722,6 @@ STATIC UV        S_check_locale_boundary_crossing(pTHX_ const U8* const p, const UV res
 #define PERL_ARGS_ASSERT_CHECK_LOCALE_BOUNDARY_CROSSING        \
        assert(p); assert(ustrp); assert(lenp)
 
-PERL_STATIC_INLINE STRLEN      S_is_utf8_char_slow(const U8 *s, const STRLEN len)
-                       __attribute__warn_unused_result__
-                       __attribute__nonnull__(1);
-#define PERL_ARGS_ASSERT_IS_UTF8_CHAR_SLOW     \
-       assert(s)
-
 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__
                        __attribute__nonnull__(pTHX_1)
@@ -7690,6 +7730,17 @@ PERL_STATIC_INLINE bool  S_is_utf8_common(pTHX_ const U8 *const p, SV **swash, co
 #define PERL_ARGS_ASSERT_IS_UTF8_COMMON        \
        assert(p); assert(swash); assert(swashname)
 
+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__
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2)
+                       __attribute__nonnull__(pTHX_3)
+                       __attribute__nonnull__(pTHX_4)
+                       __attribute__nonnull__(pTHX_5)
+                       __attribute__nonnull__(pTHX_7);
+#define PERL_ARGS_ASSERT_SWASH_SCAN_LIST_LINE  \
+       assert(l); assert(lend); assert(min); assert(max); assert(val); assert(typestr)
+
 STATIC SV*     S_swatch_get(pTHX_ SV* swash, UV start, UV span)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);