This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Improve handling of nested qr/(?[...])/
[perl5.git] / embed.fnc
index 76ec0c0..e8ed893 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -91,9 +91,9 @@
 : The E flag is used instead for a function and its short name that is supposed
 :            to be used only in the core, and in extensions compiled with the
 :            PERL_EXT symbol defined.  Again, on some platforms, the function
-:            will be visible everywhere, so the 'p' flag is gnerally needed.
-:            Also note that an XS writer can always cheat and pretend to be an
-:            extension by #defining PERL_EXT.
+:            will be visible everywhere, so one of the 'p' or 'S' flags is
+:            generally needed.  Also note that an XS writer can always cheat
+:            and pretend to be an extension by #defining PERL_EXT.
 :
 : The X flag is similar to the C flag in that the function (whose entry better
 :           have the 'p' flag) is accessible everywhere on all platforms.
@@ -785,6 +785,7 @@ p   |void   |dump_sub_perl  |NN const GV* gv|bool justperl
 Apd    |void   |fbm_compile    |NN SV* sv|U32 flags
 ApdR   |char*  |fbm_instr      |NN unsigned char* big|NN unsigned char* bigend \
                                |NN SV* littlestr|U32 flags
+pEXTR  |const char *|cntrl_to_mnemonic|const U8 c
 p      |CV *   |find_lexical_cv|PADOFFSET off
 : Defined in util.c, used only in perl.c
 p      |char*  |find_script    |NN const char *scriptname|bool dosearch \
@@ -1135,35 +1136,60 @@ Ap      |void   |vload_module|U32 flags|NN SV* name|NULLOK SV* ver|NULLOK va_list* args
 : Used in perly.y
 p      |OP*    |localize       |NN OP *o|I32 lex
 ApdR   |I32    |looks_like_number|NN SV *const sv
-Apd    |UV     |grok_bin       |NN const char* start|NN STRLEN* len_p|NN I32* flags|NULLOK NV *result
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) || defined(PERL_IN_DQUOTE_C)
-EpRX   |bool   |grok_bslash_x  |NN char** s             \
-                               |NN const char* const send       \
-                               |NN UV* uv                       \
-                               |NN const char** error_msg       \
-                               |const bool output_warning       \
-                               |const bool strict               \
-                               |const bool silence_non_portable \
+EpRX   |bool   |grok_bslash_x  |NN char** s                    \
+                               |NN const char* const send      \
+                               |NN UV* uv                      \
+                               |NN const char** message        \
+                               |NULLOK U32 * packed_warn       \
+                               |const bool strict              \
+                               |const bool allow_UV_MAX        \
                                |const bool utf8
-EpRX   |char   |grok_bslash_c  |const char source|const bool output_warning
-EpRX   |bool   |grok_bslash_o  |NN char** s             \
-                               |NN const char* const send       \
-                               |NN UV* uv                       \
-                               |NN const char** error_msg       \
-                               |const bool output_warning       \
-                               |const bool strict               \
-                               |const bool silence_non_portable \
+EpRX   |bool   |grok_bslash_c  |const char source              \
+                               |NN U8 * result                 \
+                               |NN const char** message        \
+                               |NULLOK U32 * packed_warn
+EpRX   |bool   |grok_bslash_o  |NN char** s                    \
+                               |NN const char* const send      \
+                               |NN UV* uv                      \
+                               |NN const char** message        \
+                               |NULLOK U32 * packed_warn       \
+                               |const bool strict              \
+                               |const bool allow_UV_MAX        \
                                |const bool utf8
-EiR    |char*|form_short_octal_warning|NN const char * const s  \
-                               |const STRLEN len
-EiRT   |I32    |regcurly       |NN const char *s
-#endif
-Apd    |UV     |grok_hex       |NN const char* start|NN STRLEN* len_p|NN I32* flags|NULLOK NV *result
+EpRX   |const char *|form_alien_digit_msg|const U8 which       \
+                               |const STRLEN valids_len        \
+                               |NN const char * const first_bad\
+                               |NN const char * const send     \
+                               |const bool UTF                 \
+                               |const bool braced
+#endif
+#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C)
+EiRT   |bool   |regcurly       |NN const char *s
+#endif
+#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) || defined(PERL_IN_DQUOTE_C) || defined(PERL_IN_UTF8_C)
+EpRX   |const char *|form_cp_too_large_msg|const U8 which      \
+                               |NULLOK const char * string     \
+                               |const Size_t len               \
+                               |const UV cp
+#endif
+AMpd   |UV     |grok_hex       |NN const char* start|NN STRLEN* len_p|NN I32* flags|NULLOK NV *result
 Apd    |int    |grok_infnan    |NN const char** sp|NN const char *send
 Apd    |int    |grok_number    |NN const char *pv|STRLEN len|NULLOK UV *valuep
 Apd    |int    |grok_number_flags|NN const char *pv|STRLEN len|NULLOK UV *valuep|U32 flags
 ApdR   |bool   |grok_numeric_radix|NN const char **sp|NN const char *send
