#endif
PERL_CALLCONV const char * Perl_PerlIO_context_layers(pTHX_ const char *mode);
+PERL_CALLCONV int Perl_PerlLIO_dup2_cloexec(pTHX_ int oldfd, int newfd);
+PERL_CALLCONV int Perl_PerlLIO_dup_cloexec(pTHX_ int oldfd)
+ __attribute__warn_unused_result__;
+
+PERL_CALLCONV int Perl_PerlLIO_open3_cloexec(pTHX_ const char *file, int flag, int perm)
+ __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_PERLLIO_OPEN3_CLOEXEC \
+ assert(file)
+
+PERL_CALLCONV int Perl_PerlLIO_open_cloexec(pTHX_ const char *file, int flag)
+ __attribute__warn_unused_result__;
+#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__;
PERL_CALLCONV UV Perl__to_utf8_upper_flags(pTHX_ const U8 *p, const U8 *e, U8* ustrp, STRLEN *lenp, bool flags, const char * const file, const int line);
#define PERL_ARGS_ASSERT__TO_UTF8_UPPER_FLAGS \
assert(p); assert(ustrp); assert(file)
+#ifndef PERL_NO_INLINE_FUNCTIONS
+PERL_STATIC_INLINE unsigned int S__variant_byte_number(PERL_UINTMAX_T word)
+ __attribute__warn_unused_result__;
+#endif
+
PERL_CALLCONV void Perl__warn_problematic_locale(void);
PERL_CALLCONV_NO_RET void Perl_abort_execution(pTHX_ const char * const msg, const char * const name)
__attribute__noreturn__;
#define PERL_ARGS_ASSERT_AV_MAKE \
assert(strp)
+PERL_CALLCONV SV* Perl_av_nonelem(pTHX_ AV *av, SSize_t ix);
+#define PERL_ARGS_ASSERT_AV_NONELEM \
+ assert(av)
PERL_CALLCONV SV* Perl_av_pop(pTHX_ AV *av);
#define PERL_ARGS_ASSERT_AV_POP \
assert(av)
PERL_CALLCONV bool Perl_do_eof(pTHX_ GV* gv);
#define PERL_ARGS_ASSERT_DO_EOF \
assert(gv)
-PERL_CALLCONV void Perl_do_execfree(pTHX);
PERL_CALLCONV void Perl_do_gv_dump(pTHX_ I32 level, PerlIO *file, const char *name, GV *sv);
#define PERL_ARGS_ASSERT_DO_GV_DUMP \
assert(file); assert(name)
#define PERL_ARGS_ASSERT_DO_TELL \
assert(gv)
-PERL_CALLCONV I32 Perl_do_trans(pTHX_ SV* sv);
+PERL_CALLCONV Size_t Perl_do_trans(pTHX_ SV* sv);
#define PERL_ARGS_ASSERT_DO_TRANS \
assert(sv)
PERL_CALLCONV UV Perl_do_vecget(pTHX_ SV* sv, STRLEN offset, int size);
#define PERL_ARGS_ASSERT_ISIDFIRST_LAZY \
assert(p)
-/* PERL_CALLCONV bool Perl_is_ascii_string(const U8* const s, const STRLEN len)
+/* PERL_CALLCONV bool Perl_is_ascii_string(const U8* const s, STRLEN len)
__attribute__warn_unused_result__
__attribute__pure__; */
PERL_CALLCONV int Perl_magic_setnkeys(pTHX_ SV* sv, MAGIC* mg);
#define PERL_ARGS_ASSERT_MAGIC_SETNKEYS \
assert(sv); assert(mg)
+PERL_CALLCONV int Perl_magic_setnonelem(pTHX_ SV* sv, MAGIC* mg);
+#define PERL_ARGS_ASSERT_MAGIC_SETNONELEM \
+ assert(sv); assert(mg)
PERL_CALLCONV int Perl_magic_setpack(pTHX_ SV* sv, MAGIC* mg);
#define PERL_ARGS_ASSERT_MAGIC_SETPACK \
assert(sv); assert(mg)
PERL_CALLCONV I32 Perl_my_lstat(pTHX);
#endif
PERL_CALLCONV I32 Perl_my_lstat_flags(pTHX_ const U32 flags);
+PERL_CALLCONV int Perl_my_mkstemp_cloexec(char *templte)
+ __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_MY_MKSTEMP_CLOEXEC \
+ assert(templte)
+
PERL_CALLCONV PerlIO* Perl_my_popen_list(pTHX_ const char* mode, int n, SV ** args);
#define PERL_ARGS_ASSERT_MY_POPEN_LIST \
assert(mode); assert(args)
PERL_CALLCONV CV * Perl_newXS_len_flags(pTHX_ const char *name, STRLEN len, XSUBADDR_t subaddr, const char *const filename, const char *const proto, SV **const_svp, U32 flags);
#define PERL_ARGS_ASSERT_NEWXS_LEN_FLAGS \
assert(subaddr)
-PERL_CALLCONV void Perl_new_numeric(pTHX_ const char* newcoll);
PERL_CALLCONV PERL_SI* Perl_new_stackinfo(pTHX_ I32 stitems, I32 cxitems)
__attribute__warn_unused_result__;
PERL_CALLCONV void Perl_setdefout(pTHX_ GV* gv);
#define PERL_ARGS_ASSERT_SETDEFOUT \
assert(gv)
-PERL_CALLCONV char* Perl_setlocale(int category, const char* locale);
+PERL_CALLCONV void Perl_setfd_cloexec(int fd);
+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 HEK* Perl_share_hek(pTHX_ const char* str, SSize_t len, U32 hash);
#define PERL_ARGS_ASSERT_SHARE_HEK \
assert(str)
#define PERL_ARGS_ASSERT_SWASH_INIT \
assert(pkg); assert(name); assert(listsv)
-PERL_CALLCONV void Perl_sync_locale(pTHX);
+PERL_CALLCONV void Perl_switch_to_global_locale(void);
+PERL_CALLCONV bool Perl_sync_locale(void);
PERL_CALLCONV void Perl_sys_init(int* argc, char*** argv);
#define PERL_ARGS_ASSERT_SYS_INIT \
assert(argc); assert(argv)
PERL_CALLCONV void Perl_taint_proper(pTHX_ const char* f, const char *const s);
#define PERL_ARGS_ASSERT_TAINT_PROPER \
assert(s)
+PERL_CALLCONV void Perl_thread_locale_init(void);
+PERL_CALLCONV void Perl_thread_locale_term(void);
PERL_CALLCONV OP * Perl_tied_method(pTHX_ SV *methname, SV **sp, SV *const sv, const MAGIC *const mg, const U32 flags, U32 argc, ...);
#define PERL_ARGS_ASSERT_TIED_METHOD \
assert(methname); assert(sp); assert(sv); assert(mg)
PERL_CALLCONV bool Perl_try_amagic_bin(pTHX_ int method, int flags);
PERL_CALLCONV bool Perl_try_amagic_un(pTHX_ int method, int flags);
-PERL_CALLCONV I32 Perl_unpack_str(pTHX_ const char *pat, const char *patend, const char *s, const char *strbeg, const char *strend, char **new_s, I32 ocnt, U32 flags);
+PERL_CALLCONV SSize_t Perl_unpack_str(pTHX_ const char *pat, const char *patend, const char *s, const char *strbeg, const char *strend, char **new_s, I32 ocnt, U32 flags);
#define PERL_ARGS_ASSERT_UNPACK_STR \
assert(pat); assert(patend); assert(s); assert(strend)
-PERL_CALLCONV I32 Perl_unpackstring(pTHX_ const char *pat, const char *patend, const char *s, const char *strend, U32 flags);
+PERL_CALLCONV SSize_t Perl_unpackstring(pTHX_ const char *pat, const char *patend, const char *s, const char *strend, U32 flags);
#define PERL_ARGS_ASSERT_UNPACKSTRING \
assert(pat); assert(patend); assert(s); assert(strend)
PERL_CALLCONV void Perl_unshare_hek(pTHX_ HEK* hek);
PERL_CALLCONV UV Perl_utf8n_to_uvchr_error(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, const U32 flags, U32 * errors);
#define PERL_ARGS_ASSERT_UTF8N_TO_UVCHR_ERROR \
assert(s)
+PERL_CALLCONV UV Perl_utf8n_to_uvchr_msgs(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, const U32 flags, U32 * errors, AV ** msgs);
+#define PERL_ARGS_ASSERT_UTF8N_TO_UVCHR_MSGS \
+ assert(s)
PERL_CALLCONV UV Perl_utf8n_to_uvuni(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags);
#define PERL_ARGS_ASSERT_UTF8N_TO_UVUNI \
assert(s)
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)
# endif
#endif
+#if !defined(HAS_MKOSTEMP)
+PERL_CALLCONV int Perl_my_mkostemp(char *templte, int flags);
+#define PERL_ARGS_ASSERT_MY_MKOSTEMP \
+ assert(templte)
+#endif
#if !defined(HAS_MKSTEMP)
PERL_CALLCONV int Perl_my_mkstemp(char *templte);
#define PERL_ARGS_ASSERT_MY_MKSTEMP \
#define PERL_ARGS_ASSERT_DO_EXEC3 \
assert(incmd)
#endif
+#if defined (HAS_SOCKETPAIR) || (defined (HAS_SOCKET) && defined(SOCK_DGRAM) && defined(AF_INET) && defined(PF_INET))
+PERL_CALLCONV int Perl_PerlSock_socketpair_cloexec(pTHX_ int domain, int type, int protocol, int *pairfd)
+ __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_PERLSOCK_SOCKETPAIR_CLOEXEC \
+ assert(pairfd)
+
+#endif
#if defined(DEBUGGING)
PERL_CALLCONV int Perl_get_debug_opts(pTHX_ const char **s, bool givehelp)
__attribute__warn_unused_result__;
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)
#if defined(HAS_NL_LANGINFO) && defined(PERL_LANGINFO_H)
PERL_CALLCONV const char* Perl_langinfo(const nl_item item);
#endif
+#if defined(HAS_PIPE)
+PERL_CALLCONV int Perl_PerlProc_pipe_cloexec(pTHX_ int *pipefd)
+ __attribute__warn_unused_result__;
+#define PERL_ARGS_ASSERT_PERLPROC_PIPE_CLOEXEC \
+ assert(pipefd)
+
+#endif
#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
PERL_CALLCONV Signal_t Perl_csighandler(int sig, siginfo_t *info, void *uap);
PERL_CALLCONV Signal_t Perl_sighandler(int sig, siginfo_t *info, void *uap);
#endif
+#if defined(HAS_SOCKET)
+PERL_CALLCONV int Perl_PerlSock_accept_cloexec(pTHX_ int listenfd, struct sockaddr *addr, Sock_size_t *addrlen)
+ __attribute__warn_unused_result__;
+
+PERL_CALLCONV int Perl_PerlSock_socket_cloexec(pTHX_ int domain, int type, int protocol)
+ __attribute__warn_unused_result__;
+
+#endif
#if defined(HAVE_INTERP_INTERN)
PERL_CALLCONV void Perl_sys_intern_clear(pTHX);
PERL_CALLCONV void Perl_sys_intern_init(pTHX);
#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__;
assert(gv); assert(mode); assert(saveifp); assert(saveofp); assert(savefd); assert(savetype)
#endif
#if defined(PERL_IN_DOOP_C)
-STATIC I32 S_do_trans_complex(pTHX_ SV * const sv)
+STATIC Size_t S_do_trans_complex(pTHX_ SV * const sv)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_DO_TRANS_COMPLEX \
assert(sv)
-STATIC I32 S_do_trans_complex_utf8(pTHX_ SV * const sv)
+STATIC Size_t S_do_trans_complex_utf8(pTHX_ SV * const sv)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_DO_TRANS_COMPLEX_UTF8 \
assert(sv)
-STATIC I32 S_do_trans_count(pTHX_ SV * const sv)
+STATIC Size_t S_do_trans_count(pTHX_ SV * const sv)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_DO_TRANS_COUNT \
assert(sv)
-STATIC I32 S_do_trans_count_utf8(pTHX_ SV * const sv)
+STATIC Size_t S_do_trans_count_utf8(pTHX_ SV * const sv)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_DO_TRANS_COUNT_UTF8 \
assert(sv)
-STATIC I32 S_do_trans_simple(pTHX_ SV * const sv)
+STATIC Size_t S_do_trans_simple(pTHX_ SV * const sv)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_DO_TRANS_SIMPLE \
assert(sv)
-STATIC I32 S_do_trans_simple_utf8(pTHX_ SV * const sv)
+STATIC Size_t S_do_trans_simple_utf8(pTHX_ SV * const sv)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_DO_TRANS_SIMPLE_UTF8 \
assert(sv)
assert(hv); assert(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);
#define PERL_ARGS_ASSERT_NEW_CTYPE \
assert(newctype)
+STATIC void S_new_numeric(pTHX_ const char* newnum);
STATIC void S_set_numeric_radix(pTHX_ const bool use_locale);
STATIC char* S_stdize_locale(pTHX_ char* locs);
#define PERL_ARGS_ASSERT_STDIZE_LOCALE \
assert(locs)
+# if defined(USE_POSIX_2008_LOCALE)
+STATIC const char* S_emulate_setlocale(const int category, const char* locale, unsigned int index, const bool is_index_valid);
+# endif
# if defined(WIN32)
STATIC char* S_win32_setlocale(pTHX_ int category, const char* locale);
# endif
STATIC char S_first_symbol(const char *pat, const char *patend);
#define PERL_ARGS_ASSERT_FIRST_SYMBOL \
assert(pat); assert(patend)
-STATIC const char * S_get_num(pTHX_ const char *patptr, I32 *lenptr)
+STATIC const char * S_get_num(pTHX_ const char *patptr, SSize_t *lenptr)
__attribute__warn_unused_result__;
#define PERL_ARGS_ASSERT_GET_NUM \
assert(patptr); assert(lenptr)
#define PERL_ARGS_ASSERT_IS_AN_INT \
assert(s)
-STATIC I32 S_measure_struct(pTHX_ struct tempsym* symptr);
+STATIC SSize_t S_measure_struct(pTHX_ struct tempsym* symptr);
#define PERL_ARGS_ASSERT_MEASURE_STRUCT \
assert(symptr)
STATIC SV* S_mul128(pTHX_ SV *sv, U8 m);
#define PERL_ARGS_ASSERT_SV_EXP_GROW \
assert(sv)
-STATIC I32 S_unpack_rec(pTHX_ struct tempsym* symptr, const char *s, const char *strbeg, const char *strend, const char **new_s);
+STATIC SSize_t S_unpack_rec(pTHX_ struct tempsym* symptr, const char *s, const char *strbeg, const char *strend, const char **new_s);
#define PERL_ARGS_ASSERT_UNPACK_REC \
assert(symptr); assert(s); assert(strbeg); assert(strend)
#endif
#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)
#define PERL_ARGS_ASSERT_FIND_BYCLASS \
assert(prog); assert(c); assert(s); assert(strend)
+STATIC char * S_find_next_ascii(char* s, const char * send, const bool is_utf8)
+ __attribute__warn_unused_result__;
+#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 \
STATIC I32 S_lop(pTHX_ I32 f, U8 x, char *s);
#define PERL_ARGS_ASSERT_LOP \
assert(s)
-PERL_STATIC_NO_RET void S_missingterm(pTHX_ char *s, const STRLEN len)
+PERL_STATIC_NO_RET void S_missingterm(pTHX_ char *s, STRLEN len)
__attribute__noreturn__;
STATIC SV* S_new_constant(pTHX_ const char *s, STRLEN len, const char *key, STRLEN keylen, SV *sv, SV *pv, const char *type, STRLEN typelen);
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 \