This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add Perl_setlocale()
[perl5.git] / proto.h
diff --git a/proto.h b/proto.h
index b1b7987..d35e295 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -49,6 +49,7 @@ PERL_CALLCONV int     Perl_PerlLIO_open_cloexec(pTHX_ const char *file, int flag)
 #define PERL_ARGS_ASSERT_PERLLIO_OPEN_CLOEXEC  \
        assert(file)
 
+PERL_CALLCONV const char*      Perl_setlocale(const int category, const char* locale);
 PERL_CALLCONV void*    Perl_Slab_Alloc(pTHX_ size_t sz)
                        __attribute__warn_unused_result__;
 
@@ -1393,11 +1394,6 @@ PERL_CALLCONV bool       Perl_isIDFIRST_lazy(pTHX_ const char* p)
 #define PERL_ARGS_ASSERT_ISIDFIRST_LAZY        \
        assert(p)
 
-PERL_CALLCONV bool     Perl_isSCRIPT_RUN(pTHX_ const U8 *s, const U8 *send, const bool utf8_target)
-                       __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_ISSCRIPT_RUN  \
-       assert(s); assert(send)
-
 /* PERL_CALLCONV bool  Perl_is_ascii_string(const U8* const s, STRLEN len)
                        __attribute__warn_unused_result__
                        __attribute__pure__; */
@@ -2951,7 +2947,6 @@ PERL_CALLCONV void        Perl_setfd_cloexec_for_nonsysfd(pTHX_ int fd);
 PERL_CALLCONV void     Perl_setfd_cloexec_or_inhexec_by_sysfdness(pTHX_ int fd);
 PERL_CALLCONV void     Perl_setfd_inhexec(int fd);
 PERL_CALLCONV void     Perl_setfd_inhexec_for_sysfd(pTHX_ int fd);
-PERL_CALLCONV char*    Perl_setlocale(int category, const char* locale);
 PERL_CALLCONV HEK*     Perl_share_hek(pTHX_ const char* str, SSize_t len, U32 hash);
 #define PERL_ARGS_ASSERT_SHARE_HEK     \
        assert(str)
@@ -3682,9 +3677,13 @@ PERL_CALLCONV void       Perl_utilize(pTHX_ int aver, I32 floor, OP* version, OP* idop
        assert(idop)
 /* PERL_CALLCONV U8*   uvchr_to_utf8(pTHX_ U8 *d, UV uv); */
 /* PERL_CALLCONV U8*   uvchr_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags); */
+/* PERL_CALLCONV U8*   uvchr_to_utf8_flags_msgs(pTHX_ U8 *d, UV uv, UV flags, HV ** msgs); */
 PERL_CALLCONV U8*      Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, const UV flags);
 #define PERL_ARGS_ASSERT_UVOFFUNI_TO_UTF8_FLAGS        \
        assert(d)
+PERL_CALLCONV U8*      Perl_uvoffuni_to_utf8_flags_msgs(pTHX_ U8 *d, UV uv, const UV flags, HV** msgs);
+#define PERL_ARGS_ASSERT_UVOFFUNI_TO_UTF8_FLAGS_MSGS   \
+       assert(d)
 PERL_CALLCONV U8*      Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv);
 #define PERL_ARGS_ASSERT_UVUNI_TO_UTF8 \
        assert(d)
