mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 13:00:06 +00:00
761a585ce9
All the previous changes also repeated to support abbreviated alternative month names. In most languages which have declension and need nominative/genitive month names the abbreviated forms for both cases are the same. An example where they do differ is May in Russian: this name is too short to be abbreviated so even the abbreviated form features the declension suffixes. [BZ #10871] * locale/C-time.c (_nl_C_LC_TIME): Add abbreviated alternative month names, define them as the same as abbreviated month names explicitly. * locale/categories.def (LC_TIME): Add ab_alt_mon and wide-ab_alt_mon. * locale/langinfo.h: (_NL_ABALTMON_1, _NL_ABALTMON_2, _NL_ABALTMON_3, _NL_ABALTMON_4, _NL_ABALTMON_5, _NL_ABALTMON_6, _NL_ABALTMON_7, _NL_ABALTMON_8, _NL_ABALTMON_9, _NL_ABALTMON_10, _NL_ABALTMON_11, _NL_ABALTMON_12, _NL_WABALTMON_1, _NL_WABALTMON_2, _NL_WABALTMON_3, _NL_WABALTMON_4, _NL_WABALTMON_5, _NL_WABALTMON_6, _NL_WABALTMON_7, _NL_WABALTMON_8, _NL_WABALTMON_9, _NL_WABALTMON_10, _NL_WABALTMON_11, _NL_WABALTMON_12): New enum constants. * locale/programs/ld-time.c (struct locale_time_t): Add ab_alt_mon, wab_alt_mon, and ab_alt_mon_defined members. (time_output): Output ab_alt_mon and wab_alt_mon members. (time_read): Read them, initialize them as copies of abmon and wabmon respectively if they are missing, initialize ab_alt_mon_defined. * locale/programs/locfile-kw.gperf (ab_alt_mon): Define. * locale/programs/locfile-kw.h: Regenerate. * locale/programs/locfile-token.h (tok_ab_alt_mon): New enum constant. * time/Makefile [$(run-built-tests) = yes] (LOCALES): Add es_ES.UTF-8 and ru_RU.UTF-8. * time/strftime_l.c (a_altmonth, aam_len): New macros. [!COMPILE_WIDE] (ABALTMON_1): New macro. (__strftime_internal): Handle %Ob and %Oh formats. * time/strptime_l.c [_LIBC] (ab_alt_month_name): New macro. (__strptime_internal): Handle %Ob and %Oh formats. * time/tst-strptime.c (day_tests): Add more tests to parse different forms of month names including the new %Ob format specifier. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
196 lines
6.7 KiB
C
196 lines
6.7 KiB
C
/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
Contributed by Ulrich Drepper <drepper@gnu.org>, 1995.
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 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
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with the GNU C Library; if not, see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
#include <stdint.h>
|
|
#include "localeinfo.h"
|
|
|
|
/* This table's entries are taken from POSIX.2 Table 2-11
|
|
``LC_TIME Category Definition in the POSIX Locale'',
|
|
with additions from ISO 14652, section 4.6. */
|
|
|
|
const struct __locale_data _nl_C_LC_TIME attribute_hidden =
|
|
{
|
|
_nl_C_name,
|
|
NULL, 0, 0, /* no file mapped */
|
|
{ NULL, }, /* no cached data */
|
|
UNDELETABLE,
|
|
0,
|
|
159,
|
|
{
|
|
{ .string = "Sun" },
|
|
{ .string = "Mon" },
|
|
{ .string = "Tue" },
|
|
{ .string = "Wed" },
|
|
{ .string = "Thu" },
|
|
{ .string = "Fri" },
|
|
{ .string = "Sat" },
|
|
{ .string = "Sunday" },
|
|
{ .string = "Monday" },
|
|
{ .string = "Tuesday" },
|
|
{ .string = "Wednesday" },
|
|
{ .string = "Thursday" },
|
|
{ .string = "Friday" },
|
|
{ .string = "Saturday" },
|
|
{ .string = "Jan" },
|
|
{ .string = "Feb" },
|
|
{ .string = "Mar" },
|
|
{ .string = "Apr" },
|
|
{ .string = "May" },
|
|
{ .string = "Jun" },
|
|
{ .string = "Jul" },
|
|
{ .string = "Aug" },
|
|
{ .string = "Sep" },
|
|
{ .string = "Oct" },
|
|
{ .string = "Nov" },
|
|
{ .string = "Dec" },
|
|
{ .string = "January" },
|
|
{ .string = "February" },
|
|
{ .string = "March" },
|
|
{ .string = "April" },
|
|
{ .string = "May" },
|
|
{ .string = "June" },
|
|
{ .string = "July" },
|
|
{ .string = "August" },
|
|
{ .string = "September" },
|
|
{ .string = "October" },
|
|
{ .string = "November" },
|
|
{ .string = "December" },
|
|
{ .string = "AM" },
|
|
{ .string = "PM" },
|
|
{ .string = "%a %b %e %H:%M:%S %Y" },
|
|
{ .string = "%m/%d/%y" },
|
|
{ .string = "%H:%M:%S" },
|
|
{ .string = "%I:%M:%S %p" },
|
|
{ .string = "" },
|
|
{ .string = "" },
|
|
{ .string = "" },
|
|
{ .string = "" },
|
|
{ .string = "" },
|
|
{ .string = "" },
|
|
{ .word = 0 },
|
|
{ .string = "" },
|
|
{ .wstr = (const uint32_t *) L"Sun" },
|
|
{ .wstr = (const uint32_t *) L"Mon" },
|
|
{ .wstr = (const uint32_t *) L"Tue" },
|
|
{ .wstr = (const uint32_t *) L"Wed" },
|
|
{ .wstr = (const uint32_t *) L"Thu" },
|
|
{ .wstr = (const uint32_t *) L"Fri" },
|
|
{ .wstr = (const uint32_t *) L"Sat" },
|
|
{ .wstr = (const uint32_t *) L"Sunday" },
|
|
{ .wstr = (const uint32_t *) L"Monday" },
|
|
{ .wstr = (const uint32_t *) L"Tuesday" },
|
|
{ .wstr = (const uint32_t *) L"Wednesday" },
|
|
{ .wstr = (const uint32_t *) L"Thursday" },
|
|
{ .wstr = (const uint32_t *) L"Friday" },
|
|
{ .wstr = (const uint32_t *) L"Saturday" },
|
|
{ .wstr = (const uint32_t *) L"Jan" },
|
|
{ .wstr = (const uint32_t *) L"Feb" },
|
|
{ .wstr = (const uint32_t *) L"Mar" },
|
|
{ .wstr = (const uint32_t *) L"Apr" },
|
|
{ .wstr = (const uint32_t *) L"May" },
|
|
{ .wstr = (const uint32_t *) L"Jun" },
|
|
{ .wstr = (const uint32_t *) L"Jul" },
|
|
{ .wstr = (const uint32_t *) L"Aug" },
|
|
{ .wstr = (const uint32_t *) L"Sep" },
|
|
{ .wstr = (const uint32_t *) L"Oct" },
|
|
{ .wstr = (const uint32_t *) L"Nov" },
|
|
{ .wstr = (const uint32_t *) L"Dec" },
|
|
{ .wstr = (const uint32_t *) L"January" },
|
|
{ .wstr = (const uint32_t *) L"February" },
|
|
{ .wstr = (const uint32_t *) L"March" },
|
|
{ .wstr = (const uint32_t *) L"April" },
|
|
{ .wstr = (const uint32_t *) L"May" },
|
|
{ .wstr = (const uint32_t *) L"June" },
|
|
{ .wstr = (const uint32_t *) L"July" },
|
|
{ .wstr = (const uint32_t *) L"August" },
|
|
{ .wstr = (const uint32_t *) L"September" },
|
|
{ .wstr = (const uint32_t *) L"October" },
|
|
{ .wstr = (const uint32_t *) L"November" },
|
|
{ .wstr = (const uint32_t *) L"December" },
|
|
{ .wstr = (const uint32_t *) L"AM" },
|
|
{ .wstr = (const uint32_t *) L"PM" },
|
|
{ .wstr = (const uint32_t *) L"%a %b %e %H:%M:%S %Y" },
|
|
{ .wstr = (const uint32_t *) L"%m/%d/%y" },
|
|
{ .wstr = (const uint32_t *) L"%H:%M:%S" },
|
|
{ .wstr = (const uint32_t *) L"%I:%M:%S %p" },
|
|
{ .wstr = (const uint32_t *) L"" },
|
|
{ .wstr = (const uint32_t *) L"" },
|
|
{ .wstr = (const uint32_t *) L"" },
|
|
{ .wstr = (const uint32_t *) L"" },
|
|
{ .wstr = (const uint32_t *) L"" },
|
|
{ .string = "\7" },
|
|
{ .word = 19971130 },
|
|
{ .string = "\4" },
|
|
{ .string = "\1" },
|
|
{ .string = "\2" },
|
|
{ .string = "\1" },
|
|
{ .string = "" },
|
|
{ .string = "%a %b %e %H:%M:%S %Z %Y" },
|
|
{ .wstr = (const uint32_t *) L"%a %b %e %H:%M:%S %Z %Y" },
|
|
{ .string = _nl_C_codeset },
|
|
{ .string = "January" },
|
|
{ .string = "February" },
|
|
{ .string = "March" },
|
|
{ .string = "April" },
|
|
{ .string = "May" },
|
|
{ .string = "June" },
|
|
{ .string = "July" },
|
|
{ .string = "August" },
|
|
{ .string = "September" },
|
|
{ .string = "October" },
|
|
{ .string = "November" },
|
|
{ .string = "December" },
|
|
{ .wstr = (const uint32_t *) L"January" },
|
|
{ .wstr = (const uint32_t *) L"February" },
|
|
{ .wstr = (const uint32_t *) L"March" },
|
|
{ .wstr = (const uint32_t *) L"April" },
|
|
{ .wstr = (const uint32_t *) L"May" },
|
|
{ .wstr = (const uint32_t *) L"June" },
|
|
{ .wstr = (const uint32_t *) L"July" },
|
|
{ .wstr = (const uint32_t *) L"August" },
|
|
{ .wstr = (const uint32_t *) L"September" },
|
|
{ .wstr = (const uint32_t *) L"October" },
|
|
{ .wstr = (const uint32_t *) L"November" },
|
|
{ .wstr = (const uint32_t *) L"December" },
|
|
{ .string = "Jan" },
|
|
{ .string = "Feb" },
|
|
{ .string = "Mar" },
|
|
{ .string = "Apr" },
|
|
{ .string = "May" },
|
|
{ .string = "Jun" },
|
|
{ .string = "Jul" },
|
|
{ .string = "Aug" },
|
|
{ .string = "Sep" },
|
|
{ .string = "Oct" },
|
|
{ .string = "Nov" },
|
|
{ .string = "Dec" },
|
|
{ .wstr = (const uint32_t *) L"Jan" },
|
|
{ .wstr = (const uint32_t *) L"Feb" },
|
|
{ .wstr = (const uint32_t *) L"Mar" },
|
|
{ .wstr = (const uint32_t *) L"Apr" },
|
|
{ .wstr = (const uint32_t *) L"May" },
|
|
{ .wstr = (const uint32_t *) L"Jun" },
|
|
{ .wstr = (const uint32_t *) L"Jul" },
|
|
{ .wstr = (const uint32_t *) L"Aug" },
|
|
{ .wstr = (const uint32_t *) L"Sep" },
|
|
{ .wstr = (const uint32_t *) L"Oct" },
|
|
{ .wstr = (const uint32_t *) L"Nov" },
|
|
{ .wstr = (const uint32_t *) L"Dec" }
|
|
}
|
|
};
|