From df9f41c94286bcaac949fd490e11bde61b8a9567 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 28 Aug 2002 23:11:21 +0000 Subject: * locale/lc-time.c (_nl_init_era_entries, _nl_get_era_entry, _nl_select_era_entry): Moved to ... * time/era.c: ... here, new file. (_nl_init_era_entries, _nl_get_era_entry, _nl_select_era_entry): Add internal_function to definitions. Take an additional argument giving the `struct locale_data *' to use. * locale/lc-time.c (_get_alt_digit, _nl_get_walt_digit, _nl_parse_alt_digit): Moved to ... * time/alt_digit.c: ... here, new file. * time/lc-time-cleanup.c: New file. * locale/lc-time.c (_nl_postload_time, free_mem): Functions removed. * locale/localeinfo.h (_nl_postload_time): Remove decl. (_nl_cleanup_time): Declare it. (_nl_get_era_entry, _nl_select_era_entry): Update decls. (_get_alt_digit, _nl_get_walt_digit, _nl_parse_alt_digit): Likewise. * time/Makefile (aux): New variable: era, alt_digit, lc-time-cleanup. * time/strftime.c: Pass locale data to helper functions. * time/strptime.c: Likewise. * locale/localeinfo.h (struct locale_data): New member `private' * locale/loadlocale.c (_nl_intern_locale_data): Initialize it. (_nl_unload_locale): Call LOCALE->private.cleanup if it is set. * locale/C-collate.c: Update initializer. * locale/C-identification.c: Likewise. * locale/C-measurement.c: Likewise. * locale/C-telephone.c: Likewise. * locale/C-address.c: Likewise. * locale/C-name.c: Likewise. * locale/C-paper.c: Likewise. * locale/C-time.c: Likewise. * locale/C-numeric.c: Likewise. * locale/C-monetary.c: Likewise. * locale/C-messages.c : Likewise. * locale/C-ctype.c: Likewise. * time/strptime.c [USE_IN_EXTENDED_LOCALE_MODEL] (_NL_CURRENT_WORD): Redefine this too. --- time/strftime.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'time/strftime.c') diff --git a/time/strftime.c b/time/strftime.c index 986124399b..5215f567f0 100644 --- a/time/strftime.c +++ b/time/strftime.c @@ -315,10 +315,16 @@ static const CHAR_T zeroes[16] = /* "0000000000000000" */ # define LOCALE_PARAM , loc # define LOCALE_ARG , loc # define LOCALE_PARAM_DECL __locale_t loc; +# define HELPER_LOCALE_ARG , current #else # define LOCALE_PARAM # define LOCALE_ARG # define LOCALE_PARAM_DECL +# ifdef _LIBC +# define HELPER_LOCALE_ARG , _NL_CURRENT_DATA (LC_TIME) +# else +# define HELPER_LOCALE_ARG +# endif #endif #ifdef COMPILE_WIDE @@ -494,7 +500,7 @@ my_strftime (s, maxsize, format, tp ut_argument LOCALE_PARAM) LOCALE_PARAM_DECL { #if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL - const struct locale_data *const current = loc->__locales[LC_TIME]; + struct locale_data *const current = loc->__locales[LC_TIME]; #endif int hour12 = tp->tm_hour; @@ -880,7 +886,7 @@ my_strftime (s, maxsize, format, tp ut_argument LOCALE_PARAM) if (modifier == L_('E')) { #if HAVE_STRUCT_ERA_ENTRY - struct era_entry *era = _nl_get_era_entry (tp); + struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); if (era) { # ifdef COMPILE_WIDE @@ -956,9 +962,11 @@ my_strftime (s, maxsize, format, tp ut_argument LOCALE_PARAM) /* Get the locale specific alternate representation of the number NUMBER_VALUE. If none exist NULL is returned. */ # ifdef COMPILE_WIDE - const wchar_t *cp = _nl_get_walt_digit (number_value); + const wchar_t *cp = _nl_get_walt_digit (number_value + HELPER_LOCALE_ARG); # else - const char *cp = _nl_get_alt_digit (number_value); + const char *cp = _nl_get_alt_digit (number_value + HELPER_LOCALE_ARG); # endif if (cp != NULL) @@ -1238,7 +1246,7 @@ my_strftime (s, maxsize, format, tp ut_argument LOCALE_PARAM) if (modifier == 'E') { #if HAVE_STRUCT_ERA_ENTRY - struct era_entry *era = _nl_get_era_entry (tp); + struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); if (era) { # ifdef COMPILE_WIDE @@ -1263,7 +1271,7 @@ my_strftime (s, maxsize, format, tp ut_argument LOCALE_PARAM) if (modifier == L_('E')) { #if HAVE_STRUCT_ERA_ENTRY - struct era_entry *era = _nl_get_era_entry (tp); + struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); if (era) { int delta = tp->tm_year - era->start_date[0]; -- cgit v1.2.3