The old COW code needs to use SvPVX_mutable when doing copy-on-write.
[p5sagit/p5-mst-13.2.git] / embed.fnc
index 19a64bf..75b9031 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -24,9 +24,8 @@
 :      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
-:      R               Return value must not be ignored.  All "a" functions
-:                      get this automatically.
+:      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
 :
@@ -72,7 +71,7 @@ Aanop |Malloc_t|calloc        |MEM_SIZE elements|MEM_SIZE size
 Aanop  |Malloc_t|realloc       |Malloc_t where|MEM_SIZE nbytes
 Anop   |Free_t |mfree          |Malloc_t where
 #if defined(MYMALLOC)
-np     |MEM_SIZE|malloced_size |void *p
+npR    |MEM_SIZE|malloced_size |void *p
 #endif
 
 Anp    |void*  |get_context
@@ -305,9 +304,9 @@ p   |void   |init_debugger
 Ap     |void   |init_stacks
 Ap     |void   |init_tm        |struct tm *ptm
 pd     |U32    |intro_my
-ApP    |char*  |instr          |NN const char* big|NN const char* little
-p      |bool   |io_close       |IO* io|bool not_implicit
-p      |OP*    |invert         |OP* cmd
+ApPR   |char*  |instr          |NN const char* big|NN const char* little
+pR     |bool   |io_close       |NN IO* io|bool not_implicit
+pR     |OP*    |invert         |OP* cmd
 dpR    |bool   |is_gv_magical  |const char *name|STRLEN len|U32 flags
 ApR    |I32    |is_lvalue_sub
 ApPR   |U32    |to_uni_upper_lc|U32 c
@@ -347,7 +346,8 @@ ApPR        |bool   |is_uni_punct_lc|UV c
 ApPR   |bool   |is_uni_xdigit_lc|UV c
 Apd    |STRLEN |is_utf8_char   |NN const U8 *p
 Apd    |bool   |is_utf8_string |NN const U8 *s|STRLEN len
-Apd    |bool   |is_utf8_string_loc|NN const U8 *s|STRLEN len|NN const U8 **p
+Apd    |bool   |is_utf8_string_loc|NN const U8 *s|STRLEN len|const U8 **p
+Apd    |bool   |is_utf8_string_loclen|NN const U8 *s|STRLEN len|const U8 **ep|STRLEN *el
 ApR    |bool   |is_utf8_alnum  |NN const U8 *p
 ApR    |bool   |is_utf8_alnumc |NN const U8 *p
 ApR    |bool   |is_utf8_idfirst|NN const U8 *p
@@ -524,7 +524,7 @@ Apa |OP*    |newLISTOP      |I32 type|I32 flags|OP* first|OP* last
 Apa    |OP*    |newPADOP       |I32 type|I32 flags|SV* sv
 Apa    |OP*    |newPMOP        |I32 type|I32 flags
 Apa    |OP*    |newPVOP        |I32 type|I32 flags|char* pv
-Apa    |SV*    |newRV          |SV* pref
+Apa    |SV*    |newRV          |NN SV* pref
 Apda   |SV*    |newRV_noinc    |NN SV *sv
 Apda   |SV*    |newSV          |STRLEN len
 Apa    |OP*    |newSVREF       |NN OP* o
@@ -534,6 +534,7 @@ Apda        |SV*    |newSVuv        |UV u
 Apda   |SV*    |newSVnv        |NV n
 Apda   |SV*    |newSVpv        |const char* s|STRLEN len
 Apda   |SV*    |newSVpvn       |const char* s|STRLEN len
+Apda   |SV*    |newSVhek       |const HEK *hek
 Apda   |SV*    |newSVpvn_share |const char* s|I32 len|U32 hash
 Afpda  |SV*    |newSVpvf       |const char* pat|...
 Ap     |SV*    |vnewSVpvf      |const char* pat|va_list* args
@@ -711,11 +712,11 @@ Amb       |IV     |sv_2iv         |NN SV* sv
 Apd    |IV     |sv_2iv_flags   |NN SV* sv|I32 flags
 Apd    |SV*    |sv_2mortal     |NN SV* sv
 Apd    |NV     |sv_2nv         |NN SV* sv
