@@ -405,12 +405,6 @@ timelib_posix_str* timelib_parse_posix_str(const char *posix)
405
405
return tmp ;
406
406
}
407
407
408
- typedef struct _posix_transitions {
409
- size_t count ;
410
- timelib_sll times [6 ];
411
- timelib_sll types [6 ];
412
- } posix_transitions ;
413
-
414
408
static const int month_lengths [2 ][MONTHS_PER_YEAR ] = {
415
409
{ 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 }, // normal year
416
410
{ 31 , 29 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } // leap year
@@ -503,7 +497,7 @@ timelib_sll timelib_ts_at_start_of_year(timelib_sll year)
503
497
);
504
498
}
505
499
506
- static void calc_transitions_for_year (timelib_tzinfo * tz , timelib_sll year , posix_transitions * transitions )
500
+ void timelib_get_transitions_for_year (timelib_tzinfo * tz , timelib_sll year , timelib_posix_transitions * transitions )
507
501
{
508
502
timelib_sll trans_begin ; /* Since start of the year */
509
503
timelib_sll trans_end ;
@@ -536,9 +530,9 @@ static void calc_transitions_for_year(timelib_tzinfo *tz, timelib_sll year, posi
536
530
537
531
ttinfo * timelib_fetch_posix_timezone_offset (timelib_tzinfo * tz , timelib_sll ts , timelib_sll * transition_time )
538
532
{
539
- timelib_sll year ;
540
- timelib_time dummy ;
541
- posix_transitions transitions = { 0 };
533
+ timelib_sll year ;
534
+ timelib_time dummy ;
535
+ timelib_posix_transitions transitions = { 0 };
542
536
size_t i ;
543
537
544
538
/* If there is no second (dst_end) information, the UTC offset is valid for the whole year, so no need to
@@ -555,9 +549,9 @@ ttinfo* timelib_fetch_posix_timezone_offset(timelib_tzinfo *tz, timelib_sll ts,
555
549
year = dummy .y ;
556
550
557
551
/* Calculate transition times for 'year-1', 'year', and 'year+1' */
558
- calc_transitions_for_year (tz , year - 1 , & transitions );
559
- calc_transitions_for_year (tz , year , & transitions );
560
- calc_transitions_for_year (tz , year + 1 , & transitions );
552
+ timelib_get_transitions_for_year (tz , year - 1 , & transitions );
553
+ timelib_get_transitions_for_year (tz , year , & transitions );
554
+ timelib_get_transitions_for_year (tz , year + 1 , & transitions );
561
555
562
556
/* Check where the 'ts' falls in the 4 transitions */
563
557
for (i = 1 ; i < transitions .count ; i ++ ) {
0 commit comments