diff options
author | Karl Williamson <khw@cpan.org> | 2019-09-11 17:08:25 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-09-15 10:39:56 -0600 |
commit | 94b0cb42d04bb202dba31ef85db6c93b0c93ae6d (patch) | |
tree | 5ea9e4f2dde9ce670ec2babc72f9c638446553c7 | |
parent | ffd62fc2fb74955cac5af41e7b3820e09877c3b4 (diff) | |
download | perl-94b0cb42d04bb202dba31ef85db6c93b0c93ae6d.tar.gz |
Fix up get_regex_charset_name()
This inline function should not be visible outside certain core (and
ext/re) functions. Make that happen.
-rw-r--r-- | embed.fnc | 3 | ||||
-rw-r--r-- | embed.h | 3 | ||||
-rw-r--r-- | inline.h | 8 | ||||
-rw-r--r-- | proto.h | 7 |
4 files changed, 20 insertions, 1 deletions
@@ -1942,6 +1942,9 @@ EiRT |UV |_invlist_len |NN SV* const invlist EiRT |bool |_invlist_contains_cp|NN SV* const invlist|const UV cp EXpRT |SSize_t|_invlist_search |NN SV* const invlist|const UV cp #endif +#if defined(PERL_IN_PP_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) || defined(PERL_IN_UNIVERSAL_C) +EiT |const char *|get_regex_charset_name|const U32 flags|NN STRLEN* const lenp +#endif #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) EXp |SV* |_get_regclass_nonbitmap_data \ |NULLOK const regexp *prog \ @@ -1182,6 +1182,9 @@ #define isSCRIPT_RUN(a,b,c) Perl_isSCRIPT_RUN(aTHX_ a,b,c) #define variant_under_utf8_count S_variant_under_utf8_count # endif +# if defined(PERL_IN_PP_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) || defined(PERL_IN_UNIVERSAL_C) +#define get_regex_charset_name S_get_regex_charset_name +# endif # if defined(PERL_IN_REGCOMP_C) #define _make_exactf_invlist(a,b) S__make_exactf_invlist(aTHX_ a,b) #define add_above_Latin1_folds(a,b,c) S_add_above_Latin1_folds(aTHX_ a,b,c) @@ -1983,11 +1983,15 @@ S_lossless_NV_to_IV(const NV nv, IV *ivp) /* ------------------ pp.c, regcomp.c, toke.c, universal.c ------------ */ +#if defined(PERL_IN_PP_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) || defined(PERL_IN_UNIVERSAL_C) + #define MAX_CHARSET_NAME_LENGTH 2 PERL_STATIC_INLINE const char * -get_regex_charset_name(const U32 flags, STRLEN* const lenp) +S_get_regex_charset_name(const U32 flags, STRLEN* const lenp) { + PERL_ARGS_ASSERT_GET_REGEX_CHARSET_NAME; + /* Returns a string that corresponds to the name of the regex character set * given by 'flags', and *lenp is set the length of that string, which * cannot exceed MAX_CHARSET_NAME_LENGTH characters */ @@ -2008,6 +2012,8 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp) return "?"; /* Unknown */ } +#endif + /* Return false if any get magic is on the SV other than taint magic. @@ -5799,6 +5799,13 @@ PERL_CALLCONV GV* Perl_softref2xv(pTHX_ SV *const sv, const char *const what, co assert(sv); assert(what); assert(spp) #endif +#if defined(PERL_IN_PP_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C) || defined(PERL_IN_UNIVERSAL_C) +#ifndef PERL_NO_INLINE_FUNCTIONS +PERL_STATIC_INLINE const char * S_get_regex_charset_name(const U32 flags, STRLEN* const lenp); +#define PERL_ARGS_ASSERT_GET_REGEX_CHARSET_NAME \ + assert(lenp) +#endif +#endif #if defined(PERL_IN_PP_CTL_C) STATIC PerlIO * S_check_type_and_open(pTHX_ SV *name) __attribute__warn_unused_result__; |