#include <ctype.h>
#include <errno.h>
#include <float.h>
-#include <localeinfo.h>
+#include "../locale/localeinfo.h"
#include <math.h>
#include <stdlib.h>
-#include "gmp.h"
-#include "gmp-impl.h"
+#include "../stdio/gmp.h"
+#include "../stdio/gmp-impl.h"
#include <gmp-mparam.h>
-#include "longlong.h"
-#include "fpioconst.h"
+#include "../stdio/longlong.h"
+#include "../stdio/fpioconst.h"
#define NDEBUG 1
#include <assert.h>
/* Return with no conversion if the grouping of [STARTP,CP) is bad. */
#define CHECK_GROUPING if (! grouping_ok (startp, cp)) RETURN (0.0, nptr); else
- grouping = _numeric_info->grouping; /* Cache the grouping info array. */
+ grouping = _NL_CURRENT (LC_NUMERIC, GROUPING);
if (*grouping <= 0 || *grouping == CHAR_MAX)
grouping = NULL;
else
{
/* Figure out the thousands seperator character. */
- if (mbtowc (&thousands_sep, _numeric_info->thousands_sep,
- strlen (_numeric_info->thousands_sep)) <= 0)
- thousands = (wchar_t) *_numeric_info->thousands_sep;
+ if (mbtowc (&thousands_sep, _NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP),
+ strlen (_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP))) <= 0)
+ thousands = (wchar_t) *_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP);
if (thousands == L'\0')
grouping = NULL;
}
#endif
/* Find the locale's decimal point character. */
- if (mbtowc (&decimal, _numeric_info->decimal_point,
- strlen (_numeric_info->decimal_point)) <= 0)
- decimal = (wchar_t) *_numeric_info->decimal_point;
+ if (mbtowc (&decimal, _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT),
+ strlen (_NL_CURRENT (LC_NUMERIC, DECIMAL_POINT))) <= 0)
+ decimal = (wchar_t) *_NL_CURRENT (LC_NUMERIC, DECIMAL_POINT);
/* Prepare number representation. */
-/* 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
Cambridge, MA 02139, USA. */
#include <ansidecl.h>
-#include <localeinfo.h>
+#include "../locale/localeinfo.h"
#include <errno.h>
#include <stdio.h>
#include <time.h>
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;
_
*/
-/* 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
Cambridge, MA 02139, USA. */
#include <ansidecl.h>
-#include <localeinfo.h>
+#include "../locale/localeinfo.h"
#include <ctype.h>
#include <limits.h>
#include <stddef.h>
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;
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);
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':