-Amb    |char*  |sv_2pv         |NN SV* sv|NN STRLEN* lp
-Apd    |char*  |sv_2pv_flags   |NN SV* sv|NN STRLEN* lp|I32 flags
-Apd    |char*  |sv_2pvutf8     |NN SV* sv|NN STRLEN* lp
-Apd    |char*  |sv_2pvbyte     |NN SV* sv|NN STRLEN* lp
-Ap     |char*  |sv_pvn_nomg    |NN SV* sv|NN STRLEN* lp
+Amb    |char*  |sv_2pv         |NN SV* sv|STRLEN* lp
+Apd    |char*  |sv_2pv_flags   |NN SV* sv|STRLEN* lp|I32 flags
+Apd    |char*  |sv_2pvutf8     |NN SV* sv|STRLEN* lp
+Apd    |char*  |sv_2pvbyte     |NN SV* sv|STRLEN* lp
+Ap     |char*  |sv_pvn_nomg    |NN SV* sv|STRLEN* lp
 Amb    |UV     |sv_2uv         |NN SV* sv
 Apd    |UV     |sv_2uv_flags   |NN SV* sv|I32 flags
 Apd    |IV     |sv_iv          |NN SV* sv
@@ -768,8 +769,8 @@ Apd |SV*    |sv_mortalcopy  |NN SV* oldsv
 ApdR   |SV*    |sv_newmortal
 Apd    |SV*    |sv_newref      |SV* sv
 Ap     |char*  |sv_peek        |SV* sv
-Apd    |void   |sv_pos_u2b     |SV* sv|I32* offsetp|I32* lenp
-Apd    |void   |sv_pos_b2u     |SV* sv|I32* offsetp
+Apd    |void   |sv_pos_u2b     |SV* sv|NN I32* offsetp|I32* lenp
+Apd    |void   |sv_pos_b2u     |SV* sv|NN I32* offsetp
 Amdb   |char*  |sv_pvn_force   |SV* sv|STRLEN* lp
 Apd    |char*  |sv_pvutf8n_force|SV* sv|STRLEN* lp
 Apd    |char*  |sv_pvbyten_force|SV* sv|STRLEN* lp
@@ -964,7 +965,7 @@ Ap  |void   |sys_intern_init
 Ap     |char * |custom_op_name |NN const OP* op
 Ap     |char * |custom_op_desc |NN const OP* op
 
-#if defined(PERL_COPY_ON_WRITE)
+#if defined(PERL_OLD_COPY_ON_WRITE)
 pMX    |int    |sv_release_IVX |SV *sv
 #endif
 
@@ -996,9 +997,10 @@ sR |HE*    |new_he
 s      |void   |del_he         |NN HE *p
 sR     |HEK*   |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags
 s      |void   |hv_magic_check |NN HV *hv|NN bool *needs_copy|NN bool *needs_store
-s      |void   |unshare_hek_or_pvn|HEK* hek|NN const char* sv|I32 len|U32 hash
+s      |void   |unshare_hek_or_pvn|HEK* hek|const char* str|I32 len|U32 hash
 sR     |HE*    |share_hek_flags|const char* sv|I32 len|U32 hash|int flags
 rs     |void   |hv_notallowed  |int flags|NN const char *key|I32 klen|NN const char *msg
+s      |struct xpvhv_aux*|hv_auxinit|HV *hv
 #endif
 
 #if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
@@ -1058,7 +1060,7 @@ s |OP*    |scalarboolean  |NN OP *o
 sR     |OP*    |newDEFSVOP
 sR     |OP*    |new_logop      |I32 type|I32 flags|NN OP **firstp|NN OP **otherp
 s      |void   |simplify_sort  |NN OP *o
-s      |char*  |gv_ename       |GV *gv
+s      |const char*    |gv_ename       |GV *gv
 s      |bool   |scalar_mod_type|const OP *o|I32 type
 s      |OP *   |my_kid         |OP *o|OP *attrs|OP **imopsp
 s      |OP *   |dup_attrlist   |OP *o