-Apd    |UV     |grok_oct       |NN const char* start|NN STRLEN* len_p|NN I32* flags|NULLOK NV *result
+ApMd   |UV     |grok_oct       |NN const char* start|NN STRLEN* len_p|NN I32* flags|NULLOK NV *result
+ApMd   |UV     |grok_bin       |NN const char* start|NN STRLEN* len_p|NN I32* flags|NULLOK NV *result
+Cp     |UV     |grok_bin_oct_hex|NN const char* start                      \
+                                |NN STRLEN* len_p                          \
+                                |NN I32* flags                             \
+                                |NULLOK NV *result                         \
+                                |const unsigned shift                      \
+                                |const U8 lookup_bit                       \
+                                |const char prefix
+#ifdef PERL_IN_NUMERIC_C
+S      |void   |output_non_portable|const U8 shift
+#endif
 EXpdT  |bool   |grok_atoUV     |NN const char* pv|NN UV* valptr|NULLOK const char** endptr
 : These are all indirectly referenced by globals.c. This is somewhat annoying.
 p      |int    |magic_clearenv |NN SV* sv|NN MAGIC* mg
@@ -1595,7 +1621,7 @@ p |void   |rxres_save     |NN void **rsp|NN REGEXP *rx
 p      |I32    |same_dirent    |NN const char* a|NN const char* b
 #endif
 Apda   |char*  |savepv         |NULLOK const char* pv
-Apda   |char*  |savepvn        |NULLOK const char* pv|I32 len
+Apda   |char*  |savepvn        |NULLOK const char* pv|Size_t len
 Apda   |char*  |savesharedpv   |NULLOK const char* pv
 
 : NULLOK only to suppress a compiler warning
@@ -1683,14 +1709,19 @@ Axpd    |OP*    |op_scope       |NULLOK OP* o
 pe     |void   |set_caret_X
 Apd    |void   |setdefout      |NN GV* gv
 Ap     |HEK*   |share_hek      |NN const char* str|SSize_t len|U32 hash
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
+#ifdef PERL_USE_3ARG_SIGHANDLER
 : Used in perl.c
-Tp     |Signal_t |sighandler   |int sig|NULLOK siginfo_t *info|NULLOK void *uap
-ATp    |Signal_t |csighandler  |int sig|NULLOK siginfo_t *info|NULLOK void *uap
+Tp     |Signal_t |sighandler   |int sig|NULLOK Siginfo_t *info|NULLOK void *uap
+ATp    |Signal_t |csighandler  |int sig|NULLOK Siginfo_t *info|NULLOK void *uap
 #else
 Tp     |Signal_t |sighandler   |int sig
 ATp    |Signal_t |csighandler  |int sig
 #endif
+Tp     |Signal_t |sighandler1  |int sig
+ATp    |Signal_t |csighandler1 |int sig
+Tp     |Signal_t |sighandler3  |int sig|NULLOK Siginfo_t *info|NULLOK void *uap
+ATp    |Signal_t |csighandler3 |int sig|NULLOK Siginfo_t *info|NULLOK void *uap
+ATp    |Signal_t |perly_sighandler     |int sig|NULLOK Siginfo_t *info|NULLOK void *uap|bool safe
 Ap     |SV**   |stack_grow     |NN SV** sp|NN SV** p|SSize_t n
 Ap     |I32    |start_subparse |I32 is_format|U32 flags
 Xp     |void   |init_named_cv  |NN CV *cv|NN OP *nameop
