Changeset View
Changeset View
Standalone View
Standalone View
contrib/tzcode/strftime.c
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | |||||
static char * _yconv(int, int, bool, bool, char *, char const *); | static char * _yconv(int, int, bool, bool, char *, char const *); | ||||
#ifndef YEAR_2000_NAME | #ifndef YEAR_2000_NAME | ||||
# define YEAR_2000_NAME "CHECK_STRFTIME_FORMATS_FOR_TWO_DIGIT_YEARS" | # define YEAR_2000_NAME "CHECK_STRFTIME_FORMATS_FOR_TWO_DIGIT_YEARS" | ||||
#endif /* !defined YEAR_2000_NAME */ | #endif /* !defined YEAR_2000_NAME */ | ||||
#if HAVE_STRFTIME_L | #if HAVE_STRFTIME_L | ||||
size_t | size_t | ||||
strftime_l(char *s, size_t maxsize, char const *format, struct tm const *t, | strftime_l(char *restrict s, size_t maxsize, char const *restrict format, | ||||
struct tm const *restrict t, | |||||
ATTRIBUTE_MAYBE_UNUSED locale_t locale) | ATTRIBUTE_MAYBE_UNUSED locale_t locale) | ||||
{ | { | ||||
/* Just call strftime, as only the C locale is supported. */ | /* Just call strftime, as only the C locale is supported. */ | ||||
return strftime(s, maxsize, format, t); | return strftime(s, maxsize, format, t); | ||||
} | } | ||||
#endif | #endif | ||||
size_t | size_t | ||||
strftime(char *s, size_t maxsize, const char *format, const struct tm *t) | strftime(char *restrict s, size_t maxsize, char const *restrict format, | ||||
struct tm const *restrict t) | |||||
{ | { | ||||
char * p; | char * p; | ||||
int saved_errno = errno; | int saved_errno = errno; | ||||
enum warn warn = IN_NONE; | enum warn warn = IN_NONE; | ||||
tzset(); | tzset(); | ||||
p = _fmt(format, t, s, s + maxsize, &warn); | p = _fmt(format, t, s, s + maxsize, &warn); | ||||
if (!p) { | if (!p) { | ||||
▲ Show 20 Lines • Show All 521 Lines • Show Last 20 Lines |