29#if TIMELIB_USE_BUILTIN_STRNDUP == 1
64static char *read_description_numeric_abbr(
char **
ptr)
71 while (**
ptr !=
'\0' && **
ptr !=
'>') {
92static char *read_description_abbr(
char **
ptr)
97 while ((**
ptr >=
'A' && **
ptr <=
'Z') || (**
ptr >=
'a' && **
ptr <=
'z')) {
110static char *read_description(
char **
ptr)
113 return read_description_numeric_abbr(
ptr);
115 return read_description_abbr(
ptr);
120static int read_sign(
char **
ptr)
126 }
else if (**
ptr ==
'-') {
141 while (**
ptr ==
'0') {
145 while (**
ptr >=
'0' && **
ptr <=
'9') {
147 acc += (**ptr) -
'0';
162 int bias = read_sign(
ptr);
170 hours = read_number(
ptr);
178 minutes = read_number(
ptr);
187 seconds = read_number(
ptr);
199 return -1 * bias * (hours * 3600 + minutes * 60 + seconds);
243 timelib_posix_trans_info_dtor(tmp);
253 tmp = read_trans_spec_mwd(
ptr);
258 tmp = timelib_posix_trans_info_ctor();
285 timelib_posix_trans_info_dtor(tmp);
295 tmp->
hour = 2 * 3600;
314 timelib_posix_trans_info_dtor(ps->
dst_begin);
317 timelib_posix_trans_info_dtor(ps->
dst_end);
326 char *
ptr = (
char*) posix;
329 tmp->
std = read_description(&
ptr);
351 tmp->
dst = read_description(&
ptr);
359 if (*
ptr !=
',' && *
ptr !=
'\0') {
409 { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
410 { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
423 if (leap_year && psi->
days >= 60) {
439 int i, d, m1, yy0, yy1, yy2, dow;
445 yy0 = (psi->
mwd.
month <= 2) ? (year - 1) : year;
448 dow = ((26 * m1 - 2) / 10 + 1 + yy2 + yy2 / 4 + yy1 / 4 - 2 * yy1) % 7;
459 for (i = 1; i < psi->
mwd.
week; ++i) {
468 for (i = 0; i < psi->
mwd.
month - 1; ++i) {
485 return (y/4) - (y/100) + (y/400);
490 timelib_sll epoch_leap_years = count_leap_years(1970);
491 timelib_sll current_leap_years = count_leap_years(year);
506 trans_begin = year_begin_ts;
511 trans_end = year_begin_ts;
516 if (trans_begin < trans_end) {
517 transitions->
times[transitions->
count ] = trans_begin;
518 transitions->
times[transitions->
count+1] = trans_end;
522 transitions->
times[transitions->
count+1] = trans_begin;
523 transitions->
times[transitions->
count ] = trans_end;
528 transitions->
count += 2;
541 if (transition_time) {
557 for (i = 1; i < transitions.
count; i++) {
558 if (ts < transitions.
times[i]) {
559 if (transition_time) {
560 *transition_time = transitions.
times[i - 1];
562 return &(tz->
type[transitions.
types[i - 1]]);
ttinfo * timelib_fetch_posix_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib_sll *transition_time)
void timelib_posix_str_dtor(timelib_posix_str *ps)
timelib_sll timelib_ts_at_start_of_year(timelib_sll year)
timelib_posix_str * timelib_parse_posix_str(const char *posix)
void timelib_get_transitions_for_year(timelib_tzinfo *tz, timelib_sll year, timelib_posix_transitions *transitions)
timelib_posix_trans_info * dst_begin
timelib_posix_trans_info * dst_end
struct _timelib_posix_trans_info::@345311100176353124100366323371063073143026264113::@040362207207357206375134264261113207025001271156 mwd
struct _timelib_tzinfo::@164363312306351063307143032200107146325273170202 bit64
timelib_posix_str * posix_info
#define TIMELIB_POSIX_TRANS_TYPE_JULIAN_NO_FEB29
void timelib_unixtime2gmt(timelib_time *tm, timelib_sll ts)
#define TIMELIB_POSIX_TRANS_TYPE_JULIAN_FEB29
#define TIMELIB_POSIX_TRANS_TYPE_MWD
struct _timelib_time timelib_time
struct _timelib_posix_str timelib_posix_str
struct _timelib_posix_trans_info timelib_posix_trans_info
signed long long timelib_sll
struct _timelib_tzinfo timelib_tzinfo
struct _timelib_posix_transitions timelib_posix_transitions
#define timelib_is_leap(y)