From eda9cac17f1c742273b62b039f512bc88ffb37a1 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 9 Feb 2011 21:30:13 -0700 Subject: [PATCH] foldEQ_utf8: Add version with flags parameter The parameter doesn't do anything yet. The old version becomes a macro calling the new version with 0 as the flags. --- embed.fnc | 5 ++++- embed.h | 2 +- global.sym | 2 +- proto.h | 8 ++++++-- utf8.c | 4 ++-- utf8.h | 2 ++ 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/embed.fnc b/embed.fnc index cd7e187..1174f4f 100644 --- a/embed.fnc +++ b/embed.fnc @@ -517,9 +517,12 @@ AnpP |I32 |foldEQ_locale |NN const char* a|NN const char* b|I32 len Am |I32 |ibcmp_utf8 |NN const char *s1|NULLOK char **pe1|UV l1 \ |bool u1|NN const char *s2|NULLOK char **pe2 \ |UV l2|bool u2 -Apd |I32 |foldEQ_utf8 |NN const char *s1|NULLOK char **pe1|UV l1 \ +Amd |I32 |foldEQ_utf8 |NN const char *s1|NULLOK char **pe1|UV l1 \ |bool u1|NN const char *s2|NULLOK char **pe2 \ |UV l2|bool u2 +AMp |I32 |foldEQ_utf8_flags |NN const char *s1|NULLOK char **pe1|UV l1 \ + |bool u1|NN const char *s2|NULLOK char **pe2 \ + |UV l2|bool u2|U32 flags AnpP |I32 |foldEQ_latin1 |NN const char* a|NN const char* b|I32 len #if defined(PERL_IN_DOIO_C) sR |bool |ingroup |Gid_t testgid|bool effective diff --git a/embed.h b/embed.h index bfd03d4..297e55b 100644 --- a/embed.h +++ b/embed.h @@ -134,7 +134,7 @@ #define foldEQ Perl_foldEQ #define foldEQ_latin1 Perl_foldEQ_latin1 #define foldEQ_locale Perl_foldEQ_locale -#define foldEQ_utf8(a,b,c,d,e,f,g,h) Perl_foldEQ_utf8(aTHX_ a,b,c,d,e,f,g,h) +#define foldEQ_utf8_flags(a,b,c,d,e,f,g,h,i) Perl_foldEQ_utf8_flags(aTHX_ a,b,c,d,e,f,g,h,i) #ifndef PERL_IMPLICIT_CONTEXT #define form Perl_form #endif diff --git a/global.sym b/global.sym index 6c51510..276fd81 100644 --- a/global.sym +++ b/global.sym @@ -133,7 +133,7 @@ Perl_find_rundefsvoffset Perl_foldEQ Perl_foldEQ_latin1 Perl_foldEQ_locale -Perl_foldEQ_utf8 +Perl_foldEQ_utf8_flags Perl_form Perl_free_tmps Perl_get_av diff --git a/proto.h b/proto.h index 5436f59..960e5f5 100644 --- a/proto.h +++ b/proto.h @@ -994,10 +994,14 @@ PERL_CALLCONV I32 Perl_foldEQ_locale(const char* a, const char* b, I32 len) #define PERL_ARGS_ASSERT_FOLDEQ_LOCALE \ assert(a); assert(b) -PERL_CALLCONV I32 Perl_foldEQ_utf8(pTHX_ const char *s1, char **pe1, UV l1, bool u1, const char *s2, char **pe2, UV l2, bool u2) +/* PERL_CALLCONV I32 foldEQ_utf8(pTHX_ const char *s1, char **pe1, UV l1, bool u1, const char *s2, char **pe2, UV l2, bool u2) + __attribute__nonnull__(pTHX_1) + __attribute__nonnull__(pTHX_5); */ + +PERL_CALLCONV I32 Perl_foldEQ_utf8_flags(pTHX_ const char *s1, char **pe1, UV l1, bool u1, const char *s2, char **pe2, UV l2, bool u2, U32 flags) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_5); -#define PERL_ARGS_ASSERT_FOLDEQ_UTF8 \ +#define PERL_ARGS_ASSERT_FOLDEQ_UTF8_FLAGS \ assert(s1); assert(s2) PERL_CALLCONV char* Perl_form(pTHX_ const char* pat, ...) diff --git a/utf8.c b/utf8.c index f6cdba2..4399fca 100644 --- a/utf8.c +++ b/utf8.c @@ -3034,7 +3034,7 @@ http://www.unicode.org/unicode/reports/tr21/ (Case Mappings). =cut */ I32 -Perl_foldEQ_utf8(pTHX_ const char *s1, char **pe1, register UV l1, bool u1, const char *s2, char **pe2, register UV l2, bool u2) +Perl_foldEQ_utf8_flags(pTHX_ const char *s1, char **pe1, register UV l1, bool u1, const char *s2, char **pe2, register UV l2, bool u2, U32 flags) { dVAR; register const U8 *p1 = (const U8*)s1; /* Point to current char */ @@ -3051,7 +3051,7 @@ Perl_foldEQ_utf8(pTHX_ const char *s1, char **pe1, register UV l1, bool u1, cons U8 natbuf[2]; /* Holds native 8-bit char converted to utf8; these always fit in 2 bytes */ - PERL_ARGS_ASSERT_FOLDEQ_UTF8; + PERL_ARGS_ASSERT_FOLDEQ_UTF8_FLAGS; if (pe1) { e1 = *(U8**)pe1; diff --git a/utf8.h b/utf8.h index 88589a0..2386eb6 100644 --- a/utf8.h +++ b/utf8.h @@ -20,6 +20,8 @@ #define uvuni_to_utf8(d, uv) uvuni_to_utf8_flags(d, uv, 0) #define is_utf8_string_loc(s, len, ep) is_utf8_string_loclen(s, len, ep, 0) +#define foldEQ_utf8(s1, pe1, l1, u1, s2, pe2, l2, u2) \ + foldEQ_utf8_flags(s1, pe1, l1, u1, s2, pe2, l2, u2, 0) /* =for apidoc ibcmp_utf8 -- 1.8.3.1