-/* Copyright (C) 1991-1999, 2000, 2001, 2003, 2004, 2005 Free Software
+/* Copyright (C) 1991-1999, 2000, 2001, 2003, 2004, 2005, 2006 Free Software
Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#ifdef _LIBC
# define HAVE_MBLEN 1
# define HAVE_MBRLEN 1
# define HAVE_TZSET 1
# define MULTIBYTE_IS_FORMAT_SAFE 1
# include "../locale/localeinfo.h"
+#else
+# include <config.h>
+# if FPRINTFTIME
+# include "fprintftime.h"
+# endif
#endif
#include <ctype.h>
# include <time.h>
# endif
#endif
-#if HAVE_TZNAME
+#if HAVE_TZNAME && ! defined tzname
extern char *tzname[];
#endif
# define TOLOWER(Ch, L) towlower (Ch)
# endif
#else
-# ifdef _LIBC
-# ifdef USE_IN_EXTENDED_LOCALE_MODEL
-# define TOUPPER(Ch, L) __toupper_l (Ch, L)
-# define TOLOWER(Ch, L) __tolower_l (Ch, L)
-# else
-# define TOUPPER(Ch, L) toupper (Ch)
-# define TOLOWER(Ch, L) tolower (Ch)
-# endif
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# define TOUPPER(Ch, L) __toupper_l (Ch, L)
+# define TOLOWER(Ch, L) __tolower_l (Ch, L)
# else
-# define TOUPPER(Ch, L) (islower (Ch) ? toupper (Ch) : (Ch))
-# define TOLOWER(Ch, L) (isupper (Ch) ? tolower (Ch) : (Ch))
+# define TOUPPER(Ch, L) toupper (Ch)
+# define TOLOWER(Ch, L) tolower (Ch)
# endif
#endif
/* We don't use `isdigit' here since the locale dependent
}
-#if !(defined _NL_CURRENT || HAVE_STRFTIME)
-static CHAR_T const weekday_name[][10] =
- {
- L_("Sunday"), L_("Monday"), L_("Tuesday"), L_("Wednesday"),
- L_("Thursday"), L_("Friday"), L_("Saturday")
- };
-static CHAR_T const month_name[][10] =
- {
- L_("January"), L_("February"), L_("March"), L_("April"), L_("May"),
- L_("June"), L_("July"), L_("August"), L_("September"), L_("October"),
- L_("November"), L_("December")
- };
-#endif
-
-
/* When compiling this file, GNU applications can #define my_strftime
to a symbol (typically nstrftime) to get an extended strftime with
extra arguments UT and NS. Emacs is a special case for now, but
# define aw_len STRLEN (a_wkday)
# define am_len STRLEN (a_month)
# define ap_len STRLEN (ampm)
-#else
-# if !HAVE_STRFTIME
-# define f_wkday (weekday_name[tp->tm_wday])
-# define f_month (month_name[tp->tm_mon])
-# define a_wkday f_wkday
-# define a_month f_month
-# define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11))
-
- size_t aw_len = 3;
- size_t am_len = 3;
- size_t ap_len = 2;
-# endif
#endif
const char *zone;
size_t i = 0;
to_uppcase = true;
to_lowcase = false;
}
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
cpy (aw_len, a_wkday);
break;
#else
to_uppcase = true;
to_lowcase = false;
}
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
cpy (STRLEN (f_wkday), f_wkday);
break;
#else
}
if (modifier != 0)
goto bad_format;
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
cpy (am_len, a_month);
break;
#else
to_uppcase = true;
to_lowcase = false;
}
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
cpy (STRLEN (f_month), f_month);
break;
#else
!= '\0')))
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# else
- subfmt = L_("%a %b %e %H:%M:%S %Y");
-# endif
#endif
subformat:
}
break;
-#if HAVE_STRFTIME && ! (defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
+#if !(defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
underlying_strftime:
{
/* The relevant information is available only via the
break;
}
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# endif
#endif
}
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
goto subformat;
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# else
- /* Fall through. */
-# endif
#endif
case L_('D'):
if (modifier != 0)
}
}
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# endif
#endif
}
case L_('P'):
to_lowcase = true;
-#if !defined _NL_CURRENT && HAVE_STRFTIME
+#ifndef _NL_CURRENT
format_char = L_('p');
#endif
/* FALLTHROUGH */
to_uppcase = false;
to_lowcase = true;
}
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
cpy (ap_len, ampm);
break;
#else
goto subformat;
case L_('r'):
-#if !defined _NL_CURRENT && HAVE_STRFTIME
- goto underlying_strftime;
-#else
-# ifdef _NL_CURRENT
+#ifdef _NL_CURRENT
if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME,
NLW(T_FMT_AMPM)))
== L_('\0'))
-# endif
subfmt = L_("%I:%M:%S %p");
goto subformat;
+#else
+ goto underlying_strftime;
#endif
case L_('S'):
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
goto subformat;
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# else
- /* Fall through. */
-# endif
#endif
case L_('T'):
subfmt = L_("%H:%M:%S");
goto subformat;
}
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# endif
#endif
}
if (modifier == L_('O'))
+ delta * era->absolute_direction));
}
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# endif
#endif
}