From 77d654fbc7477bd2bbb8741fcbb08e9b541f53e3 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 18 Feb 2014 09:05:09 -0700 Subject: [PATCH] regexec.c: Rename function, add parameter, make non-static This is in preparation for a future commit where the function does more things so its current name would be misleading. It will need to be callable from regcomp.c as well. --- embed.fnc | 10 +++++++--- embed.h | 4 +++- proto.h | 13 +++++++------ regexec.c | 17 +++++++++++------ 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/embed.fnc b/embed.fnc index f520740..c90bf6c 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1508,6 +1508,13 @@ EXpMR |IV |_invlist_search |NN SV* const invlist|const UV cp EXMpR |SV* |_get_swash_invlist|NN SV* const swash EXMpR |HV* |_swash_inversion_hash |NN SV* const swash #endif +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) +ApM |SV* |_get_regclass_nonbitmap_data \ + |NULLOK const regexp *prog \ + |NN const struct regnode *node|bool doinit \ + |NULLOK SV **listsvp \ + |NULLOK SV **lonly_utf8_locale +#endif #if defined(PERL_IN_REGCOMP_C) || defined (PERL_IN_DUMP_C) EXMp |void |_invlist_dump |NN PerlIO *file|I32 level \ |NN const char* const indent \ @@ -2171,9 +2178,6 @@ Es |CHECKPOINT|regcppush |NN const regexp *rex|I32 parenfloor\ Es |void |regcppop |NN regexp *rex\ |NN U32 *maxopenparen_p ERsn |U8* |reghop3 |NN U8 *s|SSize_t off|NN const U8 *lim -ERsM |SV* |core_regclass_swash|NULLOK const regexp *prog \ - |NN const struct regnode *node|bool doinit \ - |NULLOK SV **listsvp ERsn |U8* |reghop4 |NN U8 *s|SSize_t off|NN const U8 *llim \ |NN const U8 *rlim ERsn |U8* |reghopmaybe3 |NN U8 *s|SSize_t off|NN const U8 *lim diff --git a/embed.h b/embed.h index 125c6ab..0574367 100644 --- a/embed.h +++ b/embed.h @@ -796,6 +796,9 @@ #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_PERL_C) || defined(PERL_IN_UTF8_C) #define _new_invlist_C_array(a) Perl__new_invlist_C_array(aTHX_ a) #endif +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) +#define _get_regclass_nonbitmap_data(a,b,c,d,e) Perl__get_regclass_nonbitmap_data(aTHX_ a,b,c,d,e) +#endif #if defined(PERL_MAD) #define newFORM(a,b,c) Perl_newFORM(aTHX_ a,b,c) #endif @@ -999,7 +1002,6 @@ #define _swash_to_invlist(a) Perl__swash_to_invlist(aTHX_ a) # endif # if defined(PERL_IN_REGEXEC_C) -#define core_regclass_swash(a,b,c,d) S_core_regclass_swash(aTHX_ a,b,c,d) #define find_byclass(a,b,c,d,e) S_find_byclass(aTHX_ a,b,c,d,e) #define isFOO_lc(a,b) S_isFOO_lc(aTHX_ a,b) #define isFOO_utf8_lc(a,b) S_isFOO_utf8_lc(aTHX_ a,b) diff --git a/proto.h b/proto.h index 0ebb7a4..4a7533d 100644 --- a/proto.h +++ b/proto.h @@ -6985,6 +6985,13 @@ PERL_CALLCONV SV* Perl__new_invlist_C_array(pTHX_ const UV* const list) assert(list) #endif +#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) +PERL_CALLCONV SV* Perl__get_regclass_nonbitmap_data(pTHX_ const regexp *prog, const struct regnode *node, bool doinit, SV **listsvp, SV **lonly_utf8_locale) + __attribute__nonnull__(pTHX_2); +#define PERL_ARGS_ASSERT__GET_REGCLASS_NONBITMAP_DATA \ + assert(node) + +#endif #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C) PERL_CALLCONV SV* Perl__get_swash_invlist(pTHX_ SV* const swash) __attribute__warn_unused_result__ @@ -7131,12 +7138,6 @@ PERL_CALLCONV SV* Perl__swash_to_invlist(pTHX_ SV* const swash) #endif #if defined(PERL_IN_REGEXEC_C) -STATIC SV* S_core_regclass_swash(pTHX_ const regexp *prog, const struct regnode *node, bool doinit, SV **listsvp) - __attribute__warn_unused_result__ - __attribute__nonnull__(pTHX_2); -#define PERL_ARGS_ASSERT_CORE_REGCLASS_SWASH \ - assert(node) - STATIC char* S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s, const char *strend, regmatch_info *reginfo) __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1) diff --git a/regexec.c b/regexec.c index c93171d..d1a6dcc 100644 --- a/regexec.c +++ b/regexec.c @@ -7505,14 +7505,19 @@ Perl_regclass_swash(pTHX_ const regexp *prog, const regnode* node, bool doinit, *altsvp = NULL; } - return newSVsv(core_regclass_swash(prog, node, doinit, listsvp)); + return newSVsv(_get_regclass_nonbitmap_data(prog, node, doinit, listsvp, NULL)); } #endif -STATIC SV * -S_core_regclass_swash(pTHX_ const regexp *prog, const regnode* node, bool doinit, SV** listsvp) +SV * +Perl__get_regclass_nonbitmap_data(pTHX_ const regexp *prog, + const regnode* node, + bool doinit, + SV** listsvp, + SV** only_utf8_locale_ptr) { - /* Returns the swash for the input 'node' in the regex 'prog'. + /* For internal core use only. + * Returns the swash for the input 'node' in the regex 'prog'. * If is 'true', will attempt to create the swash if not already * done. * If is non-null, will return the printable contents of the @@ -7530,7 +7535,7 @@ S_core_regclass_swash(pTHX_ const regexp *prog, const regnode* node, bool doinit RXi_GET_DECL(prog,progi); const struct reg_data * const data = prog ? progi->data : NULL; - PERL_ARGS_ASSERT_CORE_REGCLASS_SWASH; + PERL_ARGS_ASSERT__GET_REGCLASS_NONBITMAP_DATA; assert(ANYOF_FLAGS(node) & (ANYOF_UTF8|ANYOF_NONBITMAP_NON_UTF8)); @@ -7729,7 +7734,7 @@ S_reginclass(pTHX_ regexp * const prog, const regnode * const n, const U8* const else if ((flags & ANYOF_NONBITMAP_NON_UTF8) || (utf8_target && (flags & ANYOF_UTF8))) { - SV * const sw = core_regclass_swash(prog, n, TRUE, 0); + SV * const sw = _get_regclass_nonbitmap_data(prog, n, TRUE, 0, NULL); if (sw) { U8 * utf8_p; if (utf8_target) { -- 2.7.4