@@ -1772,6 +1803,7 @@ ApdR      |bool   |sv_derived_from_sv|NN SV* sv|NN SV *namesv|U32 flags
 ApdR   |bool   |sv_derived_from_pv|NN SV* sv|NN const char *const name|U32 flags
 ApdR   |bool   |sv_derived_from_pvn|NN SV* sv|NN const char *const name \
                                     |const STRLEN len|U32 flags
+ApdRx  |bool   |sv_isa_sv      |NN SV* sv|NN SV* namesv
 ApdR   |bool   |sv_does        |NN SV* sv|NN const char *const name
 ApdR   |bool   |sv_does_sv     |NN SV* sv|NN SV* namesv|U32 flags
 ApdR   |bool   |sv_does_pv     |NN SV* sv|NN const char *const name|U32 flags
@@ -1868,13 +1900,13 @@ Apd     |void   |sv_vsetpvfn    |NN SV *const sv|NN const char *const pat|const STRLEN pa
                                |NULLOK va_list *const args|NULLOK SV **const svargs \
                                |const Size_t sv_count|NULLOK bool *const maybe_tainted
 ApR    |NV     |str_to_version |NN SV *sv
-EXpR   |SV*    |swash_init     |NN const char* pkg|NN const char* name|NN SV* listsv|I32 minbits|I32 none
-EXp    |UV     |swash_fetch    |NN SV *swash|NN const U8 *ptr|bool do_utf8
 #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_OP_C) || defined(PERL_IN_DOOP_C)
 EiR    |SV*    |add_cp_to_invlist      |NULLOK SV* invlist|const UV cp
 Ei     |void   |invlist_extend    |NN SV* const invlist|const UV len
 Ei     |void   |invlist_set_len|NN SV* const invlist|const UV len|const bool offset
 EiRT   |UV     |invlist_highest|NN SV* const invlist
+#endif
+#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_OP_C)
 EiRT   |STRLEN*|get_invlist_iter_addr  |NN SV* invlist
 EiT    |void   |invlist_iterinit|NN SV* invlist
 EiRT   |bool   |invlist_iternext|NN SV* invlist|NN UV* start|NN UV* end
@@ -1884,6 +1916,7 @@ EiT       |void   |invlist_iterfinish|NN SV* invlist
 EiRT   |bool   |invlist_is_iterating|NN SV* const invlist
 EiR    |SV*    |invlist_contents|NN SV* const invlist              \
                                 |const bool traditional_style
+EixRT  |UV     |invlist_lowest|NN SV* const invlist
 #ifndef PERL_EXT_RE_BUILD
 EiRT   |UV*    |_invlist_array_init    |NN SV* const invlist|const bool will_have_0
 EiRT   |UV     |invlist_max    |NN SV* const invlist
@@ -1950,7 +1983,7 @@ EXp       |void   |_invlist_dump  |NN PerlIO *file|I32 level   \
 #endif
 Ap     |void   |taint_env
 Ap     |void   |taint_proper   |NULLOK const char* f|NN const char *const s
-E    |char * |_byte_dump_string                                      \
+EXp    |char * |_byte_dump_string                                      \
                                |NN const U8 * const start              \
                                |const STRLEN len                       \
                                |const bool format
@@ -1979,8 +2012,8 @@ S |UV     |_to_utf8_case  |const UV uv1                                   \
                                |NN U8* ustrp                                   \
                                |NN STRLEN *lenp                                \
                                |NN SV *invlist                                 \
-                               |NN const int * const invmap                    \
-                               |NULLOK const unsigned int * const * const aux_tables   \
+                               |NN const I32 * const invmap                    \
+                               |NULLOK const U32 * const * const aux_tables    \
                                |NULLOK const U8 * const aux_table_lengths      \
                                |NN const char * const normal
 S      |UV     |turkic_fc      |NN const U8 * const p |NN const U8 * const e|NN U8* ustrp|NN STRLEN *lenp
@@ -2017,8 +2050,8 @@ p |void   |utilize        |int aver|I32 floor|NULLOK OP* version|NN OP* idop|NULLOK OP* a
 Cp     |void   |_force_out_malformed_utf8_message                          \
                |NN const U8 *const p|NN const U8 * const e|const U32 flags \
                |const bool die_here
