Simplify the implementation of SvPV*nolen functions
[p5sagit/p5-mst-13.2.git] / proto.h
diff --git a/proto.h b/proto.h
index a89c45f..a3be5fb 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -57,7 +57,9 @@ PERL_CALLCONV Malloc_t        Perl_realloc(Malloc_t where, MEM_SIZE nbytes)
 
 PERL_CALLCONV Free_t   Perl_mfree(Malloc_t where);
 #if defined(MYMALLOC)
-PERL_CALLCONV MEM_SIZE Perl_malloced_size(void *p);
+PERL_CALLCONV MEM_SIZE Perl_malloced_size(void *p)
+                       __attribute__warn_unused_result__;
+
 #endif
 
 PERL_CALLCONV void*    Perl_get_context(void);
@@ -453,12 +455,18 @@ PERL_CALLCONV void        Perl_init_stacks(pTHX);
 PERL_CALLCONV void     Perl_init_tm(pTHX_ struct tm *ptm);
 PERL_CALLCONV U32      Perl_intro_my(pTHX);
 PERL_CALLCONV char*    Perl_instr(pTHX_ const char* big, const char* little)
+                       __attribute__warn_unused_result__
                        __attribute__pure__
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
-PERL_CALLCONV bool     Perl_io_close(pTHX_ IO* io, bool not_implicit);
-PERL_CALLCONV OP*      Perl_invert(pTHX_ OP* cmd);
+PERL_CALLCONV bool     Perl_io_close(pTHX_ IO* io, bool not_implicit)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV OP*      Perl_invert(pTHX_ OP* cmd)
+                       __attribute__warn_unused_result__;
+
 PERL_CALLCONV bool     Perl_is_gv_magical(pTHX_ const char *name, STRLEN len, U32 flags)
                        __attribute__warn_unused_result__;
 
@@ -612,8 +620,10 @@ PERL_CALLCONV bool Perl_is_utf8_string(pTHX_ const U8 *s, STRLEN len)
                        __attribute__nonnull__(pTHX_1);
 
 PERL_CALLCONV bool     Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **p)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_3);
+                       __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV bool     Perl_is_utf8_string_loclen(pTHX_ const U8 *s, STRLEN len, const U8 **ep, STRLEN *el)
+                       __attribute__nonnull__(pTHX_1);
 
 PERL_CALLCONV bool     Perl_is_utf8_alnum(pTHX_ const U8 *p)
                        __attribute__warn_unused_result__
@@ -1025,6 +1035,10 @@ PERL_CALLCONV SV*        Perl_newSVpvn(pTHX_ const char* s, STRLEN len)
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 
+PERL_CALLCONV SV*      Perl_newSVhek(pTHX_ const HEK *hek)
+                       __attribute__malloc__
+                       __attribute__warn_unused_result__;
+
 PERL_CALLCONV SV*      Perl_newSVpvn_share(pTHX_ const char* s, I32 len, U32 hash)
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
@@ -1497,8 +1511,12 @@ PERL_CALLCONV SV*        Perl_sv_newmortal(pTHX)
 
 PERL_CALLCONV SV*      Perl_sv_newref(pTHX_ SV* sv);
 PERL_CALLCONV char*    Perl_sv_peek(pTHX_ SV* sv);
-PERL_CALLCONV void     Perl_sv_pos_u2b(pTHX_ SV* sv, I32* offsetp, I32* lenp);
-PERL_CALLCONV void     Perl_sv_pos_b2u(pTHX_ SV* sv, I32* offsetp);
+PERL_CALLCONV void     Perl_sv_pos_u2b(pTHX_ SV* sv, I32* offsetp, I32* lenp)
+                       __attribute__nonnull__(pTHX_2);
+
+PERL_CALLCONV void     Perl_sv_pos_b2u(pTHX_ SV* sv, I32* offsetp)
+                       __attribute__nonnull__(pTHX_2);
+
 /* PERL_CALLCONV char* sv_pvn_force(pTHX_ SV* sv, STRLEN* lp); */
 PERL_CALLCONV char*    Perl_sv_pvutf8n_force(pTHX_ SV* sv, STRLEN* lp);
 PERL_CALLCONV char*    Perl_sv_pvbyten_force(pTHX_ SV* sv, STRLEN* lp);
@@ -1852,9 +1870,7 @@ STATIC void       S_hv_magic_check(pTHX_ HV *hv, bool *needs_copy, bool *needs_store)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 
-STATIC void    S_unshare_hek_or_pvn(pTHX_ HEK* hek, const char* sv, I32 len, U32 hash)
-                       __attribute__nonnull__(pTHX_2);
-
+STATIC void    S_unshare_hek_or_pvn(pTHX_ HEK* hek, const char* str, I32 len, U32 hash);
 STATIC HE*     S_share_hek_flags(pTHX_ const char* sv, I32 len, U32 hash, int flags)
                        __attribute__warn_unused_result__;
 
@@ -1863,6 +1879,10 @@ STATIC void      S_hv_notallowed(pTHX_ int flags, const char *key, I32 klen, const ch
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_4);
 
