Update timelib to 2018.02

This commit is contained in:
Derick Rethans 2019-06-30 15:45:13 +01:00
parent 07cdf0109f
commit aae5907cb7
14 changed files with 46 additions and 69 deletions

View file

@ -1,7 +1,7 @@
The MIT License (MIT)
Copyright (c) 2015-2017 Derick Rethans
Copyright (c) 2017 MongoDB, Inc.
Copyright (c) 2015-2019 Derick Rethans
Copyright (c) 2017-2019 MongoDB, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -72,4 +72,3 @@
/* below the horizon. */
#define astronomical_twilight(ts,lon,lat,start,end) \
timelib_astro_rise_set_altitude( ts, lon, lat, -18.0, 0, start, end )

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,8 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
* Copyright (c) 2018 MongoDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,8 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
* Copyright (c) 2018 MongoDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -393,7 +394,7 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
tz->type[0].isgmtcnt
);
for (i = 0; i < tz->bit64.timecnt; i++) {
printf ("%016lX (%20ld) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n",
printf ("%016" PRIX64 " (%20" PRId64 ") = %3d [%5ld %1d %3d '%s' (%d,%d)]\n",
tz->trans[i], tz->trans[i], tz->trans_idx[i],
(long int) tz->type[tz->trans_idx[i]].offset,
tz->type[tz->trans_idx[i]].isdst,
@ -404,7 +405,7 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
);
}
for (i = 0; i < tz->bit64.leapcnt; i++) {
printf ("%016lX (%20ld) = %d\n",
printf ("%016" PRIX64 " (%20ld) = %d\n",
tz->leap_times[i].trans,
(long) tz->leap_times[i].trans,
tz->leap_times[i].offset);
@ -502,11 +503,6 @@ timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb, i
tmp = timelib_tzinfo_ctor(timezone);
version = read_preamble(&tzf, tmp, &type);
if (version == -1) {
*error_code = TIMELIB_ERROR_UNSUPPORTED_VERSION;
timelib_tzinfo_dtor(tmp);
return NULL;
}
if (version < 2 || version > 3) {
*error_code = TIMELIB_ERROR_UNSUPPORTED_VERSION;
timelib_tzinfo_dtor(tmp);
@ -521,6 +517,7 @@ timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb, i
if (!skip_64bit_preamble(&tzf, tmp)) {
/* 64 bit preamble is not in place */
*error_code = TIMELIB_ERROR_CORRUPT_NO_64BIT_PREAMBLE;
timelib_tzinfo_dtor(tmp);
return NULL;
}
read_64bit_header(&tzf, tmp);
@ -607,8 +604,8 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
/* If there is no transition time, we pick the first one, if that doesn't
* exist we return NULL */
if (!tz->bit64.timecnt || !tz->trans) {
*transition_time = 0;
if (tz->bit64.typecnt == 1) {
*transition_time = INT64_MIN;
return &(tz->type[0]);
}
return NULL;
@ -619,6 +616,7 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
* one in case there are only DST entries. Not sure which smartass came up
* with this idea in the first though :) */
if (ts < tz->trans[0]) {
*transition_time = INT64_MIN;
return &(tz->type[0]);
}

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2017 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,8 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
* Copyright (c) 2018 MongoDB, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -321,9 +322,9 @@ typedef struct _timelib_tzdb {
# define timelib_free free
#endif
#define TIMELIB_VERSION 201801
#define TIMELIB_EXTENDED_VERSION 20180105
#define TIMELIB_ASCII_VERSION "2018.01RC3"
#define TIMELIB_VERSION 201802
#define TIMELIB_EXTENDED_VERSION 20180201
#define TIMELIB_ASCII_VERSION "2018.02"
#define TIMELIB_NONE 0x00
#define TIMELIB_OVERRIDE_TIME 0x01
@ -649,7 +650,7 @@ void timelib_set_timezone_from_abbr(timelib_time *t, timelib_abbr_info abbr_info
* It fetches the right UTC offset that is currently stored in the time
* stamp field in 't' ('sse'), and assigns that to the 'z' field and 'dst'
* field (whether DST is in effect at the time). It also sets the current
* abbrevation to the 'tz_addr' field, making sure that if a value was already
* abbreviation to the 'tz_addr' field, making sure that if a value was already
* set it was freed.
*
* The time zone information in 'tz' is *not* duplicated into the 't' field so

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -39,13 +39,7 @@
# endif
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#include <string.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@ -68,10 +62,7 @@
#endif
#include <stdio.h>
#if HAVE_LIMITS_H
#include <limits.h>
#endif
#define TIMELIB_SECOND 1
#define TIMELIB_MINUTE 2

View file

@ -4,13 +4,7 @@
{ "acdt", 1, 37800, "Australia/North" },
{ "acdt", 1, 37800, "Australia/South" },
{ "acdt", 1, 37800, "Australia/Yancowinna" },
{ "acst", 0, 32400, "Australia/Adelaide" },
{ "acst", 0, 34200, "Australia/Adelaide" },
{ "acst", 0, 32400, "Australia/Broken_Hill" },
{ "acst", 0, 32400, "Australia/Darwin" },
{ "acst", 0, 32400, "Australia/North" },
{ "acst", 0, 32400, "Australia/South" },
{ "acst", 0, 32400, "Australia/Yancowinna" },
{ "acst", 0, 34200, "Australia/Broken_Hill" },
{ "acst", 0, 34200, "Australia/Darwin" },
{ "acst", 0, 34200, "Australia/North" },
@ -144,20 +138,16 @@
{ "bmt", 0, -14309, "America/Barbados" },
{ "bmt", 0, 6264, "Europe/Tiraspol" },
{ "bmt", 0, -17776, "America/Bogota" },
{ "bmt", 0, 1050, "Europe/Brussels" },
{ "bmt", 0, 10656, "Asia/Baghdad" },
{ "bmt", 0, 1786, "Europe/Busingen" },
{ "bmt", 0, 1786, "Europe/Vaduz" },
{ "bmt", 0, 1786, "Europe/Zurich" },
{ "bmt", 0, 24124, "Asia/Bangkok" },
{ "bmt", 0, 24124, "Asia/Phnom_Penh" },
{ "bmt", 0, 24124, "Asia/Vientiane" },
{ "bmt", 0, 25632, "Asia/Jakarta" },
{ "bmt", 0, 6264, "Europe/Bucharest" },
{ "bmt", 0, 6264, "Europe/Chisinau" },
{ "bost", 1, -12756, "America/La_Paz" },
{ "bst", 1, 3600, "Europe/London" },
{ "bst", 0, 3600, "Europe/London" },
{ "bst", 1, -12756, "America/La_Paz" },
{ "bst", 0, -39600, "America/Adak" },
{ "bst", 0, -39600, "America/Atka" },
{ "bst", 0, -39600, "America/Nome" },
@ -299,7 +289,6 @@
{ "cet", 0, 3600, "Europe/Berlin" },
{ "cet", 0, 7200, "Europe/Kaliningrad" },
{ "cet", 0, 3600, "Africa/Algiers" },
{ "cet", 0, 3600, "Africa/Casablanca" },
{ "cet", 0, 3600, "Africa/Ceuta" },
{ "cet", 0, 3600, "Africa/Tripoli" },
{ "cet", 0, 3600, "Africa/Tunis" },
@ -372,7 +361,6 @@
{ "cmt", 0, -16356, "America/La_Paz" },
{ "cmt", 0, -19176, "America/Cayman" },
{ "cmt", 0, -19176, "America/Panama" },
{ "cmt", 0, 3020, "Europe/Copenhagen" },
{ "cmt", 0, 6900, "Europe/Chisinau" },
{ "cmt", 0, 6900, "Europe/Tiraspol" },
{ "cpt", 1, -18000, "America/Chicago" },
@ -645,6 +633,8 @@
{ "ewt", 1, -14400, "Canada/Eastern" },
{ "ffmt", 0, -14660, "America/Martinique" },
{ "fmt", 0, -4056, "Atlantic/Madeira" },
{ "gdt", 1, 39600, "Pacific/Guam" },
{ "gdt", 1, 39600, "Pacific/Saipan" },
{ "gmt", 0, 0, "Africa/Abidjan" },
{ "gmt", 0, 0, "Africa/Accra" },
{ "gmt", 0, 0, "Africa/Bamako" },
@ -672,6 +662,9 @@
{ "gmt", 0, 0, "Europe/Jersey" },
{ "gmt", 0, 0, "Europe/London" },
{ "gmt", 0, 0, "GB" },
{ "gmt", 1, 0, "Europe/Bratislava" },
{ "gmt", 1, 0, "Europe/Dublin" },
{ "gmt", 1, 0, "Europe/Prague" },
{ "gst", 0, 36000, "Pacific/Guam" },
{ "gst", 0, 36000, "Pacific/Saipan" },
{ "hdt", 1, -34200, "Pacific/Honolulu" },
@ -680,20 +673,23 @@
{ "hdt", 1, -34200, "Pacific/Johnston" },
{ "hkst", 1, 32400, "Asia/Hong_Kong" },
{ "hkt", 0, 28800, "Asia/Hong_Kong" },
{ "hkt", 0, 30600, "Asia/Hong_Kong" },
{ "hmt", 0, -19776, "America/Havana" },
{ "hmt", 0, -6872, "Atlantic/Azores" },
{ "hmt", 0, 21200, "Asia/Calcutta" },
{ "hmt", 0, 21200, "Asia/Dacca" },
{ "hmt", 0, 21200, "Asia/Dhaka" },
{ "hmt", 0, 21200, "Asia/Kolkata" },
{ "hmt", 0, 5989, "Europe/Helsinki" },
{ "hmt", 0, 5989, "Europe/Mariehamn" },
{ "hpt", 1, -34200, "Pacific/Honolulu" },
{ "hpt", 1, -34200, "Pacific/Johnston" },
{ "hst", 0, -36000, "Pacific/Honolulu" },
{ "hst", 0, -37800, "Pacific/Honolulu" },
{ "hst", 0, -36000, "America/Adak" },
{ "hst", 0, -36000, "America/Atka" },
{ "hst", 0, -36000, "Pacific/Johnston" },
{ "hst", 0, -37800, "Pacific/Johnston" },
{ "hwt", 1, -34200, "Pacific/Honolulu" },
{ "hwt", 1, -34200, "Pacific/Johnston" },
{ "iddt", 1, 14400, "Asia/Jerusalem" },
{ "iddt", 1, 14400, "Asia/Tel_Aviv" },
{ "idt", 1, 10800, "Asia/Jerusalem" },
@ -703,7 +699,6 @@
{ "imt", 0, 25025, "Asia/Irkutsk" },
{ "imt", 0, 7016, "Asia/Istanbul" },
{ "imt", 0, 7016, "Europe/Istanbul" },
{ "imt", 0, 7016, "Europe/Sofia" },
{ "ist", 0, 7200, "Asia/Jerusalem" },
{ "ist", 0, 19800, "Asia/Calcutta" },
{ "ist", 0, 19800, "Asia/Kolkata" },
@ -718,6 +713,7 @@
{ "jmt", 0, 8440, "Asia/Tel_Aviv" },
{ "jst", 0, 32400, "Asia/Tokyo" },
{ "jst", 0, 32400, "Asia/Hong_Kong" },
{ "jst", 0, 32400, "Asia/Manila" },
{ "jst", 0, 32400, "Asia/Pyongyang" },
{ "jst", 0, 32400, "Asia/Seoul" },
{ "jst", 0, 32400, "Asia/Taipei" },
@ -728,8 +724,8 @@
{ "kdt", 1, 34200, "ROK" },
{ "kdt", 1, 36000, "ROK" },
{ "kmt", 0, 5736, "Europe/Vilnius" },
{ "kmt", 0, -18431, "America/Grand_Turk" },
{ "kmt", 0, -18431, "America/Jamaica" },
{ "kmt", 0, -18430, "America/Grand_Turk" },
{ "kmt", 0, -18430, "America/Jamaica" },
{ "kmt", 0, 7324, "Europe/Kiev" },
{ "kst", 0, 30600, "Asia/Seoul" },
{ "kst", 0, 32400, "Asia/Pyongyang" },
@ -766,7 +762,7 @@
{ "met", 0, 3600, "MET" },
{ "mmt", 0, 9017, "Europe/Moscow" },
{ "mmt", 0, 9079, "Europe/Moscow" },
{ "mmt", 0, -13484, "America/Montevideo" },
{ "mmt", 0, -13491, "America/Montevideo" },
{ "mmt", 0, -20712, "America/Managua" },
{ "mmt", 0, -2588, "Africa/Monrovia" },
{ "mmt", 0, -2670, "Africa/Monrovia" },
@ -928,18 +924,15 @@
{ "pdt", 1, -25200, "Canada/Pacific" },
{ "pdt", 1, -25200, "Canada/Yukon" },
{ "pdt", 1, -25200, "Mexico/BajaNorte" },
{ "pdt", 1, 32400, "Asia/Manila" },
{ "pkst", 1, 21600, "Asia/Karachi" },
{ "pkt", 0, 18000, "Asia/Karachi" },
{ "plmt", 0, 25590, "Asia/Ho_Chi_Minh" },
{ "plmt", 0, 25590, "Asia/Saigon" },
{ "pmmt", 0, 35312, "Pacific/Bougainville" },
{ "pmmt", 0, 35312, "Pacific/Port_Moresby" },
{ "pmt", 0, -13236, "America/Paramaribo" },
{ "pmt", 0, -13252, "America/Paramaribo" },
{ "pmt", 0, 13505, "Asia/Yekaterinburg" },
{ "pmt", 0, 26240, "Asia/Pontianak" },
{ "pmt", 0, 3464, "Europe/Bratislava" },
{ "pmt", 0, 3464, "Europe/Prague" },
{ "pmt", 0, 561, "Africa/Algiers" },
{ "pmt", 0, 561, "Africa/Tunis" },
{ "pmt", 0, 561, "Europe/Monaco" },
@ -979,6 +972,7 @@
{ "pst", 0, -28800, "Canada/Yukon" },
{ "pst", 0, -28800, "Mexico/BajaNorte" },
{ "pst", 0, -28800, "Mexico/BajaSur" },
{ "pst", 0, 28800, "Asia/Manila" },
{ "pwt", 1, -25200, "America/Los_Angeles" },
{ "pwt", 1, -25200, "America/Dawson_Creek" },
{ "pwt", 1, -25200, "America/Ensenada" },
@ -995,9 +989,6 @@
{ "rmt", 0, 5794, "Europe/Riga" },
{ "rmt", 0, 23087, "Asia/Rangoon" },
{ "rmt", 0, 23087, "Asia/Yangon" },
{ "rmt", 0, 2996, "Europe/Rome" },
{ "rmt", 0, 2996, "Europe/San_Marino" },
{ "rmt", 0, 2996, "Europe/Vatican" },
{ "sast", 0, 7200, "Africa/Johannesburg" },
{ "sast", 1, 10800, "Africa/Johannesburg" },
{ "sast", 0, 5400, "Africa/Johannesburg" },
@ -1010,7 +1001,6 @@
{ "sast", 0, 7200, "Africa/Mbabane" },
{ "sast", 0, 7200, "Africa/Windhoek" },
{ "sdmt", 0, -16800, "America/Santo_Domingo" },
{ "set", 0, 3614, "Europe/Stockholm" },
{ "sjmt", 0, -20173, "America/Costa_Rica" },
{ "smt", 0, -13884, "Atlantic/Stanley" },
{ "smt", 0, -16966, "America/Punta_Arenas" },
@ -1044,7 +1034,8 @@
{ "wat", 0, 3600, "Africa/Ndjamena" },
{ "wat", 0, 3600, "Africa/Niamey" },
{ "wat", 0, 3600, "Africa/Porto-Novo" },
{ "wat", 0, 3600, "Africa/Windhoek" },
{ "wat", 0, 3600, "Africa/Sao_Tome" },
{ "wat", 1, 3600, "Africa/Windhoek" },
{ "wemt", 1, 7200, "Europe/Lisbon" },
{ "wemt", 1, 7200, "Europe/Madrid" },
{ "wemt", 1, 7200, "Europe/Monaco" },
@ -1052,9 +1043,7 @@
{ "west", 1, 3600, "Europe/Paris" },
{ "west", 1, 7200, "Europe/Luxembourg" },
{ "west", 1, 3600, "Africa/Algiers" },
{ "west", 1, 3600, "Africa/Casablanca" },
{ "west", 1, 3600, "Africa/Ceuta" },
{ "west", 1, 3600, "Africa/El_Aaiun" },
{ "west", 1, 3600, "Atlantic/Canary" },
{ "west", 1, 3600, "Atlantic/Faeroe" },
{ "west", 1, 3600, "Atlantic/Faroe" },
@ -1067,9 +1056,7 @@
{ "wet", 0, 0, "Europe/Paris" },
{ "wet", 0, 3600, "Europe/Luxembourg" },
{ "wet", 0, 0, "Africa/Algiers" },
{ "wet", 0, 0, "Africa/Casablanca" },
{ "wet", 0, 0, "Africa/Ceuta" },
{ "wet", 0, 0, "Africa/El_Aaiun" },
{ "wet", 0, 0, "Atlantic/Azores" },
{ "wet", 0, 0, "Atlantic/Canary" },
{ "wet", 0, 0, "Atlantic/Faeroe" },

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Derick Rethans
* Copyright (c) 2015-2019 Derick Rethans
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal