Re: [PATCH] sv.c: consting
[p5sagit/p5-mst-13.2.git] / embed.fnc
index cfe292b..9a6dfe5 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -183,8 +183,8 @@ Ap  |I32    |debstackptrs
 Ap     |char*  |delimcpy       |NN char* to|NN const char* toend|NN const char* from \
                                |NN const char* fromend|int delim|NN I32* retlen
 pM     |void   |delete_eval_scope
-p      |void   |deprecate      |NN const char* s
-p      |void   |deprecate_old  |NN const char* s
+p      |void   |deprecate      |NN const char *const s
+p      |void   |deprecate_old  |NN const char *const s
 Afp    |OP*    |die            |NULLOK const char* pat|...
 p      |OP*    |vdie           |NULLOK const char* pat|NULLOK va_list* args
 p      |OP*    |die_where      |NULLOK const char* message|STRLEN msglen
@@ -424,7 +424,7 @@ p   |OP*    |listkids       |NULLOK OP* o
 Apd    |void   |load_module|U32 flags|NN SV* name|NULLOK SV* ver|...
 Ap     |void   |vload_module|U32 flags|NN SV* name|NULLOK SV* ver|NULLOK va_list* args
 p      |OP*    |localize       |NN OP* arg|I32 lexical
-ApdR   |I32    |looks_like_number|NN SV* sv
+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
 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
@@ -433,6 +433,7 @@ Apd |UV     |grok_oct       |NN const char* start|NN STRLEN* len_p|NN I32* flags|NULLOK NV
 p      |int    |magic_clearenv |NN SV* sv|NN MAGIC* mg
 p      |int    |magic_clear_all_env|NN SV* sv|NN MAGIC* mg
 dp     |int    |magic_clearhint|NN SV* sv|NN MAGIC* mg
+p      |int    |magic_clearisa |NN SV* sv|NN MAGIC* mg
 p      |int    |magic_clearpack|NN SV* sv|NN MAGIC* mg
 p      |int    |magic_clearsig |NN SV* sv|NN MAGIC* mg
 p      |int    |magic_existspack|NN SV* sv|NN const MAGIC* mg
@@ -524,7 +525,7 @@ Anp |void*  |my_memset      |NN char* loc|I32 ch|I32 len
 #endif
 Ap     |I32    |my_pclose      |NULLOK PerlIO* ptr
 Ap     |PerlIO*|my_popen       |NN const char* cmd|NN const char* mode
-Ap     |PerlIO*|my_popen_list  |NN char* mode|int n|NN SV ** args
+Ap     |PerlIO*|my_popen_list  |NN const char* mode|int n|NN SV ** args
 Ap     |void   |my_setenv      |NULLOK const char* nam|NULLOK const char* val
 Ap     |I32    |my_stat
 Ap     |char * |my_strftime    |NN const char *fmt|int sec|int min|int hour|int mday|int mon|int year|int wday|int yday|int isdst
@@ -603,7 +604,7 @@ Apa |OP*    |newWHILEOP     |I32 flags|I32 debuggable|NULLOK LOOP* loop \
                                |I32 whileline|NULLOK OP* expr|NULLOK OP* block|NULLOK OP* cont \
                                |I32 has_my
 Apa    |PERL_SI*|new_stackinfo|I32 stitems|I32 cxitems
-Ap     |char*  |scan_vstring   |NN const char *vstr|NN const char *end|NN SV *sv
+Ap     |char*  |scan_vstring   |NN const char *vstr|NN const char *const end|NN SV *sv
 Apd    |const char*    |scan_version   |NN const char *vstr|NN SV *sv|bool qv
 Apd    |SV*    |new_version    |NN SV *ver
 Apd    |SV*    |upg_version    |NN SV *ver|bool qv
@@ -645,7 +646,7 @@ Ap  |void   |call_atexit    |ATEXIT_t fn|NULLOK void *ptr
 Apd    |I32    |call_argv      |NN const char* sub_name|I32 flags|NN char** argv
 Apd    |I32    |call_method    |NN const char* methname|I32 flags
 Apd    |I32    |call_pv        |NN const char* sub_name|I32 flags
-Apd    |I32    |call_sv        |NN SV* sv|I32 flags
+Apd    |I32    |call_sv        |NN SV* sv|VOL I32 flags
 Ap     |void   |despatch_signals
 Ap     |OP *   |doref          |NN OP *o|I32 type|bool set_op_ref
 Apd    |SV*    |eval_pv        |NN const char* p|I32 croak_on_error
@@ -688,12 +689,11 @@ Ap        |void   |pregfree       |NULLOK REGEXP* r
 Ap     |void   |pregfree2      |NN REGEXP* prog
 EXp    |REGEXP*|reg_temp_copy  |NN REGEXP* r
 Ap     |void   |regfree_internal|NULLOK REGEXP * const r
-Ap     |char * |reg_stringify  |NN MAGIC *mg|NULLOK STRLEN *lp|NULLOK U32 *flags|NULLOK I32 *haseval
 #if defined(USE_ITHREADS)
 Ap     |void*  |regdupe_internal|NN REGEXP * const r|NN CLONE_PARAMS* param
 #endif
 Ap     |REGEXP*|pregcomp       |NN const SV * const pattern|const U32 flags
-Ap     |REGEXP*|re_compile     |NN const SV * const pattern|const U32 flags
+Ap     |REGEXP*|re_compile     |NN const SV * const pattern|U32 flags
 Ap     |char*  |re_intuit_start|NN REGEXP * const rx|NULLOK SV* sv|NN char* strpos \
                                |NN char* strend|const U32 flags \
                                |NULLOK re_scream_pos_data *data
@@ -775,7 +775,7 @@ Ap  |SV*    |save_scalar    |NN GV* gv
 Ap     |void   |save_pptr      |NN char** pptr
 Ap     |void   |save_vptr      |NN void* pptr
 Ap     |void   |save_re_context
-Ap     |void   |save_padsv     |PADOFFSET off
+Ap     |void   |save_padsv_and_mortalize|PADOFFSET off
 Ap     |void   |save_sptr      |NN SV** sptr
 Ap     |SV*    |save_svref     |NN SV** sptr
 p      |OP*    |sawparens      |NULLOK OP* o
@@ -813,17 +813,17 @@ s |bool   |glob_2number   |NN GV* const gv
 s      |char*  |glob_2pv       |NN GV* const gv|NULLOK STRLEN * const len
 #endif
 Amb    |IV     |sv_2iv         |NN SV* sv
-Apd    |IV     |sv_2iv_flags   |NN SV* sv|I32 flags
+Apd    |IV     |sv_2iv_flags   |NN SV *const sv|const I32 flags
 Apd    |SV*    |sv_2mortal     |NULLOK SV* sv
-Apd    |NV     |sv_2nv         |NN SV* sv
-pMd    |SV*    |sv_2num        |NN SV* sv
+Apd    |NV     |sv_2nv         |NN SV *const sv
+pMd    |SV*    |sv_2num        |NN SV *const sv
 Amb    |char*  |sv_2pv         |NN SV* sv|NULLOK STRLEN* lp
-Apd    |char*  |sv_2pv_flags   |NN SV* sv|NULLOK STRLEN* lp|I32 flags
+Apd    |char*  |sv_2pv_flags   |NN SV *const sv|NULLOK STRLEN *const lp|const I32 flags
 Apd    |char*  |sv_2pvutf8     |NN SV* sv|NULLOK STRLEN* lp
-Apd    |char*  |sv_2pvbyte     |NN SV* sv|NULLOK STRLEN* lp
+Apd    |char*  |sv_2pvbyte     |NN SV *const sv|NULLOK STRLEN *const lp
 Ap     |char*  |sv_pvn_nomg    |NN SV* sv|NULLOK STRLEN* lp
 Amb    |UV     |sv_2uv         |NN SV* sv
-Apd    |UV     |sv_2uv_flags   |NN SV* sv|I32 flags
+Apd    |UV     |sv_2uv_flags   |NN SV *const sv|const I32 flags
 Apd    |IV     |sv_iv          |NN SV* sv
 Apd    |UV     |sv_uv          |NN SV* sv
 Apd    |NV     |sv_nv          |NN SV* sv
@@ -831,8 +831,8 @@ Apd |char*  |sv_pvn         |NN SV *sv|NN STRLEN *len
 Apd    |char*  |sv_pvutf8n     |NN SV *sv|NN STRLEN *len
 Apd    |char*  |sv_pvbyten     |NN SV *sv|NN STRLEN *len
 Apd    |I32    |sv_true        |NULLOK SV *sv
-pd     |void   |sv_add_arena   |NN char* ptr|U32 size|U32 flags
-Apd    |int    |sv_backoff     |NN SV* sv
+pd     |void   |sv_add_arena   |NN char *const ptr|const U32 size|const U32 flags
+Apd    |int    |sv_backoff     |NN SV *const sv
 Apd    |SV*    |sv_bless       |NN SV* sv|NN HV* stash
 Afpd   |void   |sv_catpvf      |NN SV* sv|NN const char* pat|...
 Apd    |void   |sv_vcatpvf     |NN SV* sv|NN const char* pat|NULLOK va_list* args
@@ -852,14 +852,14 @@ Ap        |OP*    |sv_compile_2op |NN SV* sv|NN OP** startp|NN const char* code|NN PAD** p
 Apd    |int    |getcwd_sv      |NN SV* sv
 Apd    |void   |sv_dec         |NN SV* sv
 Ap     |void   |sv_dump        |NN SV* sv
-ApdR   |bool   |sv_derived_from|NN SV* sv|NN const char* name
-ApdR   |bool   |sv_does        |NN SV* sv|NN const char* name
+ApdR   |bool   |sv_derived_from|NN SV* sv|NN const char *const name
+ApdR   |bool   |sv_does        |NN SV* sv|NN const char *const name
 Apd    |I32    |sv_eq          |NULLOK SV* sv1|NULLOK SV* sv2
 Apd    |void   |sv_free        |NULLOK SV* sv
 poMX   |void   |sv_free2       |NN SV* sv
 pd     |void   |sv_free_arenas
 Apd    |char*  |sv_gets        |NN SV* sv|NN PerlIO* fp|I32 append
-Apd    |char*  |sv_grow        |NN SV* sv|STRLEN newlen
+Apd    |char*  |sv_grow        |NN SV *const sv|STRLEN newlen
 Apd    |void   |sv_inc         |NN SV* sv
 Apd    |void   |sv_insert      |NN SV* bigsv|STRLEN offset|STRLEN len \
                                |NN const char* little|STRLEN littlelen
@@ -889,10 +889,10 @@ Apd       |void   |sv_report_used
 Apd    |void   |sv_reset       |NN const char* s|NULLOK HV* stash
 Afpd   |void   |sv_setpvf      |NN SV* sv|NN const char* pat|...
 Apd    |void   |sv_vsetpvf     |NN SV* sv|NN const char* pat|NULLOK va_list* args
-Apd    |void   |sv_setiv       |NN SV* sv|IV num
+Apd    |void   |sv_setiv       |NN SV *const sv|const IV num
 Apdb   |void   |sv_setpviv     |NN SV* sv|IV num
-Apd    |void   |sv_setuv       |NN SV* sv|UV num
-Apd    |void   |sv_setnv       |NN SV* sv|NV num
+Apd    |void   |sv_setuv       |NN SV *const sv|const UV num
+Apd    |void   |sv_setnv       |NN SV *const sv|const NV num
 Apd    |SV*    |sv_setref_iv   |NN SV* rv|NULLOK const char* classname|IV iv
 Apd    |SV*    |sv_setref_uv   |NN SV* rv|NULLOK const char* classname|UV uv
 Apd    |SV*    |sv_setref_nv   |NN SV* rv|NULLOK const char* classname|NV nv
@@ -907,7 +907,7 @@ Apd |int    |sv_unmagic     |NN SV* sv|int type
 Apdmb  |void   |sv_unref       |NN SV* sv
 Apd    |void   |sv_unref_flags |NN SV* sv|U32 flags
 Apd    |void   |sv_untaint     |NN SV* sv
-Apd    |void   |sv_upgrade     |NN SV* sv|svtype new_type
+Apd    |void   |sv_upgrade     |NN SV *const sv|svtype new_type
 Apdmb  |void   |sv_usepvn      |NN SV* sv|NULLOK char* ptr|STRLEN len
 Apd    |void   |sv_usepvn_flags|NN SV* sv|NULLOK char* ptr|STRLEN len\
                                |U32 flags
@@ -921,7 +921,7 @@ ApR |NV     |str_to_version |NN SV *sv
 Ap     |SV*    |swash_init     |NN const char* pkg|NN const char* name|NN SV* listsv|I32 minbits|I32 none
 Ap     |UV     |swash_fetch    |NN SV *swash|NN const U8 *ptr|bool do_utf8
 Ap     |void   |taint_env
-Ap     |void   |taint_proper   |NULLOK const char* f|NN const char* s
+Ap     |void   |taint_proper   |NULLOK const char* f|NN const char *const s
 Apd    |UV     |to_utf8_case   |NN const U8 *p|NN U8* ustrp|NULLOK STRLEN *lenp \
                                |NN SV **swashp|NN const char *normal|NN const char *special
 Apd    |UV     |to_utf8_lower  |NN const U8 *p|NN U8* ustrp|NULLOK STRLEN *lenp
@@ -989,11 +989,11 @@ Ap        |void   |vwarner        |U32 err|NN const char* pat|NULLOK va_list* args
 p      |void   |watch          |NN char** addr
 Ap     |I32    |whichsig       |NN const char* sig
 p      |void   |write_to_stderr|NN const char* message|int msglen
-p      |int    |yyerror        |NN const char* s
+p      |int    |yyerror        |NN const char *const s
 EXp    |int    |yylex
 p      |int    |yyparse
 p      |void   |parser_free    |NN const yy_parser *
-p      |int    |yywarn         |NN const char* s
+p      |int    |yywarn         |NN const char *const s
 #if defined(MYMALLOC)
 Ap     |void   |dump_mstats    |NN char* s
 Ap     |int    |get_mstats     |NN perl_mstats_t *buf|int buflen|int level
@@ -1016,10 +1016,10 @@ Apdbm   |void   |sv_catpvn_mg   |NN SV *sv|NN const char *ptr|STRLEN len
 Apdbm  |void   |sv_catsv_mg    |NN SV *dstr|NULLOK SV *sstr
 Afpd   |void   |sv_setpvf_mg   |NN SV *sv|NN const char* pat|...
 Apd    |void   |sv_vsetpvf_mg  |NN SV* sv|NN const char* pat|NULLOK va_list* args
-Apd    |void   |sv_setiv_mg    |NN SV *sv|IV i
+Apd    |void   |sv_setiv_mg    |NN SV *const sv|const IV i
 Apdb   |void   |sv_setpviv_mg  |NN SV *sv|IV iv
-Apd    |void   |sv_setuv_mg    |NN SV *sv|UV u
-Apd    |void   |sv_setnv_mg    |NN SV *sv|NV num
+Apd    |void   |sv_setuv_mg    |NN SV *const sv|const UV u
+Apd    |void   |sv_setnv_mg    |NN SV *const sv|const NV num
 Apd    |void   |sv_setpv_mg    |NN SV *sv|NULLOK const char *ptr
 Apd    |void   |sv_setpvn_mg   |NN SV *sv|NN const char *ptr|STRLEN len
 Apd    |void   |sv_setsv_mg    |NN SV *dstr|NULLOK SV *sstr
@@ -1143,7 +1143,7 @@ s |HV*    |require_tie_mod|NN GV *gv|NN const char *varpv|NN SV* namesv \
 #endif
 
 : #if defined(PERL_IN_HV_C) || defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
-paRxo  |void*  |get_arena      |size_t svtype|U32 misc
+paRxo  |void*  |get_arena      |const size_t svtype|const U32 misc
 : #endif
 
 #if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
