1 /* Copyright (C) 2002,2004,2005,2007,2008,2010 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
32 # include "../locale/localeinfo.h"
36 #if ! HAVE_LOCALTIME_R && ! defined localtime_r
38 # define localtime_r __localtime_r
40 /* Approximate localtime_r as best we can in its absence. */
41 # define localtime_r my_localtime_r
42 static struct tm
*localtime_r (const time_t *, struct tm
*);
48 struct tm
*l
= localtime (t
);
55 #endif /* ! HAVE_LOCALTIME_R && ! defined (localtime_r) */
58 #define match_char(ch1, ch2) if (ch1 != ch2) return NULL
59 #if defined __GNUC__ && __GNUC__ >= 2
60 # define match_string(cs1, s2) \
61 ({ size_t len = strlen (cs1); \
62 int result = __strncasecmp_l ((cs1), (s2), len, locale) == 0; \
63 if (result) (s2) += len; \
66 /* Oh come on. Get a reasonable compiler. */
67 # define match_string(cs1, s2) \
68 (strncasecmp ((cs1), (s2), strlen (cs1)) ? 0 : ((s2) += strlen (cs1), 1))
70 /* We intentionally do not use isdigit() for testing because this will
71 lead to problems with the wide character version. */
72 #define get_number(from, to, n) \
78 if (*rp < '0' || *rp > '9') \
83 } while (--__n > 0 && val * 10 <= to && *rp >= '0' && *rp <= '9'); \
84 if (val < from || val > to) \
88 # define get_alt_number(from, to, n) \
90 __label__ do_normal; \
92 if (s.decided != raw) \
94 val = _nl_parse_alt_digit (&rp HELPER_LOCALE_ARG); \
95 if (val == -1 && s.decided != loc) \
100 if (val < from || val > to) \
106 get_number (from, to, n); \
111 # define get_alt_number(from, to, n) \
112 /* We don't have the alternate representation. */ \
113 get_number(from, to, n)
115 #define recursive(new_fmt) \
116 (*(new_fmt) != '\0' \
117 && (rp = __strptime_internal (rp, (new_fmt), tm, &s LOCALE_ARG)) != NULL)
121 /* This is defined in locale/C-time.c in the GNU libc. */
122 extern const struct __locale_data _nl_C_LC_TIME attribute_hidden
;
124 # define weekday_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (DAY_1)].string)
125 # define ab_weekday_name \
126 (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABDAY_1)].string)
127 # define month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (MON_1)].string)
128 # define ab_month_name (&_nl_C_LC_TIME.values[_NL_ITEM_INDEX (ABMON_1)].string)
129 # define HERE_D_T_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_T_FMT)].string)
130 # define HERE_D_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (D_FMT)].string)
131 # define HERE_AM_STR (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (AM_STR)].string)
132 # define HERE_PM_STR (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (PM_STR)].string)
133 # define HERE_T_FMT_AMPM \
134 (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (T_FMT_AMPM)].string)
135 # define HERE_T_FMT (_nl_C_LC_TIME.values[_NL_ITEM_INDEX (T_FMT)].string)
137 # define strncasecmp(s1, s2, n) __strncasecmp (s1, s2, n)
139 static char const weekday_name
[][10] =
141 "Sunday", "Monday", "Tuesday", "Wednesday",
142 "Thursday", "Friday", "Saturday"
144 static char const ab_weekday_name
[][4] =
146 "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
148 static char const month_name
[][10] =
150 "January", "February", "March", "April", "May", "June",
151 "July", "August", "September", "October", "November", "December"
153 static char const ab_month_name
[][4] =
155 "Jan", "Feb", "Mar", "Apr", "May", "Jun",
156 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
158 # define HERE_D_T_FMT "%a %b %e %H:%M:%S %Y"
159 # define HERE_D_FMT "%m/%d/%y"
160 # define HERE_AM_STR "AM"
161 # define HERE_PM_STR "PM"
162 # define HERE_T_FMT_AMPM "%I:%M:%S %p"
163 # define HERE_T_FMT "%H:%M:%S"
165 static const unsigned short int __mon_yday
[2][13] =
168 { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
170 { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
175 /* We use this code also for the extended locale handling where the
176 function gets as an additional argument the locale which has to be
177 used. To access the values we have to redefine the _NL_CURRENT
179 # define strptime __strptime_l
181 # define _NL_CURRENT(category, item) \
182 (current->values[_NL_ITEM_INDEX (item)].string)
183 # undef _NL_CURRENT_WORD
184 # define _NL_CURRENT_WORD(category, item) \
185 (current->values[_NL_ITEM_INDEX (item)].word)
186 # define LOCALE_PARAM , locale
187 # define LOCALE_ARG , locale
188 # define LOCALE_PARAM_PROTO , __locale_t locale
189 # define LOCALE_PARAM_DECL __locale_t locale;
190 # define HELPER_LOCALE_ARG , current
191 # define ISSPACE(Ch) __isspace_l (Ch, locale)
193 # define LOCALE_PARAM
195 # define LOCALE_PARAM_DECL
196 # define LOCALE_PARAM_PROTO
197 # define HELPER_LOCALE_ARG
198 # define ISSPACE(Ch) isspace (Ch)
205 /* Nonzero if YEAR is a leap year (every 4 years,
206 except every 100th isn't, and every 400th is). */
207 # define __isleap(year) \
208 ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
211 /* Compute the day of the week. */
213 day_of_the_week (struct tm
*tm
)
215 /* We know that January 1st 1970 was a Thursday (= 4). Compute the
216 the difference between this data in the one on TM and so determine
218 int corr_year
= 1900 + tm
->tm_year
- (tm
->tm_mon
< 2);
220 + (365 * (tm
->tm_year
- 70))
222 - ((corr_year
/ 4) / 25) + ((corr_year
/ 4) % 25 < 0)
223 + (((corr_year
/ 4) / 25) / 4)
224 + __mon_yday
[0][tm
->tm_mon
]
226 tm
->tm_wday
= ((wday
% 7) + 7) % 7;
229 /* Compute the day of the year. */
231 day_of_the_year (struct tm
*tm
)
233 tm
->tm_yday
= (__mon_yday
[__isleap (1900 + tm
->tm_year
)][tm
->tm_mon
]
234 + (tm
->tm_mday
- 1));
244 __strptime_internal (rp
, fmt
, tmp
, statep LOCALE_PARAM
)
252 struct __locale_data
*const current
= locale
->__locales
[LC_TIME
];
255 const char *rp_backup
;
256 const char *rp_longest
;
261 struct era_entry
*era
= NULL
;
262 enum ptime_locale_status
{ not, loc
, raw
} decided_longest
;
263 struct __strptime_state
265 unsigned int have_I
: 1;
266 unsigned int have_wday
: 1;
267 unsigned int have_yday
: 1;
268 unsigned int have_mon
: 1;
269 unsigned int have_mday
: 1;
270 unsigned int have_uweek
: 1;
271 unsigned int have_wweek
: 1;
272 unsigned int is_pm
: 1;
273 unsigned int want_century
: 1;
274 unsigned int want_era
: 1;
275 unsigned int want_xday
: 1;
276 enum ptime_locale_status decided
: 2;
286 memset (&s
, 0, sizeof (s
));
298 s
= *(struct __strptime_state
*) statep
;
305 /* A white space in the format string matches 0 more or white
306 space in the input string. */
309 while (ISSPACE (*rp
))
315 /* Any character but `%' must be matched by the same character
316 in the iput string. */
319 match_char (*fmt
++, *rp
++);
326 /* In recursive calls silently discard strftime modifiers. */
327 while (*fmt
== '-' || *fmt
== '_' || *fmt
== '0'
328 || *fmt
== '^' || *fmt
== '#')
331 /* And field width. */
332 while (*fmt
>= '0' && *fmt
<= '9')
337 /* We need this for handling the `E' modifier. */
341 /* Make back up of current processing pointer. */
347 /* Match the `%' character itself. */
348 match_char ('%', *rp
++);
352 /* Match day of week. */
354 decided_longest
= s
.decided
;
356 for (cnt
= 0; cnt
< 7; ++cnt
)
363 if (match_string (_NL_CURRENT (LC_TIME
, DAY_1
+ cnt
), trp
)
369 && strcmp (_NL_CURRENT (LC_TIME
, DAY_1
+ cnt
),
371 decided_longest
= loc
;
374 if (match_string (_NL_CURRENT (LC_TIME
, ABDAY_1
+ cnt
), trp
)
380 && strcmp (_NL_CURRENT (LC_TIME
, ABDAY_1
+ cnt
),
381 ab_weekday_name
[cnt
]))
382 decided_longest
= loc
;
387 && (((trp
= rp
, match_string (weekday_name
[cnt
], trp
))
389 || ((trp
= rp
, match_string (ab_weekday_name
[cnt
], rp
))
390 && trp
> rp_longest
)))
394 decided_longest
= raw
;
397 if (rp_longest
== NULL
)
398 /* Does not match a weekday name. */
401 s
.decided
= decided_longest
;
402 tm
->tm_wday
= cnt_longest
;
408 /* Match month name. */
410 decided_longest
= s
.decided
;
412 for (cnt
= 0; cnt
< 12; ++cnt
)
419 if (match_string (_NL_CURRENT (LC_TIME
, MON_1
+ cnt
), trp
)
425 && strcmp (_NL_CURRENT (LC_TIME
, MON_1
+ cnt
),
427 decided_longest
= loc
;
430 if (match_string (_NL_CURRENT (LC_TIME
, ABMON_1
+ cnt
), trp
)
436 && strcmp (_NL_CURRENT (LC_TIME
, ABMON_1
+ cnt
),
438 decided_longest
= loc
;
443 && (((trp
= rp
, match_string (month_name
[cnt
], trp
))
445 || ((trp
= rp
, match_string (ab_month_name
[cnt
], trp
))
446 && trp
> rp_longest
)))
450 decided_longest
= raw
;
453 if (rp_longest
== NULL
)
454 /* Does not match a month name. */
457 s
.decided
= decided_longest
;
458 tm
->tm_mon
= cnt_longest
;
463 /* Match locale's date and time format. */
465 if (s
.decided
!= raw
)
467 if (!recursive (_NL_CURRENT (LC_TIME
, D_T_FMT
)))
469 if (s
.decided
== loc
)
476 if (s
.decided
== not &&
477 strcmp (_NL_CURRENT (LC_TIME
, D_T_FMT
), HERE_D_T_FMT
))
485 if (!recursive (HERE_D_T_FMT
))
490 /* Match century number. */
492 get_number (0, 99, 2);
498 /* Match day of month. */
499 get_number (1, 31, 2);
505 if (!recursive ("%Y-%m-%d"))
511 if (s
.decided
!= raw
)
513 if (!recursive (_NL_CURRENT (LC_TIME
, D_FMT
)))
515 if (s
.decided
== loc
)
523 && strcmp (_NL_CURRENT (LC_TIME
, D_FMT
), HERE_D_FMT
))
533 /* Match standard day format. */
534 if (!recursive (HERE_D_FMT
))
540 /* Match hour in 24-hour clock. */
541 get_number (0, 23, 2);
546 /* Match hour in 12-hour clock. GNU extension. */
548 /* Match hour in 12-hour clock. */
549 get_number (1, 12, 2);
550 tm
->tm_hour
= val
% 12;
554 /* Match day number of year. */
555 get_number (1, 366, 3);
556 tm
->tm_yday
= val
- 1;
560 /* Match number of month. */
561 get_number (1, 12, 2);
562 tm
->tm_mon
= val
- 1;
568 get_number (0, 59, 2);
573 /* Match any white space. */
574 while (ISSPACE (*rp
))
578 /* Match locale's equivalent of AM/PM. */
580 if (s
.decided
!= raw
)
582 if (match_string (_NL_CURRENT (LC_TIME
, AM_STR
), rp
))
584 if (strcmp (_NL_CURRENT (LC_TIME
, AM_STR
), HERE_AM_STR
))
589 if (match_string (_NL_CURRENT (LC_TIME
, PM_STR
), rp
))
591 if (strcmp (_NL_CURRENT (LC_TIME
, PM_STR
), HERE_PM_STR
))
599 if (!match_string (HERE_AM_STR
, rp
))
601 if (match_string (HERE_PM_STR
, rp
))
611 if (s
.decided
!= raw
)
613 if (!recursive (_NL_CURRENT (LC_TIME
, T_FMT_AMPM
)))
615 if (s
.decided
== loc
)
622 if (s
.decided
== not &&
623 strcmp (_NL_CURRENT (LC_TIME
, T_FMT_AMPM
),
631 if (!recursive (HERE_T_FMT_AMPM
))
635 if (!recursive ("%H:%M"))
640 /* The number of seconds may be very high so we cannot use
641 the `get_number' macro. Instead read the number
642 character for character and construct the result while
645 if (*rp
< '0' || *rp
> '9')
646 /* We need at least one digit. */
654 while (*rp
>= '0' && *rp
<= '9');
656 if (localtime_r (&secs
, tm
) == NULL
)
657 /* Error in function. */
662 get_number (0, 61, 2);
667 if (s
.decided
!= raw
)
669 if (!recursive (_NL_CURRENT (LC_TIME
, T_FMT
)))
671 if (s
.decided
== loc
)
678 if (strcmp (_NL_CURRENT (LC_TIME
, T_FMT
), HERE_T_FMT
))
687 if (!recursive (HERE_T_FMT
))
691 get_number (1, 7, 1);
692 tm
->tm_wday
= val
% 7;
696 get_number (0, 99, 2);
697 /* XXX This cannot determine any field in TM. */
700 if (*rp
< '0' || *rp
> '9')
702 /* XXX Ignore the number since we would need some more
703 information to compute a real date. */
706 while (*rp
>= '0' && *rp
<= '9');
709 get_number (0, 53, 2);
714 get_number (0, 53, 2);
719 get_number (0, 53, 2);
720 /* XXX This cannot determine any field in TM without some
724 /* Match number of weekday. */
725 get_number (0, 6, 1);
730 match_year_in_century
:
731 /* Match year within century. */
732 get_number (0, 99, 2);
733 /* The "Year 2000: The Millennium Rollover" paper suggests that
734 values in the range 69-99 refer to the twentieth century. */
735 tm
->tm_year
= val
>= 69 ? val
: val
+ 100;
736 /* Indicate that we want to use the century, if specified. */
741 /* Match year including century number. */
742 get_number (0, 9999, 4);
743 tm
->tm_year
= val
- 1900;
748 /* XXX How to handle this? */
751 /* We recognize two formats: if two digits are given, these
752 specify hours. If fours digits are used, minutes are
758 if (*rp
!= '+' && *rp
!= '-')
760 bool neg
= *rp
++ == '-';
762 while (n
< 4 && *rp
>= '0' && *rp
<= '9')
764 val
= val
* 10 + *rp
++ - '0';
770 /* Only two or four digits recognized. */
774 /* We have to convert the minutes into decimal. */
777 val
= (val
/ 100) * 100 + ((val
% 100) * 50) / 30;
781 tm
->tm_gmtoff
= (val
* 3600) / 100;
783 tm
->tm_gmtoff
= -tm
->tm_gmtoff
;
791 /* Match locale's alternate date and time format. */
792 if (s
.decided
!= raw
)
794 const char *fmt
= _NL_CURRENT (LC_TIME
, ERA_D_T_FMT
);
797 fmt
= _NL_CURRENT (LC_TIME
, D_T_FMT
);
799 if (!recursive (fmt
))
801 if (s
.decided
== loc
)
808 if (strcmp (fmt
, HERE_D_T_FMT
))
815 /* The C locale has no era information, so use the
816 normal representation. */
817 if (!recursive (HERE_D_T_FMT
))
822 if (s
.decided
!= raw
)
826 era
= _nl_select_era_entry (s
.era_cnt HELPER_LOCALE_ARG
);
827 if (era
!= NULL
&& match_string (era
->era_name
, rp
))
836 num_eras
= _NL_CURRENT_WORD (LC_TIME
,
837 _NL_TIME_ERA_NUM_ENTRIES
);
838 for (s
.era_cnt
= 0; s
.era_cnt
< (int) num_eras
;
839 ++s
.era_cnt
, rp
= rp_backup
)
841 era
= _nl_select_era_entry (s
.era_cnt
843 if (era
!= NULL
&& match_string (era
->era_name
, rp
))
849 if (s
.era_cnt
!= (int) num_eras
)
853 if (s
.decided
== loc
)
858 /* The C locale has no era information, so use the
859 normal representation. */
862 if (s
.decided
!= raw
)
864 get_number(0, 9999, 4);
872 assert (s
.decided
== loc
);
874 era
= _nl_select_era_entry (s
.era_cnt HELPER_LOCALE_ARG
);
878 int delta
= ((tm
->tm_year
- era
->offset
)
879 * era
->absolute_direction
);
881 && delta
< (((int64_t) era
->stop_date
[0]
882 - (int64_t) era
->start_date
[0])
883 * era
->absolute_direction
));
891 num_eras
= _NL_CURRENT_WORD (LC_TIME
,
892 _NL_TIME_ERA_NUM_ENTRIES
);
893 for (s
.era_cnt
= 0; s
.era_cnt
< (int) num_eras
; ++s
.era_cnt
)
895 era
= _nl_select_era_entry (s
.era_cnt
899 int delta
= ((tm
->tm_year
- era
->offset
)
900 * era
->absolute_direction
);
902 && delta
< (((int64_t) era
->stop_date
[0]
903 - (int64_t) era
->start_date
[0])
904 * era
->absolute_direction
))
911 if (s
.era_cnt
!= (int) num_eras
)
915 if (s
.decided
== loc
)
921 goto match_year_in_century
;
923 if (s
.decided
!= raw
)
925 num_eras
= _NL_CURRENT_WORD (LC_TIME
,
926 _NL_TIME_ERA_NUM_ENTRIES
);
927 for (s
.era_cnt
= 0; s
.era_cnt
< (int) num_eras
;
928 ++s
.era_cnt
, rp
= rp_backup
)
930 era
= _nl_select_era_entry (s
.era_cnt HELPER_LOCALE_ARG
);
931 if (era
!= NULL
&& recursive (era
->era_format
))
934 if (s
.era_cnt
== (int) num_eras
)
937 if (s
.decided
== loc
)
950 get_number (0, 9999, 4);
951 tm
->tm_year
= val
- 1900;
956 if (s
.decided
!= raw
)
958 const char *fmt
= _NL_CURRENT (LC_TIME
, ERA_D_FMT
);
961 fmt
= _NL_CURRENT (LC_TIME
, D_FMT
);
963 if (!recursive (fmt
))
965 if (s
.decided
== loc
)
972 if (strcmp (fmt
, HERE_D_FMT
))
978 if (!recursive (HERE_D_FMT
))
982 if (s
.decided
!= raw
)
984 const char *fmt
= _NL_CURRENT (LC_TIME
, ERA_T_FMT
);
987 fmt
= _NL_CURRENT (LC_TIME
, T_FMT
);
989 if (!recursive (fmt
))
991 if (s
.decided
== loc
)
998 if (strcmp (fmt
, HERE_T_FMT
))
1004 if (!recursive (HERE_T_FMT
))
1012 /* We have no information about the era format. Just use
1013 the normal format. */
1014 if (*fmt
!= 'c' && *fmt
!= 'C' && *fmt
!= 'y' && *fmt
!= 'Y'
1015 && *fmt
!= 'x' && *fmt
!= 'X')
1016 /* This is an illegal format. */
1026 /* Match day of month using alternate numeric symbols. */
1027 get_alt_number (1, 31, 2);
1033 /* Match hour in 24-hour clock using alternate numeric
1035 get_alt_number (0, 23, 2);
1040 /* Match hour in 12-hour clock using alternate numeric
1042 get_alt_number (1, 12, 2);
1043 tm
->tm_hour
= val
% 12;
1047 /* Match month using alternate numeric symbols. */
1048 get_alt_number (1, 12, 2);
1049 tm
->tm_mon
= val
- 1;
1054 /* Match minutes using alternate numeric symbols. */
1055 get_alt_number (0, 59, 2);
1059 /* Match seconds using alternate numeric symbols. */
1060 get_alt_number (0, 61, 2);
1064 get_alt_number (0, 53, 2);
1069 get_alt_number (0, 53, 2);
1074 get_alt_number (0, 53, 2);
1075 /* XXX This cannot determine any field in TM without
1076 further information. */
1079 /* Match number of weekday using alternate numeric symbols. */
1080 get_alt_number (0, 6, 1);
1085 /* Match year within century using alternate numeric symbols. */
1086 get_alt_number (0, 99, 2);
1087 tm
->tm_year
= val
>= 69 ? val
: val
+ 100;
1101 /* Recursive invocation, returning success, so
1102 update parent's struct tm and state. */
1103 *(struct __strptime_state
*) statep
= s
;
1108 if (s
.have_I
&& s
.is_pm
)
1111 if (s
.century
!= -1)
1114 tm
->tm_year
= tm
->tm_year
% 100 + (s
.century
- 19) * 100;
1116 /* Only the century, but not the year. Strange, but so be it. */
1117 tm
->tm_year
= (s
.century
- 19) * 100;
1120 if (s
.era_cnt
!= -1)
1122 era
= _nl_select_era_entry (s
.era_cnt HELPER_LOCALE_ARG
);
1126 tm
->tm_year
= (era
->start_date
[0]
1127 + ((tm
->tm_year
- era
->offset
)
1128 * era
->absolute_direction
));
1130 /* Era start year assumed. */
1131 tm
->tm_year
= era
->start_date
[0];
1136 /* No era found but we have seen an E modifier. Rectify some
1138 if (s
.want_century
&& s
.century
== -1 && tm
->tm_year
< 69)
1142 if (s
.want_xday
&& !s
.have_wday
)
1144 if ( !(s
.have_mon
&& s
.have_mday
) && s
.have_yday
)
1146 /* We don't have tm_mon and/or tm_mday, compute them. */
1148 while (__mon_yday
[__isleap(1900 + tm
->tm_year
)][t_mon
] <= tm
->tm_yday
)
1151 tm
->tm_mon
= t_mon
- 1;
1155 - __mon_yday
[__isleap(1900 + tm
->tm_year
)][t_mon
- 1] + 1);
1159 /* Don't crash in day_of_the_week if tm_mon is uninitialized. */
1160 if (s
.have_mon
|| (unsigned) tm
->tm_mon
<= 11)
1161 day_of_the_week (tm
);
1164 if (s
.want_xday
&& !s
.have_yday
&& (s
.have_mon
|| (unsigned) tm
->tm_mon
<= 11))
1165 day_of_the_year (tm
);
1167 if ((s
.have_uweek
|| s
.have_wweek
) && s
.have_wday
)
1169 int save_wday
= tm
->tm_wday
;
1170 int save_mday
= tm
->tm_mday
;
1171 int save_mon
= tm
->tm_mon
;
1172 int w_offset
= s
.have_uweek
? 0 : 1;
1176 day_of_the_week (tm
);
1178 tm
->tm_mday
= save_mday
;
1180 tm
->tm_mon
= save_mon
;
1183 tm
->tm_yday
= ((7 - (tm
->tm_wday
- w_offset
)) % 7
1184 + (s
.week_no
- 1) *7
1185 + save_wday
- w_offset
);
1187 if (!s
.have_mday
|| !s
.have_mon
)
1190 while (__mon_yday
[__isleap(1900 + tm
->tm_year
)][t_mon
]
1194 tm
->tm_mon
= t_mon
- 1;
1198 - __mon_yday
[__isleap(1900 + tm
->tm_year
)][t_mon
- 1] + 1);
1201 tm
->tm_wday
= save_wday
;
1209 strptime (buf
, format
, tm LOCALE_PARAM
)
1215 return __strptime_internal (buf
, format
, tm
, NULL LOCALE_ARG
);
1219 weak_alias (__strptime_l
, strptime_l
)