From 933e73facc338fb81f1f72af416ea57fbf439a2f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 6 Mar 1995 03:00:08 +0000 Subject: Sun Mar 5 19:40:13 1995 Roland McGrath * locale/localeinfo.h: Rewritten for new locale system, using locale data files and with interface. * locale/setlocale.c: Rewritten to use locale data files. * langinfo.h: New file. * locale/langinfo.h: New file. * locale/nl_langinfo.c: New file. * locale/loadlocale.c: New file. * locale/lc-ctype.c: New file. * locale/lc-messages.c: New file. * locale/lc-monetary.c: New file. * locale/lc-numeric.c: New file. * locale/lc-time.c: New file. * locale/categories.def: New file. * locale/Makefile (headers): Remove localeinfo.h. (distribute): New variable; put localeinfo.h here, and categories.def. (routines): Add loadlocale. (categories): New variable. (aux): Use that to get C-category and lc-category. * ctype/ctype.h (_IS*): Use independent bits for all but _ISalnum. * locale/C-ctype.c, locale/C-messages.c: New files. * locale/C-monetary.c, locale/C-numeric.c, locale/C-time.c: Default "C" locale data updated for new locale system. * locale/C-collate.c: File removed. * locale/C-ctype_ct.c: File removed. * locale/C-ctype_mb.c: File removed. * locale/C-response.c: File removed. * locale/localeconv.c: Use _NL_CURRENT macro to access locale data. * stdio/printf_fp.c, stdio/vfprintf.c, stdio/vfscanf.c, stdlib/strtod.c, time/asctime.c, time/strftime.c: Include ../locale/localeinfo.h and use _NL_CURRENT macro to access locale data. * time/localtime.c: Don't include . * time/tzset.c: Don't use locale items for default TZ value or "GMT" string (use "UTC"). * stdio/vfprintf.c [USE_IN_LIBIO] (PAD): Only call the function if WIDTH>0; update DONE. * malloc/malloc.c (morecore): Fix last change to calculate by blocks instead of bytes. --- time/strftime.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'time/strftime.c') diff --git a/time/strftime.c b/time/strftime.c index ccc19c72b0..625508c72e 100644 --- a/time/strftime.c +++ b/time/strftime.c @@ -3,7 +3,7 @@ _ */ -/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1994, 1995 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 @@ -22,7 +22,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#include +#include "../locale/localeinfo.h" #include #include #include @@ -90,19 +90,20 @@ DEFUN(strftime, (s, maxsize, format, tp), char *s AND size_t maxsize AND CONST char *format AND register CONST struct tm *tp) { - CONST char *CONST a_wkday = _time_info->abbrev_wkday[tp->tm_wday]; - CONST char *CONST f_wkday = _time_info->full_wkday[tp->tm_wday]; - CONST char *CONST a_month = _time_info->abbrev_month[tp->tm_mon]; - CONST char *CONST f_month = _time_info->full_month[tp->tm_mon]; + CONST char *CONST a_wkday = _NL_CURRENT (LC_TIME, ABDAY_1 + tp->tm_wday); + CONST char *CONST f_wkday = _NL_CURRENT (LC_TIME, DAY_1 + tp->tm_wday); + CONST char *CONST a_month = _NL_CURRENT (LC_TIME, ABMON_1 + tp->tm_mon); + CONST char *CONST f_month = _NL_CURRENT (LC_TIME, MON_1 + tp->tm_mon); size_t aw_len = strlen(a_wkday); size_t am_len = strlen(a_month); size_t wkday_len = strlen(f_wkday); size_t month_len = strlen(f_month); int hour12 = tp->tm_hour; - CONST char *CONST ampm = _time_info->ampm[hour12 >= 12]; - size_t ap_len = strlen(ampm); - CONST unsigned int y_week0 = week(tp, 0); - CONST unsigned int y_week1 = week(tp, 1); + CONST char *CONST ampm = _NL_CURRENT (LC_TIME, + hour12 > 12 ? PM_STR : AM_STR); + size_t ap_len = strlen (ampm); + CONST unsigned int y_week0 = week (tp, 0); + CONST unsigned int y_week1 = week (tp, 1); CONST char *zone; size_t zonelen; register size_t i = 0; @@ -172,7 +173,7 @@ DEFUN(strftime, (s, maxsize, format, tp), break; case 'c': - subfmt = _time_info->date_time; + subfmt = _NL_CURRENT (LC_TIME, D_T_FMT); subformat: { size_t len = strftime (p, maxsize - i, subfmt, tp); @@ -265,11 +266,11 @@ DEFUN(strftime, (s, maxsize, format, tp), break; case 'X': - subfmt = _time_info->time; + subfmt = _NL_CURRENT (LC_TIME, T_FMT); goto subformat; case 'x': - subfmt = _time_info->date; + subfmt = _NL_CURRENT (LC_TIME, D_FMT); goto subformat; case 'Y': -- cgit v1.2.3