From f0c7c524bb92cdc42cc4e0f7ba1ddda865a4494c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 16 Nov 2003 07:14:28 +0000 Subject: Update. * posix/regex_internal.h: Add forward declaration of re_dfa_t. Replace last two parameters of re_string_allocate and re_string_construct with pointer to DFA. (re_dfa_t): Add map_notascii field. * posix/regcomp.c (re_compile_internal): Add call of re_string_construct. (init_dfa): Initialize mpa_notascii. * posix/regex_internal.c: Adjust definitions of re_string_allocate and re_string_construct. Pass DFA to re_string_construct. Adjust definition. Initialize map_notascii field. (build_wcs_upper_buffer): If map_notascii is zero use simplfied method to map ASCII values to upper case. * posix/regex.c: Include localeinfo.h. * posix/regexec.c: Adjust call of re_string_allocate. * locale/langinfo.h: Add _NL_CTYPE_MAP_TO_NONASCII. * locale/localeinfo.h (LIMAGIC): Change value. * locale/categories.def. Add entry for _NL_CTYPE_MAP_TO_NONASCII. * locale/C-ctype.h: Likewise. * locale/programs/ld-ctype.c: Compute whether any mapping maps from ASCII to non-ASCII value. Write out that value. --- posix/regex_internal.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'posix/regex_internal.h') diff --git a/posix/regex_internal.h b/posix/regex_internal.h index 18622cad5c..9fcf865f65 100644 --- a/posix/regex_internal.h +++ b/posix/regex_internal.h @@ -335,6 +335,7 @@ struct re_string_t /* 1 if REG_ICASE. */ unsigned int icase : 1; unsigned int is_utf8 : 1; + unsigned int map_notascii : 1; int mb_cur_max; }; typedef struct re_string_t re_string_t; @@ -345,31 +346,32 @@ typedef struct re_string_t re_string_t; #define MBS_CASE_ALLOCATED(pstr) (pstr->trans != NULL) +struct re_dfa_t; +typedef struct re_dfa_t re_dfa_t; #ifndef RE_NO_INTERNAL_PROTOTYPES static reg_errcode_t re_string_allocate (re_string_t *pstr, const char *str, int len, int init_len, RE_TRANSLATE_TYPE trans, int icase, - int mb_cur_max, int is_utf8); + const re_dfa_t *dfa); static reg_errcode_t re_string_construct (re_string_t *pstr, const char *str, int len, RE_TRANSLATE_TYPE trans, - int icase, int mb_cur_max, - int is_utf8); + int icase, const re_dfa_t *dfa); static reg_errcode_t re_string_reconstruct (re_string_t *pstr, int idx, int eflags, int newline); static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr, int new_buf_len); -#ifdef RE_ENABLE_I18N +# ifdef RE_ENABLE_I18N static void build_wcs_buffer (re_string_t *pstr); static void build_wcs_upper_buffer (re_string_t *pstr); -#endif /* RE_ENABLE_I18N */ +# endif /* RE_ENABLE_I18N */ static void build_upper_buffer (re_string_t *pstr); static void re_string_translate_buffer (re_string_t *pstr); static void re_string_destruct (re_string_t *pstr); -#ifdef RE_ENABLE_I18N +# ifdef RE_ENABLE_I18N static int re_string_elem_size_at (const re_string_t *pstr, int idx); static inline int re_string_char_size_at (const re_string_t *pstr, int idx); static inline wint_t re_string_wchar_at (const re_string_t *pstr, int idx); -#endif /* RE_ENABLE_I18N */ +# endif /* RE_ENABLE_I18N */ static unsigned int re_string_context_at (const re_string_t *input, int idx, int eflags, int newline_anchor); #endif @@ -610,9 +612,9 @@ struct re_dfa_t collating element. */ unsigned int has_mb_node : 1; unsigned int is_utf8 : 1; + unsigned int map_notascii : 1; int mb_cur_max; }; -typedef struct re_dfa_t re_dfa_t; #ifndef RE_NO_INTERNAL_PROTOTYPES static reg_errcode_t re_node_set_alloc (re_node_set *set, int size); -- cgit 1.4.1