@@ -1140,10 +1142,10 @@ s       |SV*    |method_common  |SV* meth|U32* hashp
 #endif
 
 #if defined(PERL_IN_PP_SYS_C) || defined(PERL_DECL_PROT)
-s      |OP*    |doform         |CV *cv|GV *gv|OP *retop
-s      |int    |emulate_eaccess|const char* path|Mode_t mode
+s      |OP*    |doform         |NN CV *cv|NN GV *gv|NN OP *retop
+sr     |int    |emulate_eaccess|NN const char* path|Mode_t mode
 #  if !defined(HAS_MKDIR) || !defined(HAS_RMDIR)
-s      |int    |dooneliner     |char *cmd|char *filename
+sR     |int    |dooneliner     |NN const char *cmd|NN const char *filename
 #  endif
 #endif
 
@@ -1261,12 +1263,14 @@ sR      |I32    |expect_number  |NN char** pattern
 s      |SV*    |gv_share       |SV *sv|CLONE_PARAMS *param
 #  endif
 s      |bool   |utf8_mg_pos    |NN SV *sv|NN MAGIC **mgp|NN STRLEN **cachep \
-                               |I32 i|NN I32 *offsetp|I32 uoff|NN U8 **sp \
-                               |NN U8 *start|NN U8 *send
-s      |bool   |utf8_mg_pos_init       |NN SV *sv|NN MAGIC **mgp|NN STRLEN **cachep \
-                               |I32 i|I32 offsetp|NN U8 *s|NN U8 *start
-#if defined(PERL_COPY_ON_WRITE)
-sM     |void   |sv_release_COW |SV *sv|char *pvx|STRLEN cur|STRLEN len \
+                               |I32 i|NN I32 *offsetp|I32 uoff \
+                               |NN const U8 **sp|NN const U8 *start \
+                               |NN const U8 *send
+s      |bool   |utf8_mg_pos_init       |NN SV *sv|NN MAGIC **mgp \
+                               |NN STRLEN **cachep|I32 i|I32 offsetp \
+                               |NN const U8 *s|NN const U8 *start
+#if defined(PERL_OLD_COPY_ON_WRITE)
+sM     |void   |sv_release_COW |SV *sv|const char *pvx|STRLEN cur|STRLEN len \
                                |U32 hash|SV *after
 #endif
 #endif
@@ -1343,41 +1347,45 @@ s       |SV*    |mess_alloc
 sn     |NV|mulexp10    |NV value|I32 exponent
 #endif
 
+#if defined(PERL_IN_UTF8_C) || defined(PERL_DECL_PROT)
+s      |STRLEN |is_utf8_char_slow|NN const U8 *s|const STRLEN len
+#endif
+
 START_EXTERN_C
 
 Apd    |void   |sv_setsv_flags |NN SV* dsv|SV* ssv|I32 flags
 Apd    |void   |sv_catpvn_flags|NN SV* sv|NN const char* ptr|STRLEN len|I32 flags
 Apd    |void   |sv_catsv_flags |NN SV* dsv|SV* ssv|I32 flags
 Apd    |STRLEN |sv_utf8_upgrade_flags|NN SV *sv|I32 flags
-Apd    |char*  |sv_pvn_force_flags|SV* sv|NN STRLEN* lp|I32 flags
+Apd    |char*  |sv_pvn_force_flags|SV* sv|STRLEN* lp|I32 flags
 Apd    |void   |sv_copypv      |NN SV* dsv|NN SV* 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]
-#ifdef PERL_COPY_ON_WRITE
+#ifdef PERL_OLD_COPY_ON_WRITE
 pMXE   |SV*    |sv_setsv_cow   |SV* dsv|SV* ssv
 #endif
 
 #if defined(USE_PERLIO) && !defined(USE_SFIO)