-EXp    |U8*    |utf16_to_utf8  |NN U8* p|NN U8 *d|I32 bytelen|NN I32 *newlen
-EXp    |U8*    |utf16_to_utf8_reversed|NN U8* p|NN U8 *d|I32 bytelen|NN I32 *newlen
+EXp    |U8*    |utf16_to_utf8  |NN U8* p|NN U8 *d|Size_t bytelen|NN Size_t *newlen
+EXp    |U8*    |utf16_to_utf8_reversed|NN U8* p|NN U8 *d|Size_t bytelen|NN Size_t *newlen
 AdpR   |STRLEN |utf8_length    |NN const U8* s|NN const U8 *e
 AipdR  |IV     |utf8_distance  |NN const U8 *a|NN const U8 *b
 AipdRT |U8*    |utf8_hop       |NN const U8 *s|SSize_t off
@@ -2077,8 +2110,8 @@ Cdp       |U8*    |uvuni_to_utf8_flags    |NN U8 *d|UV uv|UV flags
 Apd    |char*  |pv_uni_display |NN SV *dsv|NN const U8 *spv|STRLEN len|STRLEN pvlim|UV flags
 ApdR   |char*  |sv_uni_display |NN SV *dsv|NN SV *ssv|STRLEN pvlim|UV flags
 EXpR   |Size_t |_inverse_folds |const UV cp                                \
-                               |NN unsigned int * first_folds_to           \
-                               |NN const unsigned int ** remaining_folds_to
+                               |NN U32 * first_folds_to                    \
+                               |NN const U32 ** remaining_folds_to
 : Used by Data::Alias
 EXp    |void   |vivify_defelem |NN SV* sv
 : Used in pp.c
@@ -2550,6 +2583,8 @@ ES        |regnode_offset|regnode_guts|NN RExC_state_t *pRExC_state          \
 ES     |void   |change_engine_size|NN RExC_state_t *pRExC_state|const Ptrdiff_t size
 ES     |regnode_offset|reganode|NN RExC_state_t *pRExC_state|U8 op \
                                |U32 arg
+ES     |regnode_offset|regpnode|NN RExC_state_t *pRExC_state|U8 op \
+                               |NN void * arg
 ES     |regnode_offset|reg2Lanode|NN RExC_state_t *pRExC_state            \
                                |const U8 op                               \
                                |const U32 arg1                            \
@@ -2566,6 +2601,7 @@ ES        |void    |set_ANYOF_arg |NN RExC_state_t* const pRExC_state \
 ES     |void   |output_posix_warnings                                      \
                                |NN RExC_state_t *pRExC_state               \
                                |NN AV* posix_warnings
+EiT    |Size_t  |find_first_differing_byte_pos|NN const U8 * s1|NN const U8 * s2| const Size_t max
 ES     |AV*     |add_multi_match|NULLOK AV* multi_char_matches             \
                                |NN SV* multi_string                        \
                                |const STRLEN cp_count
@@ -2681,14 +2717,13 @@ ES      |I32    |make_trie      |NN RExC_state_t *pRExC_state \
                                |U32 word_count|U32 flags|U32 depth
 ES     |regnode *|construct_ahocorasick_from_trie|NN RExC_state_t *pRExC_state \
                                 |NN regnode *source|U32 depth
-ETSR   |const char *|cntrl_to_mnemonic|const U8 c
 ETSR   |int    |edit_distance  |NN const UV *src                   \
                                |NN const UV *tgt                   \
                                |const STRLEN x                     \
                                |const STRLEN y                     \
                                |const SSize_t maxDistance
 EpX    |SV *   |parse_uniprop_string|NN const char * const name            \
-                                    |const Size_t name_len                 \
+                                    |Size_t name_len                       \
                                     |const bool is_utf8                    \
                                     |const bool to_fold                    \
                                     |const bool runtime                    \
@@ -2721,6 +2756,7 @@ ES        |bool   |put_charclass_bitmap_innards|NN SV* sv             \
                                |NULLOK SV* nonbitmap_invlist       \
                                |NULLOK SV* only_utf8_locale_invlist\
                                |NULLOK const regnode * const node  \
+                               |const U8 flags                     \
                                |const bool force_as_is_display
 ES     |SV*    |put_charclass_bitmap_innards_common                \
                                |NN SV* invlist                     \
@@ -2752,8 +2788,8 @@ ESR       |bool   |regtail_study  |NN RExC_state_t *pRExC_state \
 EXRp   |bool   |isFOO_lc       |const U8 classnum|const U8 character
 #endif
 