@@ -4188,7 +4187,7 @@ STATIC const regnode*     S_dumpuntil(pTHX_ const regexp *r, const regnode *start, c
        assert(r); assert(start); assert(node); assert(sv)
 STATIC bool    S_put_charclass_bitmap_innards(pTHX_ SV* sv, char* bitmap, SV* nonbitmap_invlist, SV* only_utf8_locale_invlist, const regnode * const node, const bool force_as_is_display);
 #define PERL_ARGS_ASSERT_PUT_CHARCLASS_BITMAP_INNARDS  \
-       assert(sv); assert(bitmap)
+       assert(sv)
 STATIC SV*     S_put_charclass_bitmap_innards_common(pTHX_ SV* invlist, SV* posixes, SV* only_utf8, SV* not_utf8, SV* only_utf8_locale, const bool invert);
 #define PERL_ARGS_ASSERT_PUT_CHARCLASS_BITMAP_INNARDS_COMMON   \
        assert(invlist)
@@ -4378,6 +4377,11 @@ PERL_STATIC_INLINE STRLEN        S_sv_or_pv_pos_u2b(pTHX_ SV *sv, const char *pv, STRLE
 #endif
 #endif
 #if defined(PERL_CORE) || defined(PERL_EXT)
+PERL_CALLCONV bool     Perl_isSCRIPT_RUN(pTHX_ const U8 *s, const U8 *send, const bool utf8_target, SCX_enum * ret_script)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_ISSCRIPT_RUN  \
+       assert(s); assert(send)
+
 #ifndef PERL_NO_INLINE_FUNCTIONS
 PERL_STATIC_INLINE Size_t      S_variant_under_utf8_count(const U8* const s, const U8* const e)
                        __attribute__warn_unused_result__;
@@ -4693,11 +4697,13 @@ PERL_CALLCONV SV*       Perl_hfree_next_entry(pTHX_ HV *hv, STRLEN *indexp);
 #endif
 #if defined(PERL_IN_LOCALE_C)
 STATIC const char*     S_category_name(const int category);
+STATIC void    S_restore_switched_locale(pTHX_ const int category, const char * const original_locale);
 #ifndef PERL_NO_INLINE_FUNCTIONS
 PERL_STATIC_INLINE const char *        S_save_to_buffer(const char * string, char **buf, Size_t *buf_size, const Size_t offset);
 #define PERL_ARGS_ASSERT_SAVE_TO_BUFFER        \
        assert(string); assert(buf_size)
 #endif
+STATIC const char*     S_switch_category_locale_to_template(pTHX_ const int switch_category, const int template_category, const char * template_locale);
 #  if defined(USE_LOCALE)
 STATIC void    S_new_collate(pTHX_ const char* newcoll);
 STATIC void    S_new_ctype(pTHX_ const char* newctype);
@@ -5179,6 +5185,11 @@ STATIC int       S_edit_distance(const UV *src, const UV *tgt, const STRLEN x, const S
 #define PERL_ARGS_ASSERT_EDIT_DISTANCE \
        assert(src); assert(tgt)
 
+STATIC SV *    S_get_ANYOFM_contents(pTHX_ const regnode * n)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_GET_ANYOFM_CONTENTS   \
+       assert(n)
+
 STATIC SV*     S_get_ANYOF_cp_list_for_ssc(pTHX_ const RExC_state_t *pRExC_state, const regnode_charclass* const node);
 #define PERL_ARGS_ASSERT_GET_ANYOF_CP_LIST_FOR_SSC     \
        assert(pRExC_state); assert(node)
@@ -5572,11 +5583,26 @@ STATIC char *   S_find_next_ascii(char* s, const char * send, const bool is_utf8)
 #define PERL_ARGS_ASSERT_FIND_NEXT_ASCII       \
        assert(s); assert(send)
 
+STATIC char *  S_find_next_masked(char * s, const char * send, const U8 byte, const U8 mask)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_FIND_NEXT_MASKED      \
+       assert(s); assert(send)
+
 STATIC char *  S_find_next_non_ascii(char* s, const char * send, const bool is_utf8)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_FIND_NEXT_NON_ASCII   \
        assert(s); assert(send)
 
+STATIC char *  S_find_span_end(char* s, const char * send, const char span_byte)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_FIND_SPAN_END \
+       assert(s); assert(send)
+
+STATIC U8 *    S_find_span_end_mask(U8 * s, const U8 * send, const U8 span_byte, const U8 mask)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_FIND_SPAN_END_MASK    \
+       assert(s); assert(send)
+
 STATIC bool    S_isFOO_utf8_lc(pTHX_ const U8 classnum, const U8* character)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_ISFOO_UTF8_LC \
@@ -5970,6 +5996,11 @@ PERL_STATIC_INLINE int   S_is_utf8_overlong_given_start_byte_ok(const U8 * const s
        assert(s)
 #endif
 
+STATIC HV *    S_new_msg_hv(pTHX_ const char * const message, U32 categories, U32 flag)
+                       __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_NEW_MSG_HV    \
+       assert(message)
+
 STATIC U8*     S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val, const bool wants_value, const U8* const typestr)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_SWASH_SCAN_LIST_LINE  \