-Ap     |int    |PerlIO_close           |PerlIO *
-Ap     |int    |PerlIO_fill            |PerlIO *
-Ap     |int    |PerlIO_fileno          |PerlIO *
-Ap     |int    |PerlIO_eof             |PerlIO *
-Ap     |int    |PerlIO_error           |PerlIO *
-Ap     |int    |PerlIO_flush           |PerlIO *
-Ap     |void   |PerlIO_clearerr        |PerlIO *
-Ap     |void   |PerlIO_set_cnt         |PerlIO *|int
-Ap     |void   |PerlIO_set_ptrcnt      |PerlIO *|STDCHAR *|int
-Ap     |void   |PerlIO_setlinebuf      |PerlIO *
-Ap     |SSize_t|PerlIO_read            |PerlIO *|void *|Size_t
-Ap     |SSize_t|PerlIO_write           |PerlIO *|const void *|Size_t
-Ap     |SSize_t|PerlIO_unread          |PerlIO *|const void *|Size_t
-Ap     |Off_t  |PerlIO_tell            |PerlIO *
-Ap     |int    |PerlIO_seek            |PerlIO *|Off_t|int
+Ap     |int    |PerlIO_close           |PerlIO *f
+Ap     |int    |PerlIO_fill            |PerlIO *f
+Ap     |int    |PerlIO_fileno          |PerlIO *f
+Ap     |int    |PerlIO_eof             |PerlIO *f
+Ap     |int    |PerlIO_error           |PerlIO *f
+Ap     |int    |PerlIO_flush           |PerlIO *f
+Ap     |void   |PerlIO_clearerr        |PerlIO *f
+Ap     |void   |PerlIO_set_cnt         |PerlIO *f|int cnt
+Ap     |void   |PerlIO_set_ptrcnt      |PerlIO *f|NN STDCHAR *ptr|int cnt
+Ap     |void   |PerlIO_setlinebuf      |PerlIO *f
+Ap     |SSize_t|PerlIO_read            |PerlIO *f|NN void *buf|Size_t count
+Ap     |SSize_t|PerlIO_write           |PerlIO *f|NN const void *buf|Size_t count
+Ap     |SSize_t|PerlIO_unread          |PerlIO *f|NN const void *buf|Size_t count
+Ap     |Off_t  |PerlIO_tell            |PerlIO *f
+Ap     |int    |PerlIO_seek            |PerlIO *f|Off_t offset|int whence
 
-Ap     |STDCHAR *|PerlIO_get_base      |PerlIO *
-Ap     |STDCHAR *|PerlIO_get_ptr       |PerlIO *
-Ap     |int      |PerlIO_get_bufsiz    |PerlIO *
-Ap     |int      |PerlIO_get_cnt       |PerlIO *
+Ap     |STDCHAR *|PerlIO_get_base      |PerlIO *f
+Ap     |STDCHAR *|PerlIO_get_ptr       |PerlIO *f
+Ap     |int      |PerlIO_get_bufsiz    |PerlIO *f
+Ap     |int      |PerlIO_get_cnt       |PerlIO *f
 
 Ap     |PerlIO *|PerlIO_stdin
 Ap     |PerlIO *|PerlIO_stdout
@@ -1390,23 +1398,22 @@ s       |void   |deb_stack_n    |SV** stack_base|I32 stack_min \
                                |I32 stack_max|I32 mark_min|I32 mark_max
 #endif
 
-pd     |PADLIST*|pad_new       |int flags
+pda    |PADLIST*|pad_new       |int flags
 pd     |void   |pad_undef      |CV* cv
 pd     |PADOFFSET|pad_add_name |NN const char *name\
                                |HV* typestash|HV* ourstash \
                                |bool clone
 pd     |PADOFFSET|pad_add_anon |SV* sv|OPCODE op_type
-pd     |void   |pad_check_dup  |const char* name|bool is_our|const HV* ourstash
+pd     |void   |pad_check_dup  |NN const char* name|bool is_our|NN const HV* ourstash
 #ifdef DEBUGGING