-#if defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_TOKE_C)
-ERp    |bool   |_is_grapheme   |NN const U8 * strbeg|NN const U8 * s|NN const U8 *strend|const UV cp
+#if defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C)
+ERp    |bool   |is_grapheme    |NN const U8 * strbeg|NN const U8 * s|NN const U8 *strend|const UV cp
 #endif
 
 #if defined(PERL_IN_REGEXEC_C)
@@ -2928,6 +2964,10 @@ EXpR     |SV*    |get_and_check_backslash_N_name|NN const char* s        \
                                |NN const char* const e                 \
                                |const bool is_utf8                     \
                                |NN const char** error_msg
+EXpR   |HV*    |load_charnames |NN SV * char_name                      \
+                               |NN const char * context                \
+                               |const STRLEN context_len               \
+                               |NN const char ** error_msg
 
 : For use ONLY in B::Hooks::Parser, by special dispensation
 EXpxR  |char*  |scan_str       |NN char *start|int keep_quoted \
@@ -3004,7 +3044,11 @@ EdXxp    |bool   |validate_proto |NN SV *name|NULLOK SV *proto|bool warn \
 #if defined(PERL_IN_UNIVERSAL_C)
 SG     |bool   |isa_lookup     |NULLOK HV *stash|NULLOK SV *namesv|NULLOK const char * name \
                                         |STRLEN len|U32 flags
-SG   |bool   |sv_derived_from_svpvn  |NULLOK SV *sv|NULLOK SV *namesv|NULLOK const char * name|STRLEN len|U32 flags
+SG   |bool   |sv_derived_from_svpvn  |NULLOK SV *sv                    \
+                                    |NULLOK SV *namesv                 \
+                                    |NULLOK const char * name          \
+                                    |const STRLEN len                  \
+                                    |U32 flags
 #endif
 
 #if defined(PERL_IN_LOCALE_C)
@@ -3093,10 +3137,6 @@ SR       |UV     |check_locale_boundary_crossing                             \
 iR     |bool   |is_utf8_common |NN const U8 *const p                       \
                                |NN const U8 *const e                       \
                                |NULLOK SV* const invlist
-SR     |SV*    |swatch_get     |NN SV* swash|UV start|UV span
-SR     |U8*    |swash_scan_list_line|NN U8* l|NN U8* const lend|NN UV* min \
-               |NN UV* max|NN UV* val|const bool wants_value               \
-               |NN const U8* const typestr
 #endif
 
 EXiTp  |void   |append_utf8_from_native_byte|const U8 byte|NN U8** dest
@@ -3316,8 +3356,8 @@ XEopxR    |STRLEN *|new_warnings_bitfield|NULLOK STRLEN *buffer \
 AMpTdf |int    |my_snprintf    |NN char *buffer|const Size_t len|NN const char *format|...
 AMpTd  |int    |my_vsnprintf   |NN char *buffer|const Size_t len|NN const char *format|va_list ap
 #ifdef USE_QUADMATH
-ApTd   |const char*    |quadmath_format_single|NN const char* format
-ApTd   |bool|quadmath_format_needed|NN const char* format
+pTd    |bool   |quadmath_format_valid|NN const char* format
+pTd    |bool|quadmath_format_needed|NN const char* format
 #endif
 
 : Used in mg.c, sv.c
@@ -3347,7 +3387,7 @@ ApTd      |Size_t |my_strlcpy     |NULLOK char *dst|NULLOK const char *src|Size_t siz
 #endif
 
 #ifndef HAS_STRNLEN
-ApTd   |Size_t |my_strnlen     |NN const char *str|Size_t maxlen
+AipTd  |Size_t |my_strnlen     |NN const char *str|Size_t maxlen
 #endif
 
 #ifndef HAS_MKOSTEMP
@@ -3358,7 +3398,7 @@ pTo       |int    |my_mkstemp     |NN char *templte
 #endif
 
 APpdT  |bool   |isinfnan       |NV nv
-p      |bool   |isinfnansv     |NN SV *sv
+pd     |bool   |isinfnansv     |NN SV *sv
 
 #if !defined(HAS_SIGNBIT)
 AxdToP |int    |Perl_signbit   |NV f