+STATIC struct xpvhv_aux*       S_hv_auxinit(pTHX_ HV *hv)
+                       __attribute__malloc__
+                       __attribute__warn_unused_result__;
+
 #endif
 
 #if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT)
@@ -2198,10 +2218,21 @@ STATIC SV*      S_method_common(pTHX_ SV* meth, U32* hashp);
 #endif
 
 #if defined(PERL_IN_PP_SYS_C) || defined(PERL_DECL_PROT)
-STATIC OP*     S_doform(pTHX_ CV *cv, GV *gv, OP *retop);
-STATIC int     S_emulate_eaccess(pTHX_ const char* path, Mode_t mode);
+STATIC OP*     S_doform(pTHX_ CV *cv, GV *gv, OP *retop)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2)
+                       __attribute__nonnull__(pTHX_3);
+
+STATIC int     S_emulate_eaccess(pTHX_ const char* path, Mode_t mode)
+                       __attribute__noreturn__
+                       __attribute__nonnull__(pTHX_1);
+
 #  if !defined(HAS_MKDIR) || !defined(HAS_RMDIR)
-STATIC int     S_dooneliner(pTHX_ char *cmd, char *filename);
+STATIC int     S_dooneliner(pTHX_ const char *cmd, const char *filename)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+
 #  endif
 #endif
 
@@ -2375,7 +2406,7 @@ STATIC bool       S_utf8_mg_pos_init(pTHX_ SV *sv, MAGIC **mgp, STRLEN **cachep, I32 i
                        __attribute__nonnull__(pTHX_7);
 
 #if defined(PERL_COPY_ON_WRITE)
-STATIC void    S_sv_release_COW(pTHX_ SV *sv, char *pvx, STRLEN cur, STRLEN len, U32 hash, SV *after);
+STATIC void    S_sv_release_COW(pTHX_ SV *sv, const char *pvx, STRLEN cur, STRLEN len, U32 hash, SV *after);
 #endif
 #endif
 
@@ -2463,6 +2494,12 @@ STATIC SV*       S_mess_alloc(pTHX);
 STATIC NV      S_mulexp10(NV value, I32 exponent);
 #endif
 
+#if defined(PERL_IN_UTF8_C) || defined(PERL_DECL_PROT)
+STATIC STRLEN  S_is_utf8_char_slow(pTHX_ const U8 *s, const STRLEN len)
+                       __attribute__nonnull__(pTHX_1);
+
+#endif
+
 START_EXTERN_C
 
 PERL_CALLCONV void     Perl_sv_setsv_flags(pTHX_ SV* dsv, SV* ssv, I32 flags)
@@ -2565,17 +2602,43 @@ STATIC SV*      S_hv_delete_common(pTHX_ HV* tb, SV* key_sv, const char* key, STRLEN
 STATIC HE*     S_hv_fetch_common(pTHX_ HV* tb, SV* key_sv, const char* key, STRLEN klen, int flags, int action, SV* val, U32 hash);
 #endif
 
-PERL_CALLCONV void     Perl_hv_clear_placeholders(pTHX_ HV* hb);
+PERL_CALLCONV SV*      Perl_hv_scalar(pTHX_ HV* hv)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV I32*     Perl_hv_riter_p(pTHX_ HV* hv)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV HE**     Perl_hv_eiter_p(pTHX_ HV* hv)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV void     Perl_hv_riter_set(pTHX_ HV* hv, I32 riter)
+                       __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV void     Perl_hv_eiter_set(pTHX_ HV* hv, HE* eiter)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2);
+
+PERL_CALLCONV void     Perl_hv_name_set(pTHX_ HV* hv, const char *name, I32 len, int flags)
+                       __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV void     Perl_hv_clear_placeholders(pTHX_ HV* hb)
+                       __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV I32*     Perl_hv_placeholders_p(pTHX_ HV* hv)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV I32      Perl_hv_placeholders_get(pTHX_ HV* hv)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
+
+PERL_CALLCONV void     Perl_hv_placeholders_set(pTHX_ HV* hv, I32 ph)
+                       __attribute__warn_unused_result__
+                       __attribute__nonnull__(pTHX_1);
 
-PERL_CALLCONV SV*      Perl_hv_scalar(pTHX_ HV* hv);
-PERL_CALLCONV I32*     Perl_hv_riter_p(pTHX_ HV* hv);
-PERL_CALLCONV HE**     Perl_hv_eiter_p(pTHX_ HV* hv);
-PERL_CALLCONV void     Perl_hv_riter_set(pTHX_ HV* hv, I32 riter);
-PERL_CALLCONV void     Perl_hv_eiter_set(pTHX_ HV* hv, HE* eiter);
-PERL_CALLCONV void     Perl_hv_name_set(pTHX_ HV* hv, const char *, I32 len, int flags);
-PERL_CALLCONV I32*     Perl_hv_placeholders_p(pTHX_ HV* hv);
-PERL_CALLCONV I32      Perl_hv_placeholders_get(pTHX_ HV* hv);
-PERL_CALLCONV void     Perl_hv_placeholders_set(pTHX_ HV* hv, I32 ph);
 
 PERL_CALLCONV SV*      Perl_magic_scalarpack(pTHX_ HV* hv, MAGIC*      mg);
 #ifdef PERL_IN_SV_C