mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
2b83a2a4d9
Merged 1003.2 locale and localedef programs by Ulrich Drepper. * locale/charmap.c: New file. * locale/collate.c: New file. * locale/config.h: New file. * locale/ctype.c: New file. * locale/ctypedump.c: New file. * locale/hash.c: New file. * locale/hash.h: New file. * locale/iso-4217.def: New file. * locale/keyword.gperf: New file. * locale/keyword.h: New file. * locale/libintl.h: New file. * locale/locale.c: New file. * locale/localedef.c: New file. * locale/localedef.h: New file. * locale/locfile-lex.c: New file. * locale/locfile-parse.c: New file. * locale/messages.c: New file. * locale/monetary.c: New file. * locale/numeric.c: New file. * locale/token.h: New file. * posix/regex.c, posix/regex.h: New files, incorporated from GNU regex. * posix/Makefile (headers): Add regex.h. (routines): Add regex. (gpl2lgpl): Add regex.c and regex.h. Tue May 16 17:35:07 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * locale/loadlocale.c: Expect macro LOCALE_PATH to be defined, instead of hard-coding "/share/locale".
120 lines
4.7 KiB
C
120 lines
4.7 KiB
C
/* Definition of all available locale categories and their items. -*- C -*-
|
|
Copyright (C) 1995 Free Software Foundation, Inc.
|
|
|
|
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., 675 Mass Ave,
|
|
Cambridge, MA 02139, USA. */
|
|
|
|
/* These definitions are used by the locale-related files in the C library
|
|
and the programs `localedef' and `locale'.
|
|
|
|
The general format of the descriptions is like this:
|
|
|
|
DEFINE_CATEGORY (ID, name, ( items ), setlocale-postload,
|
|
locale-input, locale-check, locale-output)
|
|
|
|
where items itself is an array of entries in the form
|
|
|
|
{ ID, name, standard, value-type, min, max }
|
|
|
|
The usage of the load, check, output functions depends on the individual
|
|
program code which loads this file.
|
|
|
|
The various value types for the items are `string', `stringarray', `byte'
|
|
and `bytearray'. These cover all possible values in the current locale
|
|
definitions. `min' and `max' can be individually used again. */
|
|
|
|
#ifndef NO_POSTLOAD
|
|
#define NO_POSTLOAD NULL
|
|
#endif
|
|
|
|
DEFINE_CATEGORY (LC_COLLATE, "LC_COLLATE",
|
|
(
|
|
{ 0 } /* No data encoding yet. */
|
|
), NO_POSTLOAD, collate_input, NULL, NULL )
|
|
|
|
|
|
/* The actual definition of ctype is meaningless here. It is hard coded in
|
|
the code because it has to be handled very specially. Only the names of
|
|
the functions are important. */
|
|
DEFINE_CATEGORY (LC_CTYPE, "LC_CTYPE",
|
|
(
|
|
{ _NL_CTYPE_CLASS, "ctype-class", std, string },
|
|
{ _NL_CTYPE_TOUPPER_EB, "ctype-toupper-eb", std, string },
|
|
{ _NL_CTYPE_TOLOWER_EB, "ctype-tolower-eb", std, string },
|
|
{ _NL_CTYPE_TOUPPER_EL, "ctype-toupper-el", std, string },
|
|
{ _NL_CTYPE_TOLOWER_EL, "ctype-tolower-el", std, string },
|
|
{ 0 }
|
|
), _nl_postload_ctype,
|
|
ctype_input, ctype_check, ctype_output )
|
|
|
|
|
|
DEFINE_CATEGORY (LC_MONETARY, "LC_MONETARY",
|
|
(
|
|
{ INT_CURR_SYMBOL, "int_curr_symbol", std, string },
|
|
{ CURRENCY_SYMBOL, "currency_symbol", std, string },
|
|
{ MON_DECIMAL_POINT, "mon_decimal_point", std, string },
|
|
{ MON_THOUSANDS_SEP, "mon_thousands_sep", std, string },
|
|
{ MON_GROUPING, "mon_grouping", std, bytearray },
|
|
{ POSITIVE_SIGN, "positive_sign", std, string },
|
|
{ NEGATIVE_SIGN, "negative_sign", std, string },
|
|
{ INT_FRAC_DIGITS, "int_frac_digits", std, byte },
|
|
{ FRAC_DIGITS, "frac_digits", std, byte },
|
|
{ P_CS_PRECEDES, "p_cs_precedes", std, byte, 0, 1 },
|
|
{ P_SEP_BY_SPACE, "p_sep_by_space", std, byte, 0, 2 },
|
|
{ N_CS_PRECEDES, "n_cs_precedes", std, byte, 0, 1 },
|
|
{ N_SEP_BY_SPACE, "n_sep_by_space", std, byte, 0, 2 },
|
|
{ P_SIGN_POSN, "p_sign_posn", std, byte, 0, 4 },
|
|
{ N_SIGN_POSN, "n_sign_posn", std, byte, 0, 4 },
|
|
{ 0 }
|
|
), NO_POSTLOAD, NULL, monetary_check, NULL )
|
|
|
|
|
|
DEFINE_CATEGORY (LC_NUMERIC, "LC_NUMERIC",
|
|
(
|
|
{ DECIMAL_POINT, "decimal_point", std, string },
|
|
{ THOUSANDS_SEP, "thousands_sep", std, string },
|
|
{ GROUPING, "grouping", std, bytearray },
|
|
{ 0 }
|
|
), NO_POSTLOAD, NULL, numeric_check, NULL)
|
|
|
|
|
|
DEFINE_CATEGORY (LC_TIME, "LC_TIME",
|
|
(
|
|
{ ABDAY_1, "abday", std, stringarray, 7, 7 },
|
|
{ DAY_1, "day", std, stringarray, 7, 7 },
|
|
{ ABMON_1, "abmon", std, stringarray, 12, 12 },
|
|
{ MON_1, "mon", std, stringarray, 12, 12 },
|
|
{ AM_STR, "am_pm", std, stringarray, 2, 2 },
|
|
{ D_T_FMT, "d_t_fmt", std, string },
|
|
{ D_FMT, "d_fmt", std, string },
|
|
{ T_FMT, "t_fmt", std, string },
|
|
{ T_FMT_AMPM, "t_fmt_ampm", std, string },
|
|
{ ERA, "era", opt, string },
|
|
{ ERA_YEAR, "era_year", opt, string },
|
|
{ ERA_D_FMT, "era_d_fmt", opt, string },
|
|
{ ALT_DIGITS, "alt_digits", opt, stringarray, 0, 100 },
|
|
{ 0 }
|
|
), NO_POSTLOAD, NULL, NULL, NULL )
|
|
|
|
|
|
DEFINE_CATEGORY (LC_MESSAGES, "LC_MESSAGES",
|
|
(
|
|
{ YESEXPR, "yesexpr", std, string },
|
|
{ NOEXPR, "noexpr", std, string },
|
|
{ YESSTR, "yesstr", opt, string },
|
|
{ NOSTR, "nostr", opt, string },
|
|
{ 0 }
|
|
), NO_POSTLOAD, NULL, messages_check, NULL )
|