mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-11 13:50:06 +00:00
4c7d276eb1
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.
69 lines
2.5 KiB
C
69 lines
2.5 KiB
C
/* Define current locale data for LC_CTYPE category.
|
|
Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Library General Public License as
|
|
published by the Free Software Foundation; either version 2 of the
|
|
License, or (at your option) any later version.
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Library General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
#include "localeinfo.h"
|
|
#include <ctype.h>
|
|
#include <endian.h>
|
|
#include <stdint.h>
|
|
|
|
_NL_CURRENT_DEFINE (LC_CTYPE);
|
|
|
|
/* We are called after loading LC_CTYPE data to load it into
|
|
the variables used by the ctype.h macros.
|
|
|
|
There are three arrays of short ints which need to be indexable
|
|
from -128 to 255 inclusive. Stored in the locale data file are
|
|
a copy of each for each byte order. */
|
|
|
|
void
|
|
_nl_postload_ctype (void)
|
|
{
|
|
#define paste(a,b) paste1(a,b)
|
|
#define paste1(a,b) a##b
|
|
|
|
#define current(type,x,offset) \
|
|
((const type *) _NL_CURRENT (LC_CTYPE, paste(_NL_CTYPE_,x)) + offset)
|
|
|
|
extern const uint32_t *__ctype32_b;
|
|
extern const uint32_t *__ctype32_toupper;
|
|
extern const uint32_t *__ctype32_tolower;
|
|
extern const char *__ctype32_wctype[12];
|
|
extern const char *__ctype32_wctrans[2];
|
|
extern const char *__ctype32_width;
|
|
|
|
size_t offset, cnt;
|
|
|
|
__ctype_b = current (uint16_t, CLASS, 128);
|
|
__ctype_toupper = current (uint32_t, TOUPPER, 128);
|
|
__ctype_tolower = current (uint32_t, TOLOWER, 128);
|
|
__ctype32_b = current (uint32_t, CLASS32, 0);
|
|
__ctype32_toupper = current (uint32_t, TOUPPER32, 0);
|
|
__ctype32_tolower = current (uint32_t, TOLOWER32, 0);
|
|
|
|
offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_CLASS_OFFSET);
|
|
for (cnt = 0; cnt < 12; cnt++)
|
|
__ctype32_wctype[cnt] = _nl_current_LC_CTYPE->values[offset + cnt].string;
|
|
|
|
offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_OFFSET);
|
|
for (cnt = 0; cnt < 2; cnt++)
|
|
__ctype32_wctrans[cnt] = _nl_current_LC_CTYPE->values[offset + cnt].string;
|
|
|
|
__ctype32_width = current (char, WIDTH, 0);
|
|
}
|