@@ -1264,7 +1264,7 @@ s |void   |Slab_to_rw     |NN void *op
 
 #if defined(PERL_IN_PERL_C) || defined(PERL_DECL_PROT)
 s      |void   |find_beginning |NN SV* linestr_sv|NN PerlIO *rsfp
-s      |void   |forbid_setid   |const char flag|const int suidscript
+s      |void   |forbid_setid   |const char flag|const bool suidscript
 s      |void   |incpush        |NULLOK const char *dir|bool addsubdirs|bool addoldvers|bool usesep|bool canrelocate
 s      |void   |init_interp
 s      |void   |init_ids
@@ -1275,12 +1275,25 @@ s       |void   |init_predump_symbols
 rs     |void   |my_exit_jump
 s      |void   |nuke_stacks
 s      |int    |open_script    |NN const char *scriptname|bool dosearch \
-                               |NN SV *sv|NN int *suidscript|NN PerlIO **rsfpp
+                               |NN bool *suidscript|NN PerlIO **rsfpp
 s      |void   |usage          |NN const char *name
-s      |void   |validate_suid  |NN const char *validarg \
+#ifdef DOSUID
+#  ifdef IAMSUID
+so     |void   |validate_suid  |NN const char *validarg \
+                               |int fdscript \
+                               |bool suidscript|NN SV* linestr_sv \
+                               |NN PerlIO *rsfp
+#  else
+so     |void   |validate_suid  |NN const char *validarg \
                                |NN const char *scriptname|int fdscript \
-                               |int suidscript|NN SV* linestr_sv \
+                               |NN SV* linestr_sv \
                                |NN PerlIO *rsfp
+#  endif
+#else
+#  ifndef SETUID_SCRIPTS_ARE_SECURE_NOW
+so     |void   |validate_suid  |NN PerlIO *rsfp
+#  endif
+#endif
 
 #  if defined(IAMSUID)
 s      |int    |fd_on_nosuid_fs|int fd
@@ -1479,10 +1492,10 @@ poM     |int    |sv_kill_backrefs       |NN SV *sv|NN AV *av
 #endif
 
 #if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
-nsR    |char * |uiv_2buf       |NN char *buf|IV iv|UV uv|int is_uv|NN char **peob
+nsR    |char * |uiv_2buf       |NN char *const buf|const IV iv|UV uv|const int is_uv|NN char **const peob
 s      |void   |sv_unglob      |NN SV* sv
-s      |void   |not_a_number   |NN SV *sv
-s      |I32    |visit          |NN SVFUNC_t f|U32 flags|U32 mask
+s      |void   |not_a_number   |NN SV *const sv
+s      |I32    |visit          |NN SVFUNC_t f|const U32 flags|const U32 mask
 s      |void   |sv_del_backref |NN SV *target|NN SV *ref
 sR     |SV *   |varname        |NULLOK GV *gv|const char gvtype|PADOFFSET targ \
                                |NULLOK SV *keyname|I32 aindex|int subscript_type
@@ -1490,7 +1503,11 @@ sR       |SV *   |varname        |NULLOK GV *gv|const char gvtype|PADOFFSET targ \
 s      |void   |del_sv |NN SV *p
 #  endif
 #  if !defined(NV_PRESERVES_UV)
-s      |int    |sv_2iuv_non_preserve   |NN SV *sv|I32 numtype
+#    ifdef DEBUGGING
+s      |int    |sv_2iuv_non_preserve   |NN SV *const sv|I32 numtype
+#    else
+s      |int    |sv_2iuv_non_preserve   |NN SV *const sv
+#    endif
 #  endif
 sR     |I32    |expect_number  |NN char** pattern
 #
@@ -1510,8 +1527,8 @@ sn        |char * |F0convert      |NV nv|NN char *endbuf|NN STRLEN *len
 sM     |void   |sv_release_COW |NN SV *sv|NN const char *pvx|NN SV *after
 #  endif
 s      |SV *   |more_sv