-pd     |void   |pad_setsv      |PADOFFSET po|SV* sv
+pd     |void   |pad_setsv      |PADOFFSET po|NN SV* sv
 #endif
 pd     |void   |pad_block_start|int full
 pd     |void   |pad_tidy       |padtidy_type type
-pd     |void   |do_dump_pad    |I32 level|PerlIO *file \
-                               |PADLIST *padlist|int full
-pd     |void   |pad_fixup_inner_anons|PADLIST *padlist|CV *old_cv|CV *new_cv
+pd     |void   |do_dump_pad    |I32 level|NN PerlIO *file|PADLIST *padlist|int full
+pd     |void   |pad_fixup_inner_anons|NN PADLIST *padlist|CV *old_cv|CV *new_cv
 
-pd     |void   |pad_push       |PADLIST *padlist|int depth
+pd     |void   |pad_push       |NN PADLIST *padlist|int depth
 p      |HV*    |pad_compname_type|const PADOFFSET po
 
 #if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
@@ -1414,7 +1421,7 @@ sd        |PADOFFSET|pad_findlex  |const char *name|const CV* cv|U32 seq|int warn \
                                |SV** out_capture|SV** out_name_sv \
                                |int *out_flags
 #  if defined(DEBUGGING)
-sd     |void   |cv_dump        |const CV *cv|const char *title
+sd     |void   |cv_dump        |NN const CV *cv|NN const char *title
 #  endif
 #endif
 pdR    |CV*    |find_runcv     |U32 *db_seqp
@@ -1423,26 +1430,25 @@ p       |void   |free_tied_hv_pool
 p      |int    |get_debug_opts |const char **s|bool givehelp
 #endif
 Ap     |void   |save_set_svflags|SV* sv|U32 mask|U32 val
-Apod   |void   |hv_assert      |HV* tb
+Apod   |void   |hv_assert      |NN HV* tb
 
 #if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
 sM     |SV*    |hv_delete_common|HV* tb|SV* key_sv|const char* key|STRLEN klen|int k_flags|I32 d_flags|U32 hash
 sM     |HE*    |hv_fetch_common|HV* tb|SV* key_sv|const char* key|STRLEN klen|int flags|int action|SV* val|U32 hash
 #endif
 
-Apd    |void   |hv_clear_placeholders|HV* hb
-
-Apd    |SV*    |hv_scalar      |HV* hv|
-Apo    |I32*   |hv_riter_p     |HV* hv
-Apo    |HE**   |hv_eiter_p     |HV* hv
-Apo    |void   |hv_riter_set   |HV* hv|I32 riter
-Apo    |void   |hv_eiter_set   |HV* hv|HE* eiter
-Apo    |void   |hv_name_set    |HV* hv|const char *|I32 len|int flags
-Apo    |I32*   |hv_placeholders_p      |HV* hv
-Apo    |I32    |hv_placeholders_get    |HV* hv
-Apo    |void   |hv_placeholders_set    |HV* hv|I32 ph
+ApdR   |SV*    |hv_scalar      |NN HV* hv
+ApoR   |I32*   |hv_riter_p     |NN HV* hv
+ApoR   |HE**   |hv_eiter_p     |NN HV* hv
+Apo    |void   |hv_riter_set   |NN HV* hv|I32 riter
+Apo    |void   |hv_eiter_set   |NN HV* hv|HE* eiter
+Apo    |void   |hv_name_set    |NN HV* hv|const char *name|I32 len|int flags
+Apd    |void   |hv_clear_placeholders  |NN HV* hb
+ApoR   |I32*   |hv_placeholders_p      |NN HV* hv
+ApoR   |I32    |hv_placeholders_get    |NN HV* hv
+Apo    |void   |hv_placeholders_set    |NN HV* hv|I32 ph
 
-p      |SV*    |magic_scalarpack|HV* hv|MAGIC* mg
+p      |SV*    |magic_scalarpack|NN HV* hv|NN MAGIC* mg
 #ifdef PERL_IN_SV_C
 sMd    |SV*    |find_uninit_var|OP* obase|SV* uninit_sv|bool top
 #endif