mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
ce7a5ef4bc
* time/strftime.c (strftime: do_number): Initialize PRINTED to MAXDIGITS in case P is null and so sprintf is never actually called. Mon Jul 29 02:46:23 1996 Ulrich Drepper <drepper@cygnus.com> Add support for the to-be-written internationalized regexp. This code must be able to use collation symbols and collation equivalent classes. * locale/C-collate.c (_nl_C_LC_COLLATE_symbol_hash, _nl_C_LC_COLLATE_symbol_strings, _nl_C_LC_COLLATE_symbol_classes): New global variables for collation classes. * locale/categories.def: Add new descriptions for collation symbols and collation classes. * locale/langinfo.h: Add constants for collation symbols and collation classes. * locale/lc-collate.c: Add new global variables for collation symbols and collation classes. (_nl_postload_collate): Initialize new variables. * locale/programs/ld-collate.c: Add code to emit tables for collation symbols and collation classes. * locale/programs/locales.h: Change prototype for `collate_output'. * locale/programs/locfile.c (write_all_categories): Call `collate_output' with new argument. * locale/localeinfo.h: Add declaration for new global vars. (union locale_data_value): New member wstr for `wchar_t' strings. * locale/programs/locale-spec.c: Handle `collate-classes' keyword and print information about available collation classes. * locale/strlen-hash.h: New file. Simple hashing function which takes a string with known length. * locale/Makefile (distribute): Add strlen-hash.h. (locale-modules): New var. Additional files for `locale' program. * locale/C-ctype.c: Rewrite to avoid using string for giving values which are of type `u_int32_t'. Correct entry for EOF in toupper and tolower tables. * locale/loadlocale.c (_nl_load_locale): Add cast to prevent warning. * locale/programs/ld-ctype.c (ctype_output): Add code to make sure that all tables in binary file are words aligned. * locale/programs/locfile.c (write_locale_data): Correct handling of LC_MESSAGES locale. Create directory if necessary. * locale/setlocale.c (setlocale): Add cast to avoid warning. * string/string.h: Add prototype for `__strndup'. Wed Jul 24 19:10:00 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * wcsmbs/mbrtowc.c: Remove unused variable. Sun Jul 28 22:40:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * sysdeps/unix/sysv/linux/configure.in (LIBC_LINUX_VERSION): Update to 2.0.10; some problems were reported with an earlier version, and this one is known to work. * sysdeps/generic/dl-sysdep.c (__libc_enable_secure): New variable. * sysdeps/mach/hurd/dl-sysdep.c: Likewise.
202 lines
5.5 KiB
C
202 lines
5.5 KiB
C
/* nl_langinfo -- Access to locale-dependent parameters.
|
|
Copyright (C) 1995, 1996 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., 675 Mass Ave,
|
|
Cambridge, MA 02139, USA. */
|
|
|
|
#ifndef _LANGINFO_H
|
|
#define _LANGINFO_H 1
|
|
|
|
#include <locale.h> /* Define the LC_* category names. */
|
|
|
|
__BEGIN_DECLS
|
|
|
|
/* Construct an `nl_item' value for `nl_langinfo' from a locale category
|
|
(LC_*) and an item index within the category. Some code may depend on
|
|
the item values within a category increasing monotonically with the
|
|
indices. */
|
|
#define _NL_ITEM(category, index) (((category) << 16) | (index))
|
|
|
|
/* Extract the category and item index from a constructed `nl_item' value. */
|
|
#define _NL_ITEM_CATEGORY(item) ((int) (item) >> 16)
|
|
#define _NL_ITEM_INDEX(item) ((int) (item) & 0xffff)
|
|
|
|
|
|
/* Enumeration of locale items that can be queried with `nl_langinfo'. */
|
|
typedef enum
|
|
{
|
|
/* LC_TIME category: date and time formatting. */
|
|
|
|
/* Abbreviated days of the week. */
|
|
ABDAY_1 = _NL_ITEM (LC_TIME, 0), /* Sun */
|
|
ABDAY_2,
|
|
ABDAY_3,
|
|
ABDAY_4,
|
|
ABDAY_5,
|
|
ABDAY_6,
|
|
ABDAY_7,
|
|
|
|
/* Long-named days of the week. */
|
|
DAY_1, /* Sunday */
|
|
DAY_2, /* Monday */
|
|
DAY_3, /* Tuesday */
|
|
DAY_4, /* Wednesday */
|
|
DAY_5, /* Thursday */
|
|
DAY_6, /* Friday */
|
|
DAY_7, /* Saturday */
|
|
|
|
/* Abbreviated month names. */
|
|
ABMON_1, /* Jan */
|
|
ABMON_2,
|
|
ABMON_3,
|
|
ABMON_4,
|
|
ABMON_5,
|
|
ABMON_6,
|
|
ABMON_7,
|
|
ABMON_8,
|
|
ABMON_9,
|
|
ABMON_10,
|
|
ABMON_11,
|
|
ABMON_12,
|
|
|
|
/* Long month names. */
|
|
MON_1, /* January */
|
|
MON_2,
|
|
MON_3,
|
|
MON_4,
|
|
MON_5,
|
|
MON_6,
|
|
MON_7,
|
|
MON_8,
|
|
MON_9,
|
|
MON_10,
|
|
MON_11,
|
|
MON_12,
|
|
|
|
AM_STR, /* Ante meridian string. */
|
|
PM_STR, /* Post meridian string. */
|
|
|
|
D_T_FMT, /* Date and time format for strftime. */
|
|
D_FMT, /* Date format for strftime. */
|
|
T_FMT, /* Time format for strftime. */
|
|
T_FMT_AMPM, /* 12-hour time format for strftime. */
|
|
|
|
ERA, /* Alternate era. */
|
|
ERA_YEAR, /* Year in alternate era format. */
|
|
ERA_D_FMT, /* Date in alternate era format. */
|
|
ALT_DIGITS, /* Alternate symbols for digits. */
|
|
ERA_D_T_FMT, /* Date and time in alternate era format. */
|
|
ERA_T_FMT, /* Time in alternate era format. */
|
|
|
|
_NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */
|
|
|
|
/* LC_COLLATE category: text sorting.
|
|
This information is accessed by the strcoll and strxfrm functions.
|
|
These `nl_langinfo' names are used only internally. */
|
|
_NL_COLLATE_NRULES = _NL_ITEM (LC_COLLATE, 0),
|
|
_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_COLLATE_ELEM_HASH_SIZE,
|
|
_NL_COLLATE_ELEM_HASH_EB,
|
|
_NL_COLLATE_ELEM_HASH_EL,
|
|
_NL_COLLATE_ELEM_STR_POOL,
|
|
_NL_COLLATE_ELEM_VAL_EB,
|
|
_NL_COLLATE_ELEM_VAL_EL,
|
|
_NL_COLLATE_SYMB_HASH_SIZE,
|
|
_NL_COLLATE_SYMB_HASH_EB,
|
|
_NL_COLLATE_SYMB_HASH_EL,
|
|
_NL_COLLATE_SYMB_STR_POOL,
|
|
_NL_COLLATE_SYMB_CLASS_EB,
|
|
_NL_COLLATE_SYMB_CLASS_EL,
|
|
_NL_NUM_LC_COLLATE,
|
|
|
|
/* LC_CTYPE category: character classification.
|
|
This information is accessed by the functions in <ctype.h>.
|
|
These `nl_langinfo' names are used only internally. */
|
|
_NL_CTYPE_CLASS = _NL_ITEM (LC_CTYPE, 0),
|
|
_NL_CTYPE_TOUPPER_EB,
|
|
_NL_CTYPE_TOLOWER_EB,
|
|
_NL_CTYPE_TOUPPER_EL,
|
|
_NL_CTYPE_TOLOWER_EL,
|
|
_NL_CTYPE_CLASS32,
|
|
_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,
|
|
_NL_CTYPE_MB_CUR_MAX,
|
|
_NL_CTYPE_CODESET_NAME,
|
|
_NL_NUM_LC_CTYPE,
|
|
|
|
/* LC_MONETARY category: formatting of monetary quantities.
|
|
These items each correspond to a member of `struct lconv',
|
|
defined in <locale.h>. */
|
|
INT_CURR_SYMBOL = _NL_ITEM (LC_MONETARY, 0),
|
|
CURRENCY_SYMBOL,
|
|
MON_DECIMAL_POINT,
|
|
MON_THOUSANDS_SEP,
|
|
MON_GROUPING,
|
|
POSITIVE_SIGN,
|
|
NEGATIVE_SIGN,
|
|
INT_FRAC_DIGITS,
|
|
FRAC_DIGITS,
|
|
P_CS_PRECEDES,
|
|
P_SEP_BY_SPACE,
|
|
N_CS_PRECEDES,
|
|
N_SEP_BY_SPACE,
|
|
P_SIGN_POSN,
|
|
N_SIGN_POSN,
|
|
_NL_NUM_LC_MONETARY,
|
|
|
|
/* LC_NUMERIC category: formatting of numbers.
|
|
These also correspond to members of `struct lconv'; see <locale.h>. */
|
|
DECIMAL_POINT = _NL_ITEM (LC_NUMERIC, 0),
|
|
THOUSANDS_SEP,
|
|
GROUPING,
|
|
_NL_NUM_LC_NUMERIC,
|
|
|
|
YESEXPR = _NL_ITEM (LC_MESSAGES, 0), /* Regex matching ``yes'' input. */
|
|
NOEXPR, /* Regex matching ``no'' input. */
|
|
YESSTR, /* Output string for ``yes''. */
|
|
NOSTR, /* Output string for ``no''. */
|
|
_NL_NUM_LC_MESSAGES,
|
|
|
|
/* This marks the highest value used. */
|
|
_NL_NUM
|
|
} nl_item;
|
|
|
|
|
|
/* Return the current locale's value for ITEM.
|
|
If ITEM is invalid, an empty string is returned.
|
|
|
|
The string returned will not change until `setlocale' is called;
|
|
it is usually in read-only memory and cannot be modified. */
|
|
|
|
extern char *nl_langinfo __P ((nl_item __item));
|
|
|
|
|
|
__END_DECLS
|
|
|
|
#endif /* langinfo.h */
|