aboutsummaryrefslogtreecommitdiff
path: root/posix/fnmatch_loop.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-01 19:36:44 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-01 19:36:44 +0000
commit4c7d276eb123523c66c1d8cbf7dbb10fac674cd2 (patch)
tree05a73708dde7dc5e9bf16bbd35c82233c7f2afdc /posix/fnmatch_loop.c
parentaebb1faa198634a318bc14cf1e577f5806fafc38 (diff)
downloadglibc-4c7d276eb123523c66c1d8cbf7dbb10fac674cd2.tar
glibc-4c7d276eb123523c66c1d8cbf7dbb10fac674cd2.tar.gz
glibc-4c7d276eb123523c66c1d8cbf7dbb10fac674cd2.tar.bz2
glibc-4c7d276eb123523c66c1d8cbf7dbb10fac674cd2.zip
Update.
2000-08-31 Bruno Haible <haible@clisp.cons.org> * wctype/wcfuncs.c (iswblank): New function. * wctype/wcfuncs_l.c (__iswblank_l): New function. * wctype/wcextra.c: Remove file. * wctype/wcextra_l.c: Remove file. * wctype/Makefile (distribute): Remove wcextra and wcextra_l. 2000-08-31 Bruno Haible <haible@clisp.cons.org> * locale/programs/ld-collate.c (collate_output): Remove redundant assert call. * string/strcoll.c: Likewise. * string/strxfrm.c: Include assert.h. Add assert calls like in string/strcoll.c. 2000-08-31 Bruno Haible <haible@clisp.cons.org> * locale/categories.def (_NL_COLLATE_HASH_SIZE, _NL_COLLATE_HASH_LAYERS, _NL_COLLATE_NAMES, _NL_CTYPE_NAMES, _NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS): Remove definitions. * locale/langinfo.h (_NL_COLLATE_HASH_SIZE, _NL_COLLATE_HASH_LAYERS, _NL_COLLATE_NAMES): Rename to _NL_COLLATE_GAP1/2/3 respectively. (_NL_CTYPE_NAMES): Rename to _NL_CTYPE_GAP3. (_NL_CTYPE_GAP3): Rename to _NL_CTYPE_GAP4. (_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS): Rename to _NL_CTYPE_GAP5/6 respectively. * locale/C-ctype.c (_nl_C_LC_CTYPE): Update. * ctype/ctype-info.c (__ctype_names, __ctype_width): Remove variables. * locale/lc-ctype.c (_nl_postload_ctype): Assume new locale format. Don't initialize __ctype_names and __ctype_width. * wctype/cname-lookup.h: Remove file. * wctype/Makefile (distribute): Remove cname-lookup.h. * wctype/wchar-lookup.h: Include stdint.h. * wctype/wctype.c (__wctype): Assume new locale format. * wctype/wctype_l.c (__wctype_l): Likewise. * wctype/iswctype.c: Don't include cname-lookup.h. (__iswctype): Assume new locale format. * wctype/iswctype_l.c: Don't include cname-lookup.h. (__iswctype_l): Assume new locale format. * wctype/wctrans.c: Don't include ctype.h. (wctrans): Assume new locale format. * wctype/wctrans_l.c (__wctrans_l): Likewise. * wctype/towctrans.c: Don't include cname-lookup.h. (__towctrans): Assume new locale format. * wctype/towctrans_l.c: Don't include cname-lookup.h. (__towctrans_l): Assume new locale format. * wctype/wcfuncs.c: Don't include ctype.h and cname-lookup.h. Include localeinfo.h instead. (__NO_WCTYPE): Remove unused macro. (__ctype32_b, __ctype32_toupper, __ctype32_tolower): Remove declarations. (iswalnum, iswalpha, iswcntrl, iswdigit, iswlower, iswgraph, iswprint, iswpunct, iswspace, iswupper, iswxdigit): Assume new locale format. (towlower, towupper): Likewise. * wctype/wcfuncs_l.c: Don't include cname-lookup.h. Include localeinfo.h instead. (__NO_WCTYPE): Remove unused macro. (__iswalnum_l, __iswalpha_l, __iswcntrl_l, __iswdigit_l, __iswlower_l, __iswgraph_l, __iswprint_l, __iswpunct_l, __iswspace_l, __iswupper_l, __iswxdigit_l): Assume new locale format. (__towlower_l, __towupper_l): Likewise. * wcsmbs/wcwidth.h: Don't include cname-lookup.h. (__ctype32_b): Remove declaration. (internal_wcwidth): Assume new locale format. * locale/programs/ld-ctype.c (struct locale_ctype_t): Remove fields plane_size, plane_cnt, names, width. Rename map to map_b, rename map32 to map32_b, rename width_3level to width. (ctype_output): Always create new locale format. Don't emit _NL_CTYPE_NAMES, _NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS any more. (allocate_arrays): Always create new locale format. * locale/C-collate.c (_nl_C_LC_COLLATE): Update. * locale/weightwc.h (findidx): Assume new locale format. * string/strcoll.c (wcscoll): Remove local variables size, layers, names. * string/strxfrm.c (wcsxfrm): Likewise. * posix/fnmatch_loop.c (internal_fnwmatch): Likewise. Change type of local variable collseq to 'const char *'. (SUFFIX): Don't use, don't undefine. * posix/fnmatch.c: Remove SUFFIX definition. * locale/programs/ld-collate.c (struct locale_collate_t): Remove fields plane_size, plane_cnt, wcheads, wcseqorder. Rename wcheads_3level to wcheads, rename wcseqorder_3level to wcseqorder. (collate_finish): Always create new locale format. Remove local variables min_total, act_size. (collate_output): Always create new locale format. Remove local variables table_size, names, tablewc. Rename tablewc_3level to tablewc. 2000-08-31 Bruno Haible <haible@clisp.cons.org> * locale/programs/ld-collate.c (obstack_int32_grow, obstack_int32_grow_fast): New inline functions. (output_weightwc, collate_output): Use them where possible.
Diffstat (limited to 'posix/fnmatch_loop.c')
-rw-r--r--posix/fnmatch_loop.c153
1 files changed, 23 insertions, 130 deletions
diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
index c933346877..6b20aa4304 100644
--- a/posix/fnmatch_loop.c
+++ b/posix/fnmatch_loop.c
@@ -32,13 +32,12 @@ FCT (pattern, string, no_leading_period, flags)
register const CHAR *p = pattern, *n = string;
register UCHAR c;
#ifdef _LIBC
+# if WIDE_CHAR_VERSION
+ const char *collseq = (const char *)
+ _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+# else
const UCHAR *collseq = (const UCHAR *)
- _NL_CURRENT(LC_COLLATE, CONCAT(_NL_COLLATE_COLLSEQ,SUFFIX));
-# ifdef WIDE_CHAR_VERSION
- const wint_t *names = (const wint_t *)
- _NL_CURRENT (LC_COLLATE, _NL_COLLATE_NAMES);
- size_t size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_SIZE);
- size_t layers = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_LAYERS);
+ _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQMB);
# endif
#endif
@@ -260,33 +259,8 @@ FCT (pattern, string, no_leading_period, flags)
/* The following code is glibc specific but does
there a good job in speeding up the code since
we can avoid the btowc() call. */
- if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE) != 0)
- {
- /* Old locale format. */
-# if __BYTE_ORDER == __LITTLE_ENDIAN
- if ((wt & 0xf0ffff) == 0)
- {
- wt >>= 16;
- if ((__ctype_b[(UCHAR) *n] & wt) != 0)
- goto matched;
- }
-# else
- if (wt <= 0x800)
- {
- if ((__ctype_b[(UCHAR) *n] & wt) != 0)
- goto matched;
- }
-# endif
- else
- if (ISWCTYPE (BTOWC ((UCHAR) *n), wt))
- goto matched;
- }
- else
- {
- /* New locale format. */
- if (_ISCTYPE ((UCHAR) *n, wt))
- goto matched;
- }
+ if (_ISCTYPE ((UCHAR) *n, wt))
+ goto matched;
# else
if (ISWCTYPE (BTOWC ((UCHAR) *n), wt))
goto matched;
@@ -621,68 +595,17 @@ FCT (pattern, string, no_leading_period, flags)
# ifdef WIDE_CHAR_VERSION
/* Search in the `names' array for the characters. */
- if (size != 0)
- {
- /* Old locale format. */
- int idx;
- size_t cnt;
-
- idx = fn % size;
- cnt = 0;
- while (names[idx] != fn)
- {
- if (++cnt == layers)
- /* XXX We don't know anything about
- the character we are supposed to
- match. This means we are failing. */
- goto range_not_matched;
-
- idx += size;
- }
- fcollseq = collseq[idx];
- }
- else
- {
- /* New locale format. */
- fcollseq =
- collseq_table_lookup ((const char *) collseq, fn);
- if (fcollseq == ~((uint32_t) 0))
- /* XXX We don't know anything about
- the character we are supposed to
- match. This means we are failing. */
- goto range_not_matched;
- }
+ fcollseq = collseq_table_lookup (collseq, fn);
+ if (fcollseq == ~((uint32_t) 0))
+ /* XXX We don't know anything about the character
+ we are supposed to match. This means we are
+ failing. */
+ goto range_not_matched;
if (is_seqval)
lcollseq = cold;
else
- {
- if (size != 0)
- {
- /* Old locale format. */
- int idx;
- size_t cnt;
-
- idx = cold % size;
- cnt = 0;
- while (names[idx] != cold)
- {
- if (++cnt == layers)
- {
- idx = -1;
- break;
- }
- idx += size;
- }
-
- lcollseq =
- idx == -1 ? 0xffffffff : collseq[idx];
- }
- else
- /* New locale format. */
- lcollseq =
- collseq_table_lookup ((const char *) collseq, cold);
- }
+ lcollseq = collseq_table_lookup (collseq, cold);
# else
fcollseq = collseq[fn];
lcollseq = is_seqval ? cold : collseq[(UCHAR) cold];
@@ -843,46 +766,17 @@ FCT (pattern, string, no_leading_period, flags)
else
{
# ifdef WIDE_CHAR_VERSION
- if (size != 0)
+ hcollseq =
+ collseq_table_lookup (collseq, cend);
+ if (hcollseq == ~((uint32_t) 0))
{
- /* Old locale format. */
- int idx;
- size_t cnt;
+ /* Hum, no information about the upper
+ bound. The matching succeeds if the
+ lower bound is matched exactly. */
+ if (lcollseq != fcollseq)
+ goto range_not_matched;
- idx = cend % size;
- cnt = 0;
- while (names[idx] != cend)
- {
- if (++cnt == layers)
- {
- /* Hum, no information about the
- upper bound. The matching
- succeeds if the lower bound is
- matched exactly. */
- if (lcollseq != fcollseq)
- goto range_not_matched;
-
- goto matched;
- }
- }
- hcollseq = collseq[idx];
- }
- else
- {
- /* New locale format. */
- hcollseq =
- collseq_table_lookup ((const char *) collseq, cend);
- if (hcollseq == ~((uint32_t) 0))
- {
- /* Hum, no information about the
- upper bound. The matching succeeds
- if the lower bound is matched
- exactly. */
- if (lcollseq != fcollseq)
- goto range_not_matched;
-
- goto matched;
- }
+ goto matched;
}
# else
hcollseq = collseq[cend];
@@ -1025,4 +919,3 @@ FCT (pattern, string, no_leading_period, flags)
#undef STRCOLL
#undef L
#undef BTOWC
-#undef SUFFIX