diff options
Diffstat (limited to 'time')
-rw-r--r-- | time/asctime.c | 8 | ||||
-rw-r--r-- | time/localtime.c | 1 | ||||
-rw-r--r-- | time/strftime.c | 27 | ||||
-rw-r--r-- | time/tzset.c | 14 |
4 files changed, 24 insertions, 26 deletions
diff --git a/time/asctime.c b/time/asctime.c index 3337c74..644df32 100644 --- a/time/asctime.c +++ b/time/asctime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 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 @@ -17,7 +17,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ansidecl.h> -#include <localeinfo.h> +#include "../locale/localeinfo.h" #include <errno.h> #include <stdio.h> #include <time.h> @@ -39,9 +39,9 @@ DEFUN(asctime, (tp), CONST struct tm *tp) if (sprintf (result, format, (tp->tm_wday < 0 || tp->tm_wday >= 7 ? - "???" : _time_info->abbrev_wkday[tp->tm_wday]), + "???" : _NL_CURRENT (LC_TIME, ABDAY_1 + tp->tm_wday)), (tp->tm_mon < 0 || tp->tm_mon >= 12 ? - "???" : _time_info->abbrev_month[tp->tm_mon]), + "???" : _NL_CURRENT (LC_TIME, ABMON_1 + tp->tm_mon)), tp->tm_mday, tp->tm_hour, tp->tm_min, tp->tm_sec, 1900 + tp->tm_year) < 0) return NULL; diff --git a/time/localtime.c b/time/localtime.c index 3377b80..a729b97 100644 --- a/time/localtime.c +++ b/time/localtime.c @@ -17,7 +17,6 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ansidecl.h> -#include <localeinfo.h> #include <stddef.h> #include <ctype.h> #include <stdio.h> diff --git a/time/strftime.c b/time/strftime.c index ccc19c7..625508c 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 <ansidecl.h> -#include <localeinfo.h> +#include "../locale/localeinfo.h" #include <ctype.h> #include <limits.h> #include <stddef.h> @@ -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': diff --git a/time/tzset.c b/time/tzset.c index e4d5209..3eac151 100644 --- a/time/tzset.c +++ b/time/tzset.c @@ -17,7 +17,6 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ansidecl.h> -#include <localeinfo.h> #include <ctype.h> #include <stddef.h> #include <stdio.h> @@ -112,21 +111,20 @@ DEFUN_VOID(__tzset) } if (tz == NULL || *tz == '\0') - tz = _time_info->tz; - if (tz == NULL || *tz == '\0') { __tzfile_read((char *) NULL); if (!__use_tzfile) { - size_t len = strlen(_time_info->ut0) + 1; + const char UTC[] = "UTC"; + size_t len = sizeof UTC; tz_rules[0].name = (char *) malloc(len); if (tz_rules[0].name == NULL) return; tz_rules[1].name = (char *) malloc(len); if (tz_rules[1].name == NULL) return; - memcpy((PTR) tz_rules[0].name, _time_info->ut0, len); - memcpy((PTR) tz_rules[1].name, _time_info->ut0, len); + memcpy ((PTR) tz_rules[0].name, UTC, len); + memcpy ((PTR) tz_rules[1].name, UTC, len); tz_rules[0].type = tz_rules[1].type = J0; tz_rules[0].m = tz_rules[0].n = tz_rules[0].d = 0; tz_rules[1].m = tz_rules[1].n = tz_rules[1].d = 0; @@ -139,7 +137,7 @@ DEFUN_VOID(__tzset) return; } - /* Clear out old state and reset to unnamed GMT. */ + /* Clear out old state and reset to unnamed UTC. */ memset (tz_rules, 0, sizeof tz_rules); tz_rules[0].name = tz_rules[1].name = (char *) ""; @@ -165,7 +163,7 @@ DEFUN_VOID(__tzset) tz += l; - /* Figure out the standard offset from GMT. */ + /* Figure out the standard offset from UTC. */ if (*tz == '\0' || (*tz != '+' && *tz != '-' && !isdigit(*tz))) return; |