-s      |void * |more_bodies    |svtype sv_type
-s      |bool   |sv_2iuv_common |NN SV *sv
+s      |void * |more_bodies    |const svtype sv_type
+s      |bool   |sv_2iuv_common |NN SV *const sv
 s      |void   |glob_assign_glob|NN SV *dstr|NN SV *sstr|const int dtype
 s      |void   |glob_assign_ref|NN SV *dstr|NN SV *sstr
 sRn    |PTR_TBL_ENT_t *|ptr_table_find|NN PTR_TBL_t *tbl|NN const void *sv
@@ -1538,19 +1555,19 @@ sR      |char*  |scan_trans     |NN char *start
 s      |char*  |scan_word      |NN char *s|NN char *dest|STRLEN destlen \
                                |int allow_package|NN STRLEN *slp
 s      |void   |update_debugger_info|NULLOK SV *orig_sv \
-                               |NULLOK const char *buf|STRLEN len
+                               |NULLOK const char *const buf|STRLEN len
 sR     |char*  |skipspace      |NN char *s
 sR     |char*  |swallow_bom    |NN U8 *s
 s      |void   |checkcomma     |NN const char *s|NN const char *name \
                                |NN const char *what
-s      |bool   |feature_is_enabled|NN const char* name|STRLEN namelen
+s      |bool   |feature_is_enabled|NN const char *const name|STRLEN namelen
 s      |void   |force_ident    |NN const char *s|int kind
 s      |void   |incline        |NN const char *s
 s      |int    |intuit_method  |NN char *s|NULLOK GV *gv|NULLOK CV *cv
 s      |int    |intuit_more    |NN char *s
 s      |I32    |lop            |I32 f|int x|NN char *s
 rs     |void   |missingterm    |NULLOK char *s
-s      |void   |no_op          |NN const char *what|NULLOK char *s
+s      |void   |no_op          |NN const char *const what|NULLOK char *s
 sR     |I32    |sublex_done
 sR     |I32    |sublex_push
 sR     |I32    |sublex_start
@@ -1567,8 +1584,8 @@ s |I32    |cr_textfilter  |int idx|NULLOK SV *sv|int maxlen
 s      |void   |strip_return   |NN SV *sv
 #  endif
 #  if defined(DEBUGGING)
-s      |int    |tokereport     |I32 rv
-s      |void   |printbuf       |NN const char* fmt|NN const char* s
+s      |int    |tokereport     |I32 rv|NN const YYSTYPE* lvalp
+s      |void   |printbuf       |NN const char *const fmt|NN const char *const s
 #  endif
 #endif
 
@@ -1609,7 +1626,7 @@ Apd       |void   |sv_catpvn_flags|NN SV* sv|NN const char* ptr|STRLEN len|I32 flags
 Apd    |void   |sv_catsv_flags |NN SV* dsv|NULLOK SV* ssv|I32 flags
 Apd    |STRLEN |sv_utf8_upgrade_flags|NN SV *sv|I32 flags
 Apd    |char*  |sv_pvn_force_flags|NN SV* sv|NULLOK STRLEN* lp|I32 flags
-Apd    |void   |sv_copypv      |NN SV* dsv|NN SV* ssv
+Apd    |void   |sv_copypv      |NN SV *const dsv|NN SV *const ssv
 Ap     |char*  |my_atof2       |NN const char *s|NN NV* value
 Apn    |int    |my_socketpair  |int family|int type|int protocol|int fd[2]
 Ap     |int    |my_dirfd       |NULLOK DIR* dir
@@ -1802,7 +1819,7 @@ Apo       |bool   |ckwarn_d       |U32 w
 XEopMa |STRLEN *|new_warnings_bitfield|NULLOK STRLEN *buffer \
                                |NN const char *const bits|STRLEN size
 
-p      |void   |offer_nice_chunk       |NN void *chunk|U32 chunk_size
+p      |void   |offer_nice_chunk       |NN void *const chunk|const U32 chunk_size
 
 #ifndef SPRINTF_RETURNS_STRLEN
 Apnod  |int    |my_sprintf     |NN char *buffer|NN const char *pat|...