1997-02-19 12:43:53 +08:00
|
|
|
/* Implementation of the locale program according to POSIX 1003.2.
|
1997-01-07 06:07:28 +08:00
|
|
|
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
1996-12-20 09:39:50 +08:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
1995-05-18 17:00:09 +08:00
|
|
|
|
1996-12-20 09:39:50 +08:00
|
|
|
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.
|
1995-05-18 17:00:09 +08:00
|
|
|
|
1996-12-20 09:39:50 +08:00
|
|
|
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.
|
1995-05-18 17:00:09 +08:00
|
|
|
|
1996-12-20 09:39:50 +08:00
|
|
|
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. */
|
1995-05-18 17:00:09 +08:00
|
|
|
|
1996-04-04 00:31:49 +08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
1997-02-19 12:43:53 +08:00
|
|
|
#include <argp.h>
|
|
|
|
#include <argz.h>
|
1995-05-18 17:00:09 +08:00
|
|
|
#include <dirent.h>
|
1997-02-19 12:43:53 +08:00
|
|
|
#include <errno.h>
|
1996-04-04 00:31:49 +08:00
|
|
|
#include <error.h>
|
1995-05-18 17:00:09 +08:00
|
|
|
#include <langinfo.h>
|
|
|
|
#include <libintl.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <locale.h>
|
1997-02-19 12:43:53 +08:00
|
|
|
#include <search.h>
|
1995-05-18 17:00:09 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
Thu Jun 13 17:25:11 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/generic/memcmp.c: Add prototype decls for internal fns.
* locale/programs/locale.c: Include string.h.
* sunrpc/xdr_stdio.c (xdrstdio_getlong), sunrpc/xdr_rec.c
(xdrrec_getlong), sunrpc/xdr_mem.c (xdrmem_getlong): Make sure
appropriate sign-extension is performed on machines with
sizeof(long) > 4.
* sunrpc/xdr.c (xdr_int, xdr_u_int): If sizeof(long)==8 and
sizeof(int)<sizeof(long), we need to go through a temporary
variable.
* locale/programs/ld-numeric.c: Include <alloca.h>
* libio/stdio.h (__libc_fatal): Add prototype.
* libio/cleanup.c: Use __P() to declare prototype when __STDC__ is
in efect.
* libio/iopopen.c (read_or_write, parent_end, child_end): Declare
volatile to avoid "might get clobbered by longjmp" warning.
* features.h (__KERNEL_STRICT_NAMES): Define __KERNEL_STRICT_NAMES
unless _LOOSE_KERNEL_NAMES is in effect (which, with high
probability is a sure loser).
* sysdeps/unix/sysv/linux/gnu/types.h (__KERNEL_STRICT_NAMES): Remove.
* sysdeps/unix/bsd/osf/alpha/start.S (errno): Removed.
* sysdeps/unix/sysv/linux/alpha/start.S: Ditto.
* misc/paths.h (_PATH_MAN): Change from /usr/share/man to /usr/man
to be Linux FSSTND compliant.
Mon Jun 10 17:50:31 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/unix/sysv/linux/alpha/pipe.S: Use PSEUDO.
* sysdeps/unix/sysv/linux/alpha/sysdep.S,
sysdeps/unix/sysv/linux/alpha/brk.S,
sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
sysdeps/unix/sysv/linux/alpha/llseek.S,
sysdeps/unix/sysv/linux/alpha/sigsuspend.S,
sysdeps/unix/sysv/linux/alpha/syscall.S: Rename syscall_error to
__syscall_error to avoid intruding application name space.
* sysdeps/unix/sysv/linux/alpha/sysdep.h: Rename __NR_get?id
to SYS_get?id so that syscall stubs in sysdeps/unix define
these syscalls in terms of getxpid/getxuid/getxgid.
* sysdeps/unix/_exit.S, sysdeps/unix/getegid.S,
sysdeps/unix/geteuid.S, sysdeps/unix/getppid.S,
sysdeps/unix/execve.S, sysdeps/unix/fork.S,
sysdeps/unix/syscall.S: Terminate syscall with PSEUDO_END.
* sysdeps/unix/make-syscalls.sh, sysdeps/unix/sysdep.h
(PSEUDO_END): Rename END() to PSEUDO_END().
* sysdeps/unix/alpha/sysdep.h: Move error-handling code in PSEUDO
to PSEUDO_END to improve branch-prediction. Include .frame
directive to make syscalls debugabble.
(PSEUDO_END): New macro.
* sysdeps/unix/alpha/sysdep.h, sysdeps/alpha/bb_init_func.S,
sysdeps/unix/sysv/linux/alpha/brk.S: Use ldiq instead of ldi since
latter is illegal under DEC Unix.
* sysdeps/unix/alpha/sysdep.S: Renamed from
sysdeps/unix/sysv/linux/alpha/sysdep.S. This file works for OSF/1
as well.
* sysdeps/unix/bsd/osf/alpha/sysdep.S: Remove (note that the
EWOULDBLOCK -> EAGAIN mapping was unnecessary since
EWOULDBLOCK==EAGAIN under DEC Unix and Linux/Alpha).
* sysdeps/alpha/divrem.h: Use retaddr instead of ra as the return
address register in the .frame directive.
* sysdeps/alpha/copysign.c: Remove.
* sunrpc/rpc/types.h: Include <sys/param.h> and <netinet/in.h> to
avoid RPC definitions of INADDR_LOOPBACK and/or MAXHOSTNAMELEN.
* errno.h: Move __END_DECLS to correct place to make file
compilable under c++.
* dirent/dirent.h: Document _DIRENT_HAVE_D_OFF macro. Define
d_ino only if <direntry.h> hasn't defined d_fileno.
* configure.in (HAVE_ASM_WEAKEXT_DIRECTIVE): Reverse order of
arguments to weakext to make .weakext detection work on ECOFF systems.
* FAQ: Add Linux/Alpha to list of supported platforms. Mention
that _validuser() has been replaced by __ivaliduser().
Thu Jun 6 21:39:38 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/unix/bsd/sun/sunos4/tcsetattr.c (tcsetattr): Declare cmd
as unsigned long, not as int (to avoid incorrect int->long
promotion).
1996-06-19 14:54:12 +08:00
|
|
|
#include <string.h>
|
1997-02-19 12:43:53 +08:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/stat.h>
|
1995-05-18 17:00:09 +08:00
|
|
|
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 16:30:38 +08:00
|
|
|
#include "localeinfo.h"
|
1995-05-18 17:00:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* If set print the name of the category. */
|
|
|
|
static int show_category_name;
|
|
|
|
|
|
|
|
/* If set print the name of the item. */
|
|
|
|
static int show_keyword_name;
|
|
|
|
|
1997-02-19 12:43:53 +08:00
|
|
|
/* Print names of all available locales. */
|
|
|
|
static int do_all;
|
|
|
|
|
|
|
|
/* Print names of all available character maps. */
|
|
|
|
static int do_charmaps = 0;
|
|
|
|
|
|
|
|
/* Name and version of program. */
|
|
|
|
static void print_version (FILE *stream, struct argp_state *state);
|
|
|
|
void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
|
|
|
|
|
|
|
|
/* Definitions of arguments for argp functions. */
|
|
|
|
static struct argp_option options[] =
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 16:30:38 +08:00
|
|
|
{
|
1997-02-19 12:43:53 +08:00
|
|
|
{ NULL, 0, NULL, 0, "System information:" },
|
|
|
|
{ "all-locales", 'a', NULL, 0, "Write names of available locales" },
|
|
|
|
{ "charmaps", 'm', NULL, 0, "Write names of available charmaps" },
|
|
|
|
{ NULL, 0, NULL, 0, "Modify output format:" },
|
|
|
|
{ "category-name", 'c', NULL, 0, "Write names of selected categories" },
|
|
|
|
{ "keyword-name", 'k', NULL, 0, "Write names of selected keywords" },
|
|
|
|
{ NULL, 0, NULL, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Short description of program. */
|
|
|
|
static const char doc[] = "Get locale-specific information.";
|
|
|
|
|
|
|
|
/* Strings for arguments in help texts. */
|
|
|
|
static const char args_doc[] = "NAME\n[-a|-m]";
|
|
|
|
|
|
|
|
/* Prototype for option handler. */
|
|
|
|
static error_t parse_opt (int key, char *arg, struct argp_state *state);
|
|
|
|
|
|
|
|
/* Function to print some extra text in the help message. */
|
|
|
|
static char *more_help (int key, const char *text, void *input);
|
|
|
|
|
|
|
|
/* Data structure to communicate with argp functions. */
|
|
|
|
static struct argp argp =
|
|
|
|
{
|
|
|
|
options, parse_opt, args_doc, doc, NULL, more_help
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 16:30:38 +08:00
|
|
|
};
|
1995-05-18 17:00:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* We don't have these constants defined because we don't use them. Give
|
|
|
|
default values. */
|
|
|
|
#define CTYPE_MB_CUR_MIN 0
|
|
|
|
#define CTYPE_MB_CUR_MAX 0
|
|
|
|
#define CTYPE_HASH_SIZE 0
|
|
|
|
#define CTYPE_HASH_LAYERS 0
|
|
|
|
#define CTYPE_CLASS 0
|
|
|
|
#define CTYPE_TOUPPER_EB 0
|
|
|
|
#define CTYPE_TOLOWER_EB 0
|
|
|
|
#define CTYPE_TOUPPER_EL 0
|
|
|
|
#define CTYPE_TOLOWER_EL 0
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 16:30:38 +08:00
|
|
|
|
1996-04-04 00:31:49 +08:00
|
|
|
/* Definition of the data structure which represents a category and its
|
|
|
|
items. */
|
|
|
|
struct category
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 16:30:38 +08:00
|
|
|
{
|
1996-04-04 00:31:49 +08:00
|
|
|
int cat_id;
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 16:30:38 +08:00
|
|
|
const char *name;
|
1996-04-04 00:31:49 +08:00
|
|
|
size_t number;
|
|
|
|
struct cat_item
|
|
|
|
{
|
|
|
|
int item_id;
|
|
|
|
const char *name;
|
|
|
|
enum { std, opt } status;
|
|
|
|
enum value_type value_type;
|
|
|
|
int min;
|
|
|
|
int max;
|
|
|
|
} *item_desc;
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 16:30:38 +08:00
|
|
|
};
|
|
|
|
|
1996-04-04 00:31:49 +08:00
|
|
|
/* Simple helper macro. */
|
|
|
|
#define NELEMS(arr) ((sizeof (arr)) / (sizeof (arr[0])))
|
|
|
|
|
|
|
|
/* For some tricky stuff. */
|
|
|
|
#define NO_PAREN(Item, More...) Item, ## More
|
1995-05-18 17:00:09 +08:00
|
|
|
|
|
|
|
/* We have all categories defined in `categories.def'. Now construct
|
|
|
|
the description and data structure used for all categories. */
|
1996-04-04 00:31:49 +08:00
|
|
|
#define DEFINE_ELEMENT(Item, More...) { Item, ## More },
|
1995-05-18 17:00:09 +08:00
|
|
|
#define DEFINE_CATEGORY(category, name, items, postload, in, check, out) \
|
|
|
|
static struct cat_item category##_desc[] = \
|
|
|
|
{ \
|
|
|
|
NO_PAREN items \
|
|
|
|
};
|
|
|
|
|
1996-04-04 00:31:49 +08:00
|
|
|
#include "categories.def"
|
1995-05-18 17:00:09 +08:00
|
|
|
#undef DEFINE_CATEGORY
|
|
|
|
|
|
|
|
static struct category category[] =
|
|
|
|
{
|
|
|
|
#define DEFINE_CATEGORY(category, name, items, postload, in, check, out) \
|
1996-07-26 12:35:31 +08:00
|
|
|
[category] = { _NL_NUM_##category, name, NELEMS (category##_desc), \
|
|
|
|
category##_desc },
|
1996-04-04 00:31:49 +08:00
|
|
|
#include "categories.def"
|
1995-05-18 17:00:09 +08:00
|
|
|
#undef DEFINE_CATEGORY
|
|
|
|
};
|
|
|
|
#define NCATEGORIES NELEMS (category)
|
|
|
|
|
|
|
|
|
1996-07-26 12:35:31 +08:00
|
|
|
/* Automatically set variable. */
|
|
|
|
extern const char *__progname;
|
|
|
|
|
|
|
|
/* helper function for extended name handling. */
|
|
|
|
extern void locale_special (const char *name, int show_category_name,
|
|
|
|
int show_keyword_name);
|
|
|
|
|
1995-05-18 17:00:09 +08:00
|
|
|
/* Prototypes for local functions. */
|
|
|
|
static void write_locales (void);
|
|
|
|
static void write_charmaps (void);
|
|
|
|
static void show_locale_vars (void);
|
|
|
|
static void show_info (const char *name);
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
1996-06-26 23:46:01 +08:00
|
|
|
/* Set initial values for global variables. */
|
1995-05-18 17:00:09 +08:00
|
|
|
show_category_name = 0;
|
|
|
|
show_keyword_name = 0;
|
|
|
|
|
|
|
|
/* Set locale. Do not set LC_ALL because the other categories must
|
1996-12-20 09:39:50 +08:00
|
|
|
not be affected (according to POSIX.2). */
|
1995-05-18 17:00:09 +08:00
|
|
|
setlocale (LC_CTYPE, "");
|
|
|
|
setlocale (LC_MESSAGES, "");
|
|
|
|
|
|
|
|
/* Initialize the message catalog. */
|
|
|
|
textdomain (PACKAGE);
|
|
|
|
|
1997-02-19 12:43:53 +08:00
|
|
|
/* Parse and process arguments. */
|
|
|
|
argp_parse (&argp, argc, argv, 0, 0, NULL);
|
1995-05-18 17:00:09 +08:00
|
|
|
|
|
|
|
/* `-a' requests the names of all available locales. */
|
|
|
|
if (do_all != 0)
|
|
|
|
{
|
1997-02-19 12:43:53 +08:00
|
|
|
setlocale (LC_COLLATE, "");
|
1995-05-18 17:00:09 +08:00
|
|
|
write_locales ();
|
|
|
|
exit (EXIT_SUCCESS);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* `m' requests the names of all available charmaps. The names can be
|
|
|
|
used for the -f argument to localedef(3). */
|
|
|
|
if (do_charmaps != 0)
|
|
|
|
{
|
|
|
|
write_charmaps ();
|
|
|
|
exit (EXIT_SUCCESS);
|
|
|
|
}
|
|
|
|
|
Thu May 30 11:24:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* po/header.pot: Replace with exact boilerplate pinard dictates.
* sysdeps/i386/strtok.S (Lillegal_argument): Remove this code to set
errno and the check that jumped to it.
* sysdeps/mach/hurd/Makefile (errnos.d): Use $(sed-remove-objpfx).
Thu May 30 03:21:57 1996 Ulrich Drepper <drepper@cygnus.com>
* FAQ: Document need of gperf program for developers.
* elf/elf.h: Fix typos in comments.
* libio/stdio.h [!__STRICT_ANSI__ || _POSIX_SOURCE]: Add
prototypes for `ctermid' and `cuserid'.
* locale/programs/locale.c: Switch to user selected locale
before printing variables.
* math/Makefile [$(long-double-fcts)==yes]: Define long-m-routines
and long-c-routines. Only if the `long double' data type is
available we need to compile the functions.
(libm-routines): Add $(long-m-routines).
(routines): Remove isinfl, isnanl. Use new file s_isinfl and
s_isnanl instead if `long double' is available.
* math/math.h: Include <mathcalls.h> again to define `long double'
functions.
* math/math_private.h: Define data types, prototypes and access
macros for `long double'.
* stdlib/stdlib.h: Add prototypes for `strtoll' and `strtoull'.
[GCC2 && OPTIMIZE]: Define strto{,u}ll as inline function which
calls __strto{,u}q_internal.
* stdlib/strfmon.c: Replace PTR by `void *'.
* stdlib/strtoq.c: Define strtoll as weak alias.
* stdlib/strtouq.c: Define strtoull as weak alias.
* string/tester.c: Correct `strsep' test.
* sysdeps/generic/strsep.c: Make compatible with BSD version.
Trailing characters of skip set are not skipped. In this case
empty tokens are returned.
* sysdeps/i386/isinfl.c, sysdeps/i386/isnanl.c,
sysdeps/ieee754/isinf.c, sysdeps/ieee754/isinfl.c,
sysdeps/ieee754/isnan.c, sysdeps/ieee754/isnanl.c: Removed. We
now use the versions part of libm.
* sysdeps/i386/strsep.S: Removed. Generic C version is of
similar speed.
* sysdeps/i386/strtok.S: Remove support for `strsep'.
* sysdeps/libm-i387/e_acosl.S, sysdeps/libm-i387/s_ceill.S,
sysdeps/libm-i387/s_copysignl.S, sysdeps/libm-i387/s_finitel.S,
sysdeps/libm-i387/s_floorl.S, sysdeps/libm-i387/s_isinfl.c,
sysdeps/libm-i387/s_isnanl.c, sysdeps/libm-i387/s_nextafterl.c,
sysdeps/libm-i387/s_rintl.S, sysdeps/libm-i387/s_significandl.S:
New i387 specific math functions implementing `long double'
versions.
* sysdeps/libm-ieee754/s_ceill.c,
sysdeps/libm-ieee754/s_copysignl.c,
sysdeps/libm-ieee754/s_fabsl.c, sysdeps/libm-ieee754/s_finitel.c,
sysdeps/libm-ieee754/s_floorl.c, sysdeps/libm-ieee754/s_isinfl.c,
sysdeps/libm-ieee754/s_isnanl.c,
sysdeps/libm-ieee754/s_nextafterl.c,
sysdeps/libm-ieee754/s_rintl.c, sysdeps/libm-ieee754/s_scalbnl.c,
sysdeps/libm-ieee754/s_significandl.c: New generic `long double'
versions of libm functions.
* sysdeps/libm-i387/e_exp.S: Add a few comments to explain the
Intel FPU nonsense.
* sysdeps/libm-i387/s_ceil.S, sysdeps/libm-i387/s_ceilf.S,
sysdeps/libm-i387/s_floor.S, sysdeps/libm-i387/s_floorf.S: Correct
handling of local variables. The old version created a stack
frame but stored the values outside.
* sysdeps/libm-ieee754/s_isinf.c, sysdeps/libm-ieee754/s_isnan.c
[!NO_LONG_DOUBLE]: Define alias with `long double' versions name.
* login/pututline_r.c: Include sys/stat.h. Fix typos.
according to currently used locale for category LC_CTYPE by
inet_nsap_ntoa. Now in <arpa/inet.h>.
_IO_dup2 to contain complete parameter list.
1996-05-31 00:12:42 +08:00
|
|
|
/* Specific information about the current locale are requested.
|
|
|
|
Change to this locale now. */
|
|
|
|
setlocale (LC_ALL, "");
|
|
|
|
|
1995-05-18 17:00:09 +08:00
|
|
|
/* If no real argument is given we have to print the contents of the
|
|
|
|
current locale definition variables. These are LANG and the LC_*. */
|
|
|
|
if (optind == argc && show_keyword_name == 0 && show_category_name == 0)
|
|
|
|
{
|
|
|
|
show_locale_vars ();
|
|
|
|
exit (EXIT_SUCCESS);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Process all given names. */
|
|
|
|
while (optind < argc)
|
|
|
|
show_info (argv[optind++]);
|
|
|
|
|
|
|
|
exit (EXIT_SUCCESS);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-02-19 12:43:53 +08:00
|
|
|
/* Handle program arguments. */
|
|
|
|
static error_t
|
|
|
|
parse_opt (int key, char *arg, struct argp_state *state)
|
1995-05-18 17:00:09 +08:00
|
|
|
{
|
1997-02-19 12:43:53 +08:00
|
|
|
switch (key)
|
1996-09-13 11:21:39 +08:00
|
|
|
{
|
1997-02-19 12:43:53 +08:00
|
|
|
case 'a':
|
|
|
|
do_all = 1;
|
|
|
|
break;
|
|
|
|
case 'c':
|
|
|
|
show_category_name = 1;
|
|
|
|
break;
|
|
|
|
case 'm':
|
|
|
|
do_charmaps = 1;
|
|
|
|
break;
|
|
|
|
case 'k':
|
|
|
|
show_keyword_name = 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return ARGP_ERR_UNKNOWN;
|
1996-09-13 11:21:39 +08:00
|
|
|
}
|
1997-02-19 12:43:53 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1995-05-18 17:00:09 +08:00
|
|
|
|
1997-02-19 12:43:53 +08:00
|
|
|
static char *
|
|
|
|
more_help (int key, const char *text, void *input)
|
|
|
|
{
|
|
|
|
switch (key)
|
|
|
|
{
|
|
|
|
case ARGP_KEY_HELP_EXTRA:
|
|
|
|
/* We print some extra information. */
|
|
|
|
return strdup (gettext ("\
|
|
|
|
Report bugs using the `glibcbug' script to <bugs@gnu.ai.mit.edu>.\n"));
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return (char *) text;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Print the version information. */
|
|
|
|
static void
|
|
|
|
print_version (FILE *stream, struct argp_state *state)
|
|
|
|
{
|
|
|
|
fprintf (stream, "locale (GNU %s) %s\n", PACKAGE, VERSION);
|
|
|
|
fprintf (stream, gettext ("\
|
|
|
|
Copyright (C) %s Free Software Foundation, Inc.\n\
|
|
|
|
This is free software; see the source for copying conditions. There is NO\n\
|
|
|
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
|
|
|
|
"), "1995, 1996, 1997");
|
|
|
|
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
|
1995-05-18 17:00:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-02-19 12:43:53 +08:00
|
|
|
/* Simple action function which prints arguments as strings. */
|
|
|
|
static void
|
|
|
|
print_names (const void *nodep, VISIT value, int level)
|
|
|
|
{
|
|
|
|
if (value == postorder || value == leaf)
|
|
|
|
puts (*(char **) nodep);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Write the names of all available locales to stdout. We have some
|
|
|
|
sources of the information: the contents of the locale directory
|
|
|
|
and the locale.alias file. To avoid duplicates and print the
|
|
|
|
result is a reasonable order we put all entries is a search tree
|
|
|
|
and print them afterwards. */
|
1995-05-18 17:00:09 +08:00
|
|
|
static void
|
|
|
|
write_locales (void)
|
|
|
|
{
|
1997-02-19 12:43:53 +08:00
|
|
|
void *all_data = NULL;
|
1995-05-18 17:00:09 +08:00
|
|
|
DIR *dir;
|
|
|
|
struct dirent *dirent;
|
1997-02-19 12:43:53 +08:00
|
|
|
char *alias_path;
|
|
|
|
size_t alias_path_len;
|
|
|
|
char *entry;
|
1995-05-18 17:00:09 +08:00
|
|
|
|
1997-02-19 12:43:53 +08:00
|
|
|
#define PUT(name) tsearch ((name), &all_data, \
|
|
|
|
(int (*) (const void *, const void *)) strcoll)
|
1995-05-18 17:00:09 +08:00
|
|
|
|
1997-02-19 12:43:53 +08:00
|
|
|
dir = opendir (LOCALEDIR);
|
1995-05-18 17:00:09 +08:00
|
|
|
if (dir == NULL)
|
|
|
|
{
|
|
|
|
error (1, errno, gettext ("cannot read locale directory `%s'"),
|
1997-02-19 12:43:53 +08:00
|
|
|
LOCALEDIR);
|
1995-05-18 17:00:09 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1997-02-19 12:43:53 +08:00
|
|
|
/* `POSIX' locale is always available (POSIX.2 4.34.3). */
|
|
|
|
PUT ("POSIX");
|
|
|
|
/* And so is the "C" locale. */
|
|
|
|
PUT ("C");
|
|
|
|
|
1995-05-18 17:00:09 +08:00
|
|
|
/* Now we can look for all files in the directory. */
|
|
|
|
while ((dirent = readdir (dir)) != NULL)
|
|
|
|
if (strcmp (dirent->d_name, ".") != 0
|
|
|
|
&& strcmp (dirent->d_name, "..") != 0)
|
1997-02-19 12:43:53 +08:00
|
|
|
{
|
|
|
|
mode_t mode;
|
|
|
|
#ifdef _DIRENT_HAVE_D_TYPE
|
|
|
|
if (dirent->d_type != DT_UNKNOWN)
|
|
|
|
mode = DTTOIF (dirent->d_type);
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
struct stat st;
|
|
|
|
char buf[sizeof (LOCALEDIR) + strlen (dirent->d_name) + 1];
|
|
|
|
|
|
|
|
stpcpy (stpcpy (stpcpy (buf, LOCALEDIR), "/"), dirent->d_name);
|
|
|
|
|
|
|
|
if (stat (buf, &st) < 0)
|
|
|
|
continue;
|
|
|
|
mode = st.st_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (S_ISDIR (mode))
|
|
|
|
PUT (strdup (dirent->d_name));
|
|
|
|
}
|
1995-05-18 17:00:09 +08:00
|
|
|
|
|
|
|
closedir (dir);
|
1997-02-19 12:43:53 +08:00
|
|
|
|
|
|
|
/* Now read the locale.alias files. */
|
|
|
|
if (argz_create_sep (LOCALE_ALIAS_PATH, ':', &alias_path, &alias_path_len))
|
|
|
|
error (1, errno, gettext ("while preparing output"));
|
|
|
|
|
|
|
|
entry = NULL;
|
|
|
|
while ((entry = argz_next (alias_path, alias_path_len, entry)))
|
|
|
|
{
|
|
|
|
static const char aliasfile[] = "/locale.alias";
|
|
|
|
FILE *fp;
|
|
|
|
char full_name[strlen (entry) + sizeof aliasfile];
|
|
|
|
|
|
|
|
stpcpy (stpcpy (full_name, entry), aliasfile);
|
|
|
|
fp = fopen (full_name, "r");
|
|
|
|
if (fp == NULL)
|
|
|
|
/* Ignore non-existing files. */
|
|
|
|
continue;
|
|
|
|
|
|
|
|
while (! feof (fp))
|
|
|
|
{
|
|
|
|
/* It is a reasonable approach to use a fix buffer here
|
|
|
|
because
|
|
|
|
a) we are only interested in the first two fields
|
|
|
|
b) these fields must be usable as file names and so must
|
|
|
|
not be that long */
|
|
|
|
char buf[BUFSIZ];
|
|
|
|
char *alias;
|
|
|
|
char *value;
|
|
|
|
char *cp;
|
|
|
|
|
|
|
|
if (fgets (buf, BUFSIZ, fp) == NULL)
|
|
|
|
/* EOF reached. */
|
|
|
|
break;
|
|
|
|
|
|
|
|
cp = buf;
|
|
|
|
/* Ignore leading white space. */
|
|
|
|
while (isspace (cp[0]))
|
|
|
|
++cp;
|
|
|
|
|
|
|
|
/* A leading '#' signals a comment line. */
|
|
|
|
if (cp[0] != '\0' && cp[0] != '#')
|
|
|
|
{
|
|
|
|
alias = cp++;
|
|
|
|
while (cp[0] != '\0' && !isspace (cp[0]))
|
|
|
|
++cp;
|
|
|
|
/* Terminate alias name. */
|
|
|
|
if (cp[0] != '\0')
|
|
|
|
*cp++ = '\0';
|
|
|
|
|
|
|
|
/* Now look for the beginning of the value. */
|
|
|
|
while (isspace (cp[0]))
|
|
|
|
++cp;
|
|
|
|
|
|
|
|
if (cp[0] != '\0')
|
|
|
|
{
|
|
|
|
value = cp++;
|
|
|
|
while (cp[0] != '\0' && !isspace (cp[0]))
|
|
|
|
++cp;
|
|
|
|
/* Terminate value. */
|
|
|
|
if (cp[0] == '\n')
|
|
|
|
{
|
|
|
|
/* This has to be done to make the following
|
|
|
|
test for the end of line possible. We are
|
|
|
|
looking for the terminating '\n' which do not
|
|
|
|
overwrite here. */
|
|
|
|
*cp++ = '\0';
|
|
|
|
*cp = '\n';
|
|
|
|
}
|
|
|
|
else if (cp[0] != '\0')
|
|
|
|
*cp++ = '\0';
|
|
|
|
|
|
|
|
/* Add the alias. */
|
|
|
|
PUT (strdup (alias));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Possibly not the whole line fits into the buffer.
|
|
|
|
Ignore the rest of the line. */
|
|
|
|
while (strchr (cp, '\n') == NULL)
|
|
|
|
{
|
|
|
|
cp = buf;
|
|
|
|
if (fgets (buf, BUFSIZ, fp) == NULL)
|
|
|
|
/* Make sure the inner loop will be left. The outer
|
|
|
|
loop will exit at the `feof' test. */
|
|
|
|
*cp = '\n';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fclose (fp);
|
|
|
|
}
|
|
|
|
|
|
|
|
twalk (all_data, print_names);
|
1995-05-18 17:00:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Write the names of all available character maps to stdout. */
|
|
|
|
static void
|
|
|
|
write_charmaps (void)
|
|
|
|
{
|
1997-02-19 12:43:53 +08:00
|
|
|
void *all_data = NULL;
|
1995-05-18 17:00:09 +08:00
|
|
|
DIR *dir;
|
|
|
|
struct dirent *dirent;
|
|
|
|
|
|
|
|
dir = opendir (CHARMAP_PATH);
|
|
|
|
if (dir == NULL)
|
|
|
|
{
|
|
|
|
error (1, errno, gettext ("cannot read character map directory `%s'"),
|
|
|
|
CHARMAP_PATH);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now we can look for all files in the directory. */
|
|
|
|
while ((dirent = readdir (dir)) != NULL)
|
|
|
|
if (strcmp (dirent->d_name, ".") != 0
|
|
|
|
&& strcmp (dirent->d_name, "..") != 0)
|
1997-02-19 12:43:53 +08:00
|
|
|
{
|
|
|
|
mode_t mode;
|
|
|
|
#ifdef _DIRENT_HAVE_D_TYPE
|
|
|
|
if (dirent->d_type != DT_UNKNOWN)
|
|
|
|
mode = DTTOIF (dirent->d_type);
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
struct stat st;
|
|
|
|
char buf[sizeof (CHARMAP_PATH) + strlen (dirent->d_name) + 1];
|
|
|
|
|
|
|
|
stpcpy (stpcpy (stpcpy (buf, CHARMAP_PATH), "/"), dirent->d_name);
|
|
|
|
|
|
|
|
if (stat (buf, &st) < 0)
|
|
|
|
continue;
|
|
|
|
mode = st.st_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (S_ISREG (mode))
|
|
|
|
PUT (strdup (dirent->d_name));
|
|
|
|
}
|
1995-05-18 17:00:09 +08:00
|
|
|
|
|
|
|
closedir (dir);
|
1997-02-19 12:43:53 +08:00
|
|
|
|
|
|
|
twalk (all_data, print_names);
|
1995-05-18 17:00:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* We have to show the contents of the environments determining the
|
|
|
|
locale. */
|
|
|
|
static void
|
|
|
|
show_locale_vars (void)
|
|
|
|
{
|
|
|
|
size_t cat_no;
|
|
|
|
const char *lcall = getenv ("LC_ALL");
|
|
|
|
const char *lang = getenv ("LANG") ? : "POSIX";
|
|
|
|
|
|
|
|
void get_source (const char *name)
|
|
|
|
{
|
|
|
|
char *val = getenv (name);
|
|
|
|
|
|
|
|
if (lcall != NULL || val == NULL)
|
|
|
|
printf ("%s=\"%s\"\n", name, lcall ? : lang);
|
|
|
|
else
|
|
|
|
printf ("%s=%s\n", name, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* LANG has to be the first value. */
|
|
|
|
printf ("LANG=%s\n", lang);
|
|
|
|
|
|
|
|
/* Now all categories in an unspecified order. */
|
|
|
|
for (cat_no = 0; cat_no < NCATEGORIES; ++cat_no)
|
|
|
|
get_source (category[cat_no].name);
|
|
|
|
|
|
|
|
/* The last is the LC_ALL value. */
|
|
|
|
printf ("LC_ALL=%s\n", lcall ? : "");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Show the information request for NAME. */
|
|
|
|
static void
|
|
|
|
show_info (const char *name)
|
|
|
|
{
|
|
|
|
size_t cat_no;
|
|
|
|
|
|
|
|
void print_item (struct cat_item *item)
|
|
|
|
{
|
|
|
|
if (show_keyword_name != 0)
|
|
|
|
printf ("%s=", item->name);
|
|
|
|
|
|
|
|
switch (item->value_type)
|
|
|
|
{
|
|
|
|
case string:
|
|
|
|
printf ("%s%s%s", show_keyword_name ? "\"" : "",
|
|
|
|
nl_langinfo (item->item_id) ? : "",
|
|
|
|
show_keyword_name ? "\"" : "");
|
|
|
|
break;
|
|
|
|
case stringarray:
|
|
|
|
{
|
|
|
|
int cnt;
|
|
|
|
const char *val;
|
|
|
|
|
|
|
|
if (show_keyword_name)
|
|
|
|
putchar ('"');
|
|
|
|
|
|
|
|
for (cnt = 0; cnt < item->max - 1; ++cnt)
|
|
|
|
{
|
|
|
|
val = nl_langinfo (item->item_id + cnt);
|
|
|
|
printf ("%s;", val ? : "");
|
|
|
|
}
|
|
|
|
|
|
|
|
val = nl_langinfo (item->item_id + cnt);
|
|
|
|
printf ("%s", val ? : "");
|
|
|
|
|
|
|
|
if (show_keyword_name)
|
|
|
|
putchar ('"');
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case byte:
|
|
|
|
{
|
|
|
|
const char *val = nl_langinfo (item->item_id);
|
|
|
|
|
|
|
|
if (val != NULL)
|
|
|
|
printf ("%d", *val == CHAR_MAX ? -1 : *val);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case bytearray:
|
|
|
|
{
|
|
|
|
const char *val = nl_langinfo (item->item_id);
|
|
|
|
int cnt = val ? strlen (val) : 0;
|
|
|
|
|
|
|
|
while (cnt > 1)
|
|
|
|
{
|
|
|
|
printf ("%d;", *val == CHAR_MAX ? -1 : *val);
|
|
|
|
--cnt;
|
|
|
|
++val;
|
|
|
|
}
|
|
|
|
|
|
|
|
printf ("%d", cnt == 0 || *val == CHAR_MAX ? -1 : *val);
|
|
|
|
}
|
|
|
|
break;
|
1996-04-04 00:31:49 +08:00
|
|
|
case word:
|
|
|
|
{
|
|
|
|
unsigned int val = (unsigned int) nl_langinfo (item->item_id);
|
|
|
|
printf ("%d", val);
|
|
|
|
}
|
|
|
|
break;
|
1995-05-18 17:00:09 +08:00
|
|
|
default:
|
|
|
|
}
|
|
|
|
putchar ('\n');
|
|
|
|
}
|
|
|
|
|
|
|
|
for (cat_no = 0; cat_no < NCATEGORIES; ++cat_no)
|
|
|
|
{
|
|
|
|
size_t item_no;
|
|
|
|
|
|
|
|
if (strcmp (name, category[cat_no].name) == 0)
|
|
|
|
/* Print the whole category. */
|
|
|
|
{
|
|
|
|
if (show_category_name != 0)
|
|
|
|
puts (category[cat_no].name);
|
|
|
|
|
|
|
|
for (item_no = 0; item_no < category[cat_no].number; ++item_no)
|
|
|
|
print_item (&category[cat_no].item_desc[item_no]);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
Thu Mar 28 03:25:10 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
* intl/Makefile (copysrc): Add missing > in sed cmd.
Sat Mar 23 17:52:49 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* Makeconfig: Rename Makefile variable nlsdir to i18ndir and
change value to $(datadir)/i18n. `nls' is not an appropriate
name.
* Makefile (subdirs): Add new subdir wctype.
* ctype/ctype-info.c: Add new global variable __ctype_names
and initialize from _nl_C_LC_CTYPE.
* ctype/ctype.h: In P1003.3b/D11 `alnum' is a separate character
class. Use bit 11.
[_ISbit]: Protect definition of bitmasks because they are also
used in wctype.h.
* libio/genops.c (_IO_sputbackc, _IO_sungetc): Clear EOF flag
after successfully pushing back a character.
Fundamental changes in locale implementation. Almost nothing
from the old code is used anymore.
* locale/charmap.c, locale/collate.c, locale/config.h,
locale/ctypedump.c, locale/hash.h, locale/keyword.gperf,
locale/keyword.h, locale/loadlocale.c, locale/locale-ctype.c,
locale/locale.c locale/localeconv.c, locale/localedef.c,
locale/localedef.h, locale/locfile-hash.c, locale/locfile-lex.c,
locale/locfile-parse.c, locale/messages.c, locale/monetary.c,
locale/numeric.c, locale/setlocale.c, locale/token.h,
locale/xmalloc.c: Removed.
* locale/Makefile: Update for new locale implementation with
program source code distributed in subdir.
* locale/categories.def, locale/iso-4217.def: Updated file
for new locale implementation.
* locale/langinfo.h: Updated for new locale implementation.
(ERA_D_T_FMT, ERA_T_FMT): New official values according to
P1003.2b/D11.
(_NL_COLLATE_NRULES, _NL_COLLATE_RULES, _NL_COLLATE_HASH_SIZE,
_NL_COLLATE_HASH_LAYERS, _NL_COLLATE_TABLE_EB,
_NL_COLLATE_TABLE_EL, _NL_COLLATE_UNDEFINED, _NL_COLLATE_EXTRA_EB,
_NL_COLLATE_EXTRA_EL, _NL_CTYPE_NAMES_EB, _NL_CTYPE_NAMES_EL,
_NL_CTYPE_HASH_SIZE, _NL_CTYPE_HASH_LAYERS, _NL_CTYPE_CLASS_NAMES,
_NL_CTYPE_MAP_NAMES, _NL_CTYPE_WIDTH): New internal values for
extended LC_CTYPE and LC_COLLATE implementation.
* locale/simple-hash.c, locale/simple-hash.h, locale/xmalloc.c,
locale/xstrdup.c: Helper functions for locale related programs.
* locale/C-collate.c, locale/C-ctype.c,
locale/C-messages.c, locale/C-monetary.c,
locale/C-numeric.c, locale/C-time.c,
locale/lc-collate.c, locale/lc-ctype.c,
locale/lc-messages.c, locale/lc-monetary.c,
locale/lc-numeric.c, locale/lc-time.c: New implementation of locale
functions, and new generated "C" locale data.
* locale/loadlocale.c: Now handles word fields in locale binary
automatically by changing the endianess if necessary.
* locale/localeinfo.h (LIMAGIC): Changed magic number because
of incompatible changes.
(locale_data): Changed definition to allow word as a value type.
(coll_sort_rule): Values for collation sorting mode.
(_NL_CURRENT_WORD): New macro to access word value of locale entry.
(__collate_table, __collate_extra): Declare new global variables
for collation tables.
* locale/programs/charmap-kw.gperf, locale/programs/charmap-kw.h,
locale/programs/charmap.c, locale/programs/charset.c,
locale/programs/charset.h, locale/programs/config.h,
locale/programs/ctypedump.c, locale/programs/ld-collate.c,
locale/programs/ld-ctype.c, locale/programs/ld-messages.c,
locale/programs/ld-monetary.c, locale/programs/ld-numeric.c,
locale/programs/ld-time.c, locale/programs/linereader.c,
locale/programs/linereader.h, locale/programs/locale.c,
locale/programs/localedef.c, locale/programs/locales.h,
locale/programs/locfile-kw.gperf, locale/programs/locfile-kw.h,
locale/programs/locfile-token.h, locale/programs/locfile.c,
locale/programs/locfile.h, locale/programs/stringtrans.c,
locale/programs/stringtrans.h: Implementation of locale related
programs.
* locale/weight.h: Functions to access collation tables.
* posix/unistd.h: Define _POSIX2_LOCALEDEF.
* stdio-common/printf_fp.c: Fix bug with printing certain numbers
< 10^-1. Reported by Bill Metzenthen.
* stdio-common/tfformat.c: Add new test for above bug.
* string/strcoll.c, string/strxfrm.c: Real implementation of
string collation according to ISO C.
* wctype/Makefile, wctype/cname-lookup.h, wctype/iswctype.c,
wctype/test_wctype.c, wctype/towctrans.c, wctype/wcfuncs.c,
wctype/wctrans.c, wctype/wctype.c, wctype/wctype.h: New files.
Implementation of wide character classes and mapping.
1996-03-28 16:30:38 +08:00
|
|
|
|
1995-05-18 17:00:09 +08:00
|
|
|
for (item_no = 0; item_no < category[cat_no].number; ++item_no)
|
|
|
|
if (strcmp (name, category[cat_no].item_desc[item_no].name) == 0)
|
|
|
|
{
|
|
|
|
if (show_category_name != 0)
|
|
|
|
puts (category[cat_no].name);
|
|
|
|
|
|
|
|
print_item (&category[cat_no].item_desc[item_no]);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
1996-07-26 12:35:31 +08:00
|
|
|
|
1996-12-20 09:39:50 +08:00
|
|
|
/* The name is not a standard one.
|
|
|
|
For testing and perhaps advanced use allow some more symbols. */
|
1996-07-26 12:35:31 +08:00
|
|
|
locale_special (name, show_category_name, show_keyword_name);
|
1995-05-18 17:00:09 +08:00
|
|
|
}
|