This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
For Perl_magic_methcall() add G_UNDEF_FILL to fill the stack with &PL_sv_undef.
[perl5.git] / embed.fnc
index 47dfa42..b48f95e 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1,5 +1,7 @@
 : BEGIN {die "You meant to run embed.pl"} # Stop early if fed to perl.
 :
+: This file is processed by embed.pl and autodoc.pl
+:
 : Lines are of the form:
 :    flags|return_type|function_name|arg1|arg2|...|argN
 :
 : Leading and trailing whitespace will be ignored in each component.
 :
 : flags are single letters with following meanings:
-:      A               member of public API
-:      m               Implemented as a macro - no export, no
-:                      proto, no #define
-:      d               function has documentation with its source
-:      D               function is deprecated
-:      s               static function, should have an S_ prefix in
-:                      source file; for macros (m), suffix the usage
-:                      example with a semicolon
-:      n               has no implicit interpreter/thread context argument
-:      p               function has a Perl_ prefix
-:      f               function takes printf style format string, varargs
-:      r               function never returns
-:      o               has no compatibility macro (#define foo Perl_foo)
-:      x               not exported
-:      X               explicitly exported
-:      M               may change
-:      E               visible to extensions included in the Perl core
-:      b               binary backward compatibility; function is a macro
-:                      but has also Perl_ implementation (which is exported)
-:      U               suppress usage example in autogenerated documentation
-:      a               allocates memory a la malloc/calloc.  Is also "R".
-:      R               Return value must not be ignored.
-:      P               pure function: no effects except the return value;
-:                      return value depends only on parms and/or globals
+:
+:   A  Member of public API:
+:
+:         add entry to global.sym (unless x or m);
+:         any doc entry goes in perlapi.pod rather than perlintern.api
+:         makes '#define foo Perl_foo' scope not just for PERL_CORE/PERL_EXT
+:
+:   a  Allocates memory a la malloc/calloc.  Also implies "R":
+:
+:         proto.h: add __attribute__malloc__
+:
+:   b  Binary backward compatibility; function is a macro
+:      but has also Perl_ implementation (which is exported):
+:
+:         add entry to global.sym;
+:         don't define PERL_ARGS_ASSERT_FOO
+:
+:   D  Function is deprecated:
+:
+:         proto.h: add __attribute__deprecated__
+:
+:   d  Function has documentation with its source:
+:
+:         enables 'no docs for foo" warning in autodoc.pl
+:
+:   E  Visible to extensions included in the Perl core:
+:
+:         in embed.h, change "#ifdef PERL_CORE"
+:         into               "#if defined(PERL_CORE) || defined(PERL_EXT)"
+:
+:      Should always be combined with "X" to be usable from dynamically
+:      loaded extensions.
+:
+:   f  Function takes printf style format string, varargs:
+:
+:         proto.h: add __attribute__format__ (or ...null_ok__)
+:
+:   M  May change:
+:
+:         (currently no effect)
+:
+:   m  Implemented as a macro:
+:
+:         suppress proto.h entry
+:         suppress global.sym entry
+:         suppress embed.h entry
+:
+:   n  Has no implicit interpreter/thread context argument:
+:
+:         suppress the pTHX part of "foo(pTHX...)" in proto.h;
+:         In the PERL_IMPLICIT_SYS branch of embed.h, generates
+:             "#define foo Perl_foo",      rather than
+:             "#define foo(a,b,c) Perl_foo(aTHX_ a,b,c)
+:
+:   o  Has no Perl_foo compatibility macro:
+:
+:         embed.h: suppress "#define foo Perl_foo"
+:
+:   P  Pure function: no effects except the return value;
+:      return value depends only on params and/or globals:
+:
+:         proto.h: add __attribute__pure__
+:
+:   p  Function in source code has a Perl_ prefix:
+:
+:         proto.h: function is declared as Perl_foo rather than foo
+:         embed.h: "#define foo Perl_foo" entries added
+:
+:   R  Return value must not be ignored (also implied by 'a' flag):
+:
+:        proto.h: add __attribute__warn_unused_result__
+:
+:   r  Function never returns:
+:
+:        proto.h: add __attribute__noreturn__
+:
+:   s  Static function: function in source code has a S_ prefix:
+:
+:         proto.h: function is declared as S_foo rather than foo,
+:                STATIC is added to declaration;
+:         embed.h: "#define foo S_foo" entries added
+:
+:   U  Suppress usage example in autogenerated documentation
+:
+:         (currently no effect)
+:
+:   X  Explicitly exported:
+:
+:         add entry to global.sym, unless x or m
+:
+:   x  Not exported
+:
+:         suppress entry in global.sym
+:
 : (see also L<perlguts/Internal Functions> for those flags.)
 :
 : Pointer parameters that must not be passed NULLs should be prefixed with NN.
@@ -93,6 +165,7 @@ npR  |MEM_SIZE|malloc_good_size      |size_t nbytes
 
 AnpR   |void*  |get_context
 Anp    |void   |set_context    |NN void *t
+EXpRnP |I32    |regcurly       |NN const char *s
 
 END_EXTERN_C
 
@@ -218,7 +291,7 @@ Afp |OP*    |die            |NULLOK const char* pat|...
 s      |OP*    |vdie           |NULLOK const char* pat|NULLOK va_list* args
 #endif
 : Used in util.c
-p      |OP*    |die_where      |NULLOK SV* msv
+pr     |void   |die_where      |NULLOK SV* msv
 Ap     |void   |dounwind       |I32 cxix
 : FIXME
 pmb    |bool   |do_aexec       |NULLOK SV* really|NN SV** mark|NN SV** sp
@@ -355,7 +428,7 @@ Apd |GV*    |gv_fetchmeth_autoload  |NULLOK HV* stash|NN const char* name|STRLEN len
 Apdmb  |GV*    |gv_fetchmethod |NN HV* stash|NN const char* name
 Apd    |GV*    |gv_fetchmethod_autoload|NN HV* stash|NN const char* name \
                                |I32 autoload
-ApdM   |GV*    |gv_fetchmethod_flags|NN HV* stash|NN const char* name \
+Ap   |GV*    |gv_fetchmethod_flags|NN HV* stash|NN const char* name \
                                |U32 flags
 Ap     |GV*    |gv_fetchpv     |NN const char *nambeg|I32 add|const svtype sv_type
 Ap     |void   |gv_fullname    |NN SV* sv|NN const GV* gv
@@ -365,6 +438,7 @@ Ap  |void   |gv_fullname4   |NN SV* sv|NN const GV* gv|NULLOK const char* prefix|bool
 pMox   |GP *   |newGP          |NN GV *const gv
 Ap     |void   |gv_init        |NN GV* gv|NULLOK HV* stash|NN const char* name|STRLEN len|int multi
 Ap     |void   |gv_name_set    |NN GV* gv|NN const char *name|U32 len|U32 flags
+XMpd   |void   |gv_try_downgrade|NN GV* gv
 Apd    |HV*    |gv_stashpv     |NN const char* name|I32 flags
 Apd    |HV*    |gv_stashpvn    |NN const char* name|U32 namelen|I32 flags
 Apd    |HV*    |gv_stashsv     |NN SV* sv|I32 flags
@@ -420,7 +494,7 @@ Abmd        |SV**   |hv_store       |NULLOK HV *hv|NULLOK const char *key \
                                |I32 klen|NULLOK SV *val|U32 hash
 Abmd   |HE*    |hv_store_ent   |NULLOK HV *hv|NULLOK SV *key|NULLOK SV *val\
                                |U32 hash
-AbmdM  |SV**   |hv_store_flags |NULLOK HV *hv|NULLOK const char *key \
+Abm  |SV**   |hv_store_flags |NULLOK HV *hv|NULLOK const char *key \
                                |I32 klen|NULLOK SV *val|U32 hash|int flags
 Apd    |void   |hv_undef       |NULLOK HV *hv
 AnpP   |I32    |ibcmp          |NN const char* a|NN const char* b|I32 len
@@ -501,18 +575,42 @@ ApR       |bool   |is_utf8_print  |NN const U8 *p
 ApR    |bool   |is_utf8_punct  |NN const U8 *p
 ApR    |bool   |is_utf8_xdigit |NN const U8 *p
 ApR    |bool   |is_utf8_mark   |NN const U8 *p
+EXpR   |bool   |is_utf8_X_begin        |NN const U8 *p
+EXpR   |bool   |is_utf8_X_extend       |NN const U8 *p
+EXpR   |bool   |is_utf8_X_prepend      |NN const U8 *p
+EXpR   |bool   |is_utf8_X_non_hangul   |NN const U8 *p
+EXpR   |bool   |is_utf8_X_L            |NN const U8 *p
+EXpR   |bool   |is_utf8_X_LV           |NN const U8 *p
+EXpR   |bool   |is_utf8_X_LVT          |NN const U8 *p
+EXpR   |bool   |is_utf8_X_LV_LVT_V     |NN const U8 *p
+EXpR   |bool   |is_utf8_X_T            |NN const U8 *p
+EXpR   |bool   |is_utf8_X_V            |NN const U8 *p
 : Used in perly.y
 p      |OP*    |jmaybe         |NN OP *o
 : Used in pp.c 
 pP     |I32    |keyword        |NN const char *name|I32 len|bool all_keywords
 #if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
 s      |OP*    |opt_scalarhv   |NN OP* rep_op
+s      |OP*    |is_inplace_av  |NN OP* o|NULLOK OP* oright
 #endif
 Ap     |void   |leave_scope    |I32 base
 : Used in pp_ctl.c, and by Data::Alias
 EXp    |void   |lex_end
 : Used in various files
 p      |void   |lex_start      |NULLOK SV* line|NULLOK PerlIO *rsfp|bool new_filter
+: Public lexer API
+AMpd   |bool   |lex_bufutf8
+AMpd   |char*  |lex_grow_linestr|STRLEN len
+AMpd   |void   |lex_stuff_pvn  |NN const char* pv|STRLEN len|U32 flags
+AMpd   |void   |lex_stuff_sv   |NN SV* sv|U32 flags
+AMpd   |void   |lex_unstuff    |NN char* ptr
+AMpd   |void   |lex_read_to    |NN char* ptr
+AMpd   |void   |lex_discard_to |NN char* ptr
+AMpd   |bool   |lex_next_chunk |U32 flags
+AMpd   |I32    |lex_peek_unichar|U32 flags
+AMpd   |I32    |lex_read_unichar|U32 flags
+AMpd   |void   |lex_read_space |U32 flags
+: Used in various files
 Ap     |void   |op_null        |NN OP* o
 : FIXME. Used by Data::Alias
 EXp    |void   |op_clear       |NN OP* o
@@ -530,6 +628,7 @@ Ap  |void   |vload_module|U32 flags|NN SV* name|NULLOK SV* ver|NULLOK va_list* args
 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
+EXpR   |char   |grok_bslash_c  |const char source|const bool output_warning
 Apd    |UV     |grok_hex       |NN const char* start|NN STRLEN* len_p|NN I32* flags|NULLOK NV *result
 Apd    |int    |grok_number    |NN const char *pv|STRLEN len|NULLOK UV *valuep
 ApdR   |bool   |grok_numeric_radix|NN const char **sp|NN const char *send
@@ -583,6 +682,9 @@ p   |int    |magic_setutf8  |NN SV* sv|NN MAGIC* mg
 p      |int    |magic_set_all_env|NN SV* sv|NN MAGIC* mg
 p      |U32    |magic_sizepack |NN SV* sv|NN MAGIC* mg
 p      |int    |magic_wipepack |NN SV* sv|NN MAGIC* mg
+pd     |SV*    |magic_methcall |NN SV *sv|NN const MAGIC *mg \
+                               |NN const char *meth|U32 flags \
+                               |U32 argc|NULLOK SV* arg1|NULLOK SV* arg2
 Ap     |void   |markstack_grow
 #if defined(USE_LOCALE_COLLATE)
 p      |int    |magic_setcollxfrm|NN SV* sv|NN MAGIC* mg
@@ -720,6 +822,9 @@ Apa |PERL_SI*|new_stackinfo|I32 stitems|I32 cxitems
 Ap     |char*  |scan_vstring   |NN const char *s|NN const char *const e \
                                |NN SV *sv
 Apd    |const char*    |scan_version   |NN const char *s|NN SV *rv|bool qv
+Apd    |const char*    |prescan_version        |NN const char *s\
+       |bool strict|NULLOK const char** errstr|NULLOK bool *sqv\
+       |NULLOK int *ssaw_decimal|NULLOK int *swidth|NULLOK bool *salpha
 Apd    |SV*    |new_version    |NN SV *ver
 Apd    |SV*    |upg_version    |NN SV *ver|bool qv
 Apd    |bool   |vverify        |NN SV *vs
@@ -743,9 +848,10 @@ p  |void   |package_version|NN OP* v
 : Used in op.c
 pd     |PADOFFSET|pad_alloc    |I32 optype|U32 tmptype
 : Used in toke.c and perly.y
-p      |PADOFFSET|allocmy      |NN const char *const name
+p      |PADOFFSET|allocmy      |NN const char *const name|const STRLEN len\
+                               |const U32 flags
 : Used in op.c and toke.c
-pdR    |PADOFFSET|pad_findmy   |NN const char* name
+AMpdR  |PADOFFSET|pad_findmy   |NN const char* name|STRLEN len|U32 flags
 Ap     |PADOFFSET|find_rundefsvoffset  |
 : Used in perly.y
 pR     |OP*    |oopsAV         |NN OP* o
@@ -753,7 +859,9 @@ pR  |OP*    |oopsAV         |NN OP* o
 pR     |OP*    |oopsHV         |NN OP* o
 : Defined in pad.c, used only in op.c
 pd     |void   |pad_leavemy
+#ifdef DEBUGGING
 Apd    |SV*    |pad_sv         |PADOFFSET po
+#endif
 : Defined in pad.c, used only in op.c
 pd     |void   |pad_free       |PADOFFSET po
 #if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
@@ -800,7 +908,6 @@ Apd |void   |packlist       |NN SV *cat|NN const char *pat|NN const char *patend|NN SV
 #if defined(PERL_USES_PL_PIDSTATUS) && defined(PERL_IN_UTIL_C)
 s      |void   |pidgone        |Pid_t pid|int status
 #endif
-DUXpo  |void   |pmflag         |NN U32 *pmfl|int ch
 : Used in perly.y
 p      |OP*    |pmruntime      |NN OP *o|NN OP *expr|bool isreg
 #if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT)
@@ -1062,6 +1169,8 @@ ApdR      |SV*    |sv_newmortal
 Apd    |SV*    |sv_newref      |NULLOK SV *const sv
 Ap     |char*  |sv_peek        |NULLOK SV* sv
 Apd    |void   |sv_pos_u2b     |NULLOK SV *const sv|NN I32 *const offsetp|NULLOK I32 *const lenp
+Apd    |STRLEN |sv_pos_u2b_flags|NN SV *const sv|STRLEN uoffset \
+                               |NULLOK STRLEN *const lenp|U32 flags
 Apd    |void   |sv_pos_b2u     |NULLOK SV *const sv|NN I32 *const offsetp
 Amdb   |char*  |sv_pvn_force   |NN SV* sv|NULLOK STRLEN* lp
 Apd    |char*  |sv_pvutf8n_force|NN SV *const sv|NULLOK STRLEN *const lp
@@ -1360,7 +1469,7 @@ s |HV*    |require_tie_mod|NN GV *gv|NN const char *varpv|NN SV* namesv \
 
 : #if defined(PERL_IN_HV_C) || defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
 : Used in hv.c
-paRxo  |void*  |get_arena      |const size_t svtype|const U32 misc
+paRxoM |void*  |get_arena      |const size_t arenasize |const svtype bodytype
 : #endif
 
 #if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
@@ -1383,8 +1492,9 @@ sM        |SV *   |refcounted_he_value    |NN const struct refcounted_he *he
 
 #if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
 s      |void   |save_magic     |I32 mgs_ix|NN SV *sv
-s      |int    |magic_methpack |NN SV *sv|NN const MAGIC *mg|NN const char *meth
-s      |int    |magic_methcall |NN SV *sv|NN const MAGIC *mg|NN const char *meth|I32 f \
+-s     |int    |magic_methpack |NN SV *sv|NN const MAGIC *mg|NN const char *meth
+s      |SV*    |magic_methcall1|NN SV *sv|NN const MAGIC *mg \
+                               |NN const char *meth|U32 flags \
                                |int n|NULLOK SV *val
 s      |void   |restore_magic  |NULLOK const void *p
 s      |void   |unwind_handler_stack|NN const void *p
@@ -1601,7 +1711,6 @@ Es        |regnode*|regbranch     |NN struct RExC_state_t *pRExC_state \
 Es     |STRLEN |reguni         |NN const struct RExC_state_t *pRExC_state \
                                |UV uv|NN char *s
 Es     |regnode*|regclass      |NN struct RExC_state_t *pRExC_state|U32 depth
-ERsn   |I32    |regcurly       |NN const char *s
 Es     |regnode*|reg_node      |NN struct RExC_state_t *pRExC_state|U8 op
 Es     |UV     |reg_recode     |const char value|NN SV **encp
 Es     |regnode*|regpiece      |NN struct RExC_state_t *pRExC_state \
@@ -1776,6 +1885,7 @@ sRn       |PTR_TBL_ENT_t *|ptr_table_find|NN PTR_TBL_t *const tbl|NULLOK const void *c
 s      |void   |check_uni
 s      |void   |force_next     |I32 type
 s      |char*  |force_version  |NN char *s|int guessing
+s      |char*  |force_strict_version   |NN char *s
 s      |char*  |force_word     |NN char *start|int token|int check_keyword \
                                |int allow_pack|int allow_tick
 s      |SV*    |tokeq          |NN SV *sv
@@ -1875,7 +1985,7 @@ Apd       |void   |sv_catpvn_flags|NN SV *const dstr|NN const char *sstr|const STRLEN le
                                |const I32 flags
 Apd    |void   |sv_catsv_flags |NN SV *const dsv|NULLOK SV *const ssv|const I32 flags
 Apmd   |STRLEN |sv_utf8_upgrade_flags|NN SV *const sv|const I32 flags
-Apd    |STRLEN |sv_utf8_upgrade_flags_grow|NN SV *const sv|const I32 flags|STRLEN extra
+Ap     |STRLEN |sv_utf8_upgrade_flags_grow|NN SV *const sv|const I32 flags|STRLEN extra
 Apd    |char*  |sv_pvn_force_flags|NN SV *const sv|NULLOK STRLEN *const lp|const I32 flags
 Apd    |void   |sv_copypv      |NN SV *const dsv|NN SV *const ssv
 Ap     |char*  |my_atof2       |NN const char *s|NN NV* value
@@ -1931,12 +2041,15 @@ pda     |PADLIST*|pad_new       |int flags
 : Only used in op.c
 pd     |void   |pad_undef      |NN CV* cv
 : Only used in op.c
-pd     |PADOFFSET|pad_add_name |NN const char *name\
-                               |NULLOK HV* typestash|NULLOK HV* ourstash|bool clone|bool state
+Mpd    |PADOFFSET|pad_add_name |NN const char *name|const STRLEN len\
+                               |const U32 flags|NULLOK HV *typestash\
+                               |NULLOK HV *ourstash
 : Only used in op.c
 pd     |PADOFFSET|pad_add_anon |NN SV* sv|OPCODE op_type
-: Only used in op.c
-pd     |void   |pad_check_dup  |NN const char* name|bool is_our|NN const HV* ourstash
+#if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
+sd     |void   |pad_check_dup  |NN SV *name|const U32 flags \
+                               |NULLOK const HV *ourstash
+#endif
 #ifdef DEBUGGING
 : Only used PAD_SETSV() in op.c
 pd     |void   |pad_setsv      |PADOFFSET po|NN SV* sv
@@ -1959,6 +2072,8 @@ pR        |HV*    |pad_compname_type|const PADOFFSET po
 sd     |PADOFFSET|pad_findlex  |NN const char *name|NN const CV* cv|U32 seq|int warn \
                                |NULLOK SV** out_capture|NN SV** out_name_sv \
                                |NN int *out_flags
+s      |PADOFFSET|pad_add_name_sv|NN SV *namesv|const U32 flags \
+                               |NULLOK HV *typestash|NULLOK HV *ourstash
 #  if defined(DEBUGGING)
 sd     |void   |cv_dump        |NN const CV *cv|NN const char *title
 #  endif
@@ -1971,7 +2086,9 @@ p |void   |free_tied_hv_pool
 pR     |int    |get_debug_opts |NN const char **s|bool givehelp
 #endif
 Ap     |void   |save_set_svflags|NN SV *sv|U32 mask|U32 val
+#ifdef DEBUGGING
 Apod   |void   |hv_assert      |NN HV *hv
+#endif
 
 ApdR   |SV*    |hv_scalar      |NN HV *hv
 ApoR   |I32*   |hv_riter_p     |NN HV *hv