--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2015 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
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+++ /dev/null
-Regenerating Parser
-===================
-
-Make sure you use re2c 0.9.10 or higher:
-
-re2c -d -b -o ext/date/lib/parse_date.c ext/date/lib/parse_date.re
-re2c -d -b -o ext/date/lib/parse_iso_intervals.c ext/date/lib/parse_iso_intervals.re
--- /dev/null
+timelib
+=======
+
+Timelib is a timezone and date/time library that can calculate local time,
+convert between timezones and parse textual descriptions of date/time
+information.
+
+It is the library supporting PHP's Date/Time extension.
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+/*
| Algorithms are taken from a public domain source by Paul |
| Schlyter, who wrote this in December 1992 |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
*/
-/* $Id$ */
-
#include <stdio.h>
#include <math.h>
#include "timelib.h"
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
/* This macro computes the length of the day, from sunrise to sunset. */
/* Sunrise/set is considered to occur when the Sun's upper limb is */
/* 35 arc minutes below the horizon (this accounts for the refraction */
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
-/* $Id$ */
-
#include "timelib.h"
static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
-/* $Id$ */
-
#include "timelib.h"
#include <math.h>
-/* Generated by re2c 0.13.5 on Tue Mar 31 16:32:03 2015 */
+/* Generated by re2c 0.13.5 on Tue Sep 22 08:27:53 2015 */
#line 1 "ext/date/lib/parse_date.re"
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
/* $Id$ */
return timelib_lookup_relative_text(ptr, behavior);
}
-static long timelib_lookup_month(char **ptr)
+static timelib_long timelib_lookup_month(char **ptr)
{
char *word;
char *begin = *ptr, *end;
- long value = 0;
+ timelib_long value = 0;
const timelib_lookup_table *tp;
while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
return value;
}
-static long timelib_get_month(char **ptr)
+static timelib_long timelib_get_month(char **ptr)
{
while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
++*ptr;
}
}
-const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffset, int isdst)
+const static timelib_tz_lookup_table* abbr_search(const char *word, timelib_long gmtoffset, int isdst)
{
int first_found = 0;
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) {
return timelib_timezone_utc;
}
-
+
for (tp = timelib_timezone_lookup; tp->name; tp++) {
if (strcasecmp(word, tp->name) == 0) {
if (!first_found) {
return NULL;
}
-static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
+static timelib_long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
{
char *word;
char *begin = *ptr, *end;
- long value = 0;
+ timelib_long value = 0;
const timelib_tz_lookup_table *tp;
while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
return value;
}
-long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
+timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
{
timelib_tzinfo *res;
- long retval = 0;
+ timelib_long retval = 0;
*tz_not_found = 0;
retval = timelib_parse_tz_cor(ptr);
} else {
int found = 0;
- long offset = 0;
+ timelib_long offset = 0;
char *tz_abbr;
t->is_localtime = 1;
{
uchar *cursor = s->cur;
char *str, *ptr = NULL;
-
+
std:
s->tok = cursor;
s->len = 0;
-#line 940 "ext/date/lib/parse_date.re"
+#line 946 "ext/date/lib/parse_date.re"
-#line 822 "ext/date/lib/parse_date.c"
+#line 828 "ext/date/lib/parse_date.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
}
yy3:
YYDEBUG(3, *YYCURSOR);
-#line 1620 "ext/date/lib/parse_date.re"
+#line 1626 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
-#line 975 "ext/date/lib/parse_date.c"
+#line 981 "ext/date/lib/parse_date.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '9') goto yy1385;
yy12:
YYDEBUG(12, *YYCURSOR);
-#line 1715 "ext/date/lib/parse_date.re"
+#line 1721 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
}
-#line 1291 "ext/date/lib/parse_date.c"
+#line 1297 "ext/date/lib/parse_date.c"
yy13:
YYDEBUG(13, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '9') goto yy54;
yy49:
YYDEBUG(49, *YYCURSOR);
-#line 1704 "ext/date/lib/parse_date.re"
+#line 1710 "ext/date/lib/parse_date.re"
{
goto std;
}
-#line 2352 "ext/date/lib/parse_date.c"
+#line 2358 "ext/date/lib/parse_date.c"
yy50:
YYDEBUG(50, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(51, *YYCURSOR);
++YYCURSOR;
YYDEBUG(52, *YYCURSOR);
-#line 1709 "ext/date/lib/parse_date.re"
+#line 1715 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
}
-#line 2366 "ext/date/lib/parse_date.c"
+#line 2372 "ext/date/lib/parse_date.c"
yy53:
YYDEBUG(53, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 's') goto yy73;
yy72:
YYDEBUG(72, *YYCURSOR);
-#line 1688 "ext/date/lib/parse_date.re"
+#line 1694 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 2768 "ext/date/lib/parse_date.c"
+#line 2774 "ext/date/lib/parse_date.c"
yy73:
YYDEBUG(73, *YYCURSOR);
yych = *++YYCURSOR;
}
yy166:
YYDEBUG(166, *YYCURSOR);
-#line 1551 "ext/date/lib/parse_date.re"
+#line 1557 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
if (s->time->relative.weekday_behavior != 2) {
s->time->relative.weekday_behavior = 1;
}
-
+
TIMELIB_DEINIT;
return TIMELIB_WEEKDAY;
}
-#line 3547 "ext/date/lib/parse_date.c"
+#line 3553 "ext/date/lib/parse_date.c"
yy167:
YYDEBUG(167, *YYCURSOR);
yych = *++YYCURSOR;
}
yy193:
YYDEBUG(193, *YYCURSOR);
-#line 1610 "ext/date/lib/parse_date.re"
+#line 1616 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
-#line 4076 "ext/date/lib/parse_date.c"
+#line 4082 "ext/date/lib/parse_date.c"
yy194:
YYDEBUG(194, *YYCURSOR);
++YYCURSOR;
}
yy198:
YYDEBUG(198, *YYCURSOR);
-#line 1356 "ext/date/lib/parse_date.re"
+#line 1362 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
-#line 4140 "ext/date/lib/parse_date.c"
+#line 4146 "ext/date/lib/parse_date.c"
yy199:
YYDEBUG(199, *YYCURSOR);
yyaccept = 6;
}
yy222:
YYDEBUG(222, *YYCURSOR);
-#line 1658 "ext/date/lib/parse_date.re"
+#line 1664 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
-#line 4438 "ext/date/lib/parse_date.c"
+#line 4444 "ext/date/lib/parse_date.c"
yy223:
YYDEBUG(223, *YYCURSOR);
yyaccept = 7;
YYDEBUG(277, *YYCURSOR);
++YYCURSOR;
YYDEBUG(278, *YYCURSOR);
-#line 1634 "ext/date/lib/parse_date.re"
+#line 1640 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
-#line 5159 "ext/date/lib/parse_date.c"
+#line 5165 "ext/date/lib/parse_date.c"
yy279:
YYDEBUG(279, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
yy294:
YYDEBUG(294, *YYCURSOR);
-#line 1328 "ext/date/lib/parse_date.re"
+#line 1334 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenoday");
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
-#line 5350 "ext/date/lib/parse_date.c"
+#line 5356 "ext/date/lib/parse_date.c"
yy295:
YYDEBUG(295, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '9') goto yy364;
yy363:
YYDEBUG(363, *YYCURSOR);
-#line 1472 "ext/date/lib/parse_date.re"
+#line 1478 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
-#line 6583 "ext/date/lib/parse_date.c"
+#line 6589 "ext/date/lib/parse_date.c"
yy364:
YYDEBUG(364, *YYCURSOR);
yych = *++YYCURSOR;
}
yy392:
YYDEBUG(392, *YYCURSOR);
-#line 1530 "ext/date/lib/parse_date.re"
+#line 1536 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
-#line 7241 "ext/date/lib/parse_date.c"
+#line 7247 "ext/date/lib/parse_date.c"
yy393:
YYDEBUG(393, *YYCURSOR);
yyaccept = 5;
++YYCURSOR;
yy454:
YYDEBUG(454, *YYCURSOR);
-#line 1233 "ext/date/lib/parse_date.re"
+#line 1239 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-#line 9002 "ext/date/lib/parse_date.c"
+#line 9008 "ext/date/lib/parse_date.c"
yy455:
YYDEBUG(455, *YYCURSOR);
yyaccept = 0;
}
yy475:
YYDEBUG(475, *YYCURSOR);
-#line 1370 "ext/date/lib/parse_date.re"
+#line 1376 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
-#line 9573 "ext/date/lib/parse_date.c"
+#line 9579 "ext/date/lib/parse_date.c"
yy476:
YYDEBUG(476, *YYCURSOR);
yyaccept = 10;
YYDEBUG(487, *YYCURSOR);
++YYCURSOR;
YYDEBUG(488, *YYCURSOR);
-#line 1088 "ext/date/lib/parse_date.re"
+#line 1094 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
-#line 9730 "ext/date/lib/parse_date.c"
+#line 9736 "ext/date/lib/parse_date.c"
yy489:
YYDEBUG(489, *YYCURSOR);
yyaccept = 11;
}
yy490:
YYDEBUG(490, *YYCURSOR);
-#line 1125 "ext/date/lib/parse_date.re"
+#line 1131 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
-#line 9768 "ext/date/lib/parse_date.c"
+#line 9774 "ext/date/lib/parse_date.c"
yy491:
YYDEBUG(491, *YYCURSOR);
yyaccept = 11;
YYDEBUG(522, *YYCURSOR);
++YYCURSOR;
YYDEBUG(523, *YYCURSOR);
-#line 1105 "ext/date/lib/parse_date.re"
+#line 1111 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
-#line 10097 "ext/date/lib/parse_date.c"
+#line 10103 "ext/date/lib/parse_date.c"
yy524:
YYDEBUG(524, *YYCURSOR);
yyaccept = 11;
if (yych <= '9') goto yy540;
yy534:
YYDEBUG(534, *YYCURSOR);
-#line 1287 "ext/date/lib/parse_date.re"
+#line 1293 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datefull");
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
-#line 10217 "ext/date/lib/parse_date.c"
+#line 10223 "ext/date/lib/parse_date.c"
yy535:
YYDEBUG(535, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(605, *YYCURSOR);
++YYCURSOR;
YYDEBUG(606, *YYCURSOR);
-#line 1302 "ext/date/lib/parse_date.re"
+#line 1308 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
-#line 10965 "ext/date/lib/parse_date.c"
+#line 10971 "ext/date/lib/parse_date.c"
yy607:
YYDEBUG(607, *YYCURSOR);
yyaccept = 11;
if (yych <= '9') goto yy604;
yy611:
YYDEBUG(611, *YYCURSOR);
-#line 1314 "ext/date/lib/parse_date.re"
+#line 1320 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
-#line 11014 "ext/date/lib/parse_date.c"
+#line 11020 "ext/date/lib/parse_date.c"
yy612:
YYDEBUG(612, *YYCURSOR);
yyaccept = 11;
}
yy656:
YYDEBUG(656, *YYCURSOR);
-#line 1273 "ext/date/lib/parse_date.re"
+#line 1279 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-#line 11668 "ext/date/lib/parse_date.c"
+#line 11674 "ext/date/lib/parse_date.c"
yy657:
YYDEBUG(657, *YYCURSOR);
yyaccept = 13;
}
yy666:
YYDEBUG(666, *YYCURSOR);
-#line 1217 "ext/date/lib/parse_date.re"
+#line 1223 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
-#line 11789 "ext/date/lib/parse_date.c"
+#line 11795 "ext/date/lib/parse_date.c"
yy667:
YYDEBUG(667, *YYCURSOR);
yyaccept = 14;
if (yych <= ':') goto yy703;
yy700:
YYDEBUG(700, *YYCURSOR);
-#line 1500 "ext/date/lib/parse_date.re"
+#line 1506 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
-#line 12042 "ext/date/lib/parse_date.c"
+#line 12048 "ext/date/lib/parse_date.c"
yy701:
YYDEBUG(701, *YYCURSOR);
yych = *++YYCURSOR;
}
yy763:
YYDEBUG(763, *YYCURSOR);
-#line 1245 "ext/date/lib/parse_date.re"
+#line 1251 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-#line 12607 "ext/date/lib/parse_date.c"
+#line 12613 "ext/date/lib/parse_date.c"
yy764:
YYDEBUG(764, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(770, *YYCURSOR);
++YYCURSOR;
YYDEBUG(771, *YYCURSOR);
-#line 1486 "ext/date/lib/parse_date.re"
+#line 1492 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
-#line 12659 "ext/date/lib/parse_date.c"
+#line 12665 "ext/date/lib/parse_date.c"
yy772:
YYDEBUG(772, *YYCURSOR);
yych = *++YYCURSOR;
}
yy783:
YYDEBUG(783, *YYCURSOR);
-#line 1521 "ext/date/lib/parse_date.re"
+#line 1527 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
-#line 12805 "ext/date/lib/parse_date.c"
+#line 12811 "ext/date/lib/parse_date.c"
yy784:
YYDEBUG(784, *YYCURSOR);
yych = *++YYCURSOR;
}
yy793:
YYDEBUG(793, *YYCURSOR);
-#line 1342 "ext/date/lib/parse_date.re"
+#line 1348 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
-#line 12969 "ext/date/lib/parse_date.c"
+#line 12975 "ext/date/lib/parse_date.c"
yy794:
YYDEBUG(794, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '7') goto yy816;
yy814:
YYDEBUG(814, *YYCURSOR);
-#line 1453 "ext/date/lib/parse_date.re"
+#line 1459 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
TIMELIB_HAVE_RELATIVE();
-
+
s->time->y = timelib_get_nr((char **) &ptr, 4);
w = timelib_get_nr((char **) &ptr, 2);
d = 1;
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
-#line 13202 "ext/date/lib/parse_date.c"
+#line 13208 "ext/date/lib/parse_date.c"
yy815:
YYDEBUG(815, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(816, *YYCURSOR);
++YYCURSOR;
YYDEBUG(817, *YYCURSOR);
-#line 1434 "ext/date/lib/parse_date.re"
+#line 1440 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
TIMELIB_HAVE_RELATIVE();
-
+
s->time->y = timelib_get_nr((char **) &ptr, 4);
w = timelib_get_nr((char **) &ptr, 2);
d = timelib_get_nr((char **) &ptr, 1);
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
-#line 13230 "ext/date/lib/parse_date.c"
+#line 13236 "ext/date/lib/parse_date.c"
yy818:
YYDEBUG(818, *YYCURSOR);
yych = *++YYCURSOR;
}
yy821:
YYDEBUG(821, *YYCURSOR);
-#line 1420 "ext/date/lib/parse_date.re"
+#line 1426 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
-#line 13307 "ext/date/lib/parse_date.c"
+#line 13313 "ext/date/lib/parse_date.c"
yy822:
YYDEBUG(822, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
yy842:
YYDEBUG(842, *YYCURSOR);
-#line 1394 "ext/date/lib/parse_date.re"
+#line 1400 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
-#line 13435 "ext/date/lib/parse_date.c"
+#line 13441 "ext/date/lib/parse_date.c"
yy843:
YYDEBUG(843, *YYCURSOR);
yych = *++YYCURSOR;
}
yy848:
YYDEBUG(848, *YYCURSOR);
-#line 1382 "ext/date/lib/parse_date.re"
+#line 1388 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
-#line 13708 "ext/date/lib/parse_date.c"
+#line 13714 "ext/date/lib/parse_date.c"
yy849:
YYDEBUG(849, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '9') goto yy995;
yy973:
YYDEBUG(973, *YYCURSOR);
-#line 1259 "ext/date/lib/parse_date.re"
+#line 1265 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-#line 14641 "ext/date/lib/parse_date.c"
+#line 14647 "ext/date/lib/parse_date.c"
yy974:
YYDEBUG(974, *YYCURSOR);
yyaccept = 22;
}
yy1067:
YYDEBUG(1067, *YYCURSOR);
-#line 1151 "ext/date/lib/parse_date.re"
+#line 1157 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
-#line 15672 "ext/date/lib/parse_date.c"
+#line 15678 "ext/date/lib/parse_date.c"
yy1068:
YYDEBUG(1068, *YYCURSOR);
yych = *++YYCURSOR;
}
yy1075:
YYDEBUG(1075, *YYCURSOR);
-#line 1197 "ext/date/lib/parse_date.re"
+#line 1203 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
-#line 15783 "ext/date/lib/parse_date.c"
+#line 15789 "ext/date/lib/parse_date.c"
yy1076:
YYDEBUG(1076, *YYCURSOR);
yyaccept = 25;
}
yy1117:
YYDEBUG(1117, *YYCURSOR);
-#line 1593 "ext/date/lib/parse_date.re"
+#line 1599 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 16697 "ext/date/lib/parse_date.c"
+#line 16703 "ext/date/lib/parse_date.c"
yy1118:
YYDEBUG(1118, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1125, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1126, *YYCURSOR);
-#line 1066 "ext/date/lib/parse_date.re"
+#line 1072 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
TIMELIB_DEINIT;
return TIMELIB_WEEK_DAY_OF_MONTH;
}
-#line 16769 "ext/date/lib/parse_date.c"
+#line 16775 "ext/date/lib/parse_date.c"
yy1127:
YYDEBUG(1127, *YYCURSOR);
yyaccept = 26;
}
yy1141:
YYDEBUG(1141, *YYCURSOR);
-#line 1569 "ext/date/lib/parse_date.re"
+#line 1575 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 16900 "ext/date/lib/parse_date.c"
+#line 16906 "ext/date/lib/parse_date.c"
yy1142:
YYDEBUG(1142, *YYCURSOR);
yych = *++YYCURSOR;
goto yy1297;
yy1294:
YYDEBUG(1294, *YYCURSOR);
-#line 1043 "ext/date/lib/parse_date.re"
+#line 1049 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
-#line 19599 "ext/date/lib/parse_date.c"
+#line 19605 "ext/date/lib/parse_date.c"
yy1295:
YYDEBUG(1295, *YYCURSOR);
yyaccept = 28;
YYDEBUG(1315, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1316, *YYCURSOR);
-#line 1026 "ext/date/lib/parse_date.re"
+#line 1032 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
-#line 19876 "ext/date/lib/parse_date.c"
+#line 19882 "ext/date/lib/parse_date.c"
yy1317:
YYDEBUG(1317, *YYCURSOR);
yyaccept = 0;
if (yych <= '9') goto yy1385;
yy1387:
YYDEBUG(1387, *YYCURSOR);
-#line 1000 "ext/date/lib/parse_date.re"
+#line 1006 "ext/date/lib/parse_date.re"
{
timelib_ull i;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 21332 "ext/date/lib/parse_date.c"
+#line 21338 "ext/date/lib/parse_date.c"
yy1388:
YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
yy1417:
YYDEBUG(1417, *YYCURSOR);
-#line 988 "ext/date/lib/parse_date.re"
+#line 994 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("tomorrow");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 21779 "ext/date/lib/parse_date.c"
+#line 21785 "ext/date/lib/parse_date.c"
yy1418:
YYDEBUG(1418, *YYCURSOR);
yych = *++YYCURSOR;
}
yy1420:
YYDEBUG(1420, *YYCURSOR);
-#line 978 "ext/date/lib/parse_date.re"
+#line 984 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("midnight | today");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 21823 "ext/date/lib/parse_date.c"
+#line 21829 "ext/date/lib/parse_date.c"
yy1421:
YYDEBUG(1421, *YYCURSOR);
yych = *++YYCURSOR;
}
yy1500:
YYDEBUG(1500, *YYCURSOR);
-#line 957 "ext/date/lib/parse_date.re"
+#line 963 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("now");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 23843 "ext/date/lib/parse_date.c"
+#line 23849 "ext/date/lib/parse_date.c"
yy1501:
YYDEBUG(1501, *YYCURSOR);
yych = *++YYCURSOR;
}
yy1508:
YYDEBUG(1508, *YYCURSOR);
-#line 966 "ext/date/lib/parse_date.re"
+#line 972 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("noon");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 23993 "ext/date/lib/parse_date.c"
+#line 23999 "ext/date/lib/parse_date.c"
yy1509:
YYDEBUG(1509, *YYCURSOR);
yyaccept = 0;
++YYCURSOR;
yy1531:
YYDEBUG(1531, *YYCURSOR);
-#line 945 "ext/date/lib/parse_date.re"
+#line 951 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("yesterday");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 24537 "ext/date/lib/parse_date.c"
+#line 24543 "ext/date/lib/parse_date.c"
yy1532:
YYDEBUG(1532, *YYCURSOR);
yyaccept = 0;
goto yy1531;
}
}
-#line 1719 "ext/date/lib/parse_date.re"
+#line 1725 "ext/date/lib/parse_date.re"
}
#define YYMAXFILL 31
-timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
+timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
{
Scanner in;
int t;
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
}
-timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
+timelib_time *timelib_parse_from_format(char *format, char *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
{
char *fptr = format;
char *ptr = string;
add_pbf_error(s, "A textual day could not be found", string, begin);
break;
} else {
- in.time->have_relative = 1;
+ in.time->have_relative = 1;
in.time->relative.have_weekday_relative = 1;
in.time->relative.weekday = tmprel->multiplier;
in.time->relative.weekday_behavior = 1;
/* do funky checking whether the parsed time was valid time */
if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
- s->time->s != TIMELIB_UNSET &&
+ s->time->s != TIMELIB_UNSET &&
!timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
add_pbf_warning(s, "The parsed time was invalid", string, ptr);
}
/* do funky checking whether the parsed date was valid date */
if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
- s->time->d != TIMELIB_UNSET &&
+ s->time->d != TIMELIB_UNSET &&
!timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
add_pbf_warning(s, "The parsed date was invalid", string, ptr);
}
*/
}
-char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
+char *timelib_timezone_id_from_abbr(const char *abbr, timelib_long gmtoffset, int isdst)
{
const timelib_tz_lookup_table *tp;
printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d",
time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
if (time.have_relative) {
- printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
+ printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s);
}
if (time.have_weekday_relative) {
if (time.have_weeknr_day) {
printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);
}
- return 0;
+ return 0;
}
#endif
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
/* $Id$ */
return timelib_lookup_relative_text(ptr, behavior);
}
-static long timelib_lookup_month(char **ptr)
+static timelib_long timelib_lookup_month(char **ptr)
{
char *word;
char *begin = *ptr, *end;
- long value = 0;
+ timelib_long value = 0;
const timelib_lookup_table *tp;
while ((**ptr >= 'A' && **ptr <= 'Z') || (**ptr >= 'a' && **ptr <= 'z')) {
return value;
}
-static long timelib_get_month(char **ptr)
+static timelib_long timelib_get_month(char **ptr)
{
while (**ptr == ' ' || **ptr == '\t' || **ptr == '-' || **ptr == '.' || **ptr == '/') {
++*ptr;
}
}
-const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffset, int isdst)
+const static timelib_tz_lookup_table* abbr_search(const char *word, timelib_long gmtoffset, int isdst)
{
int first_found = 0;
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
return NULL;
}
-static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
+static timelib_long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
{
char *word;
char *begin = *ptr, *end;
- long value = 0;
+ timelib_long value = 0;
const timelib_tz_lookup_table *tp;
while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
return value;
}
-long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
+timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
{
timelib_tzinfo *res;
- long retval = 0;
+ timelib_long retval = 0;
*tz_not_found = 0;
retval = timelib_parse_tz_cor(ptr);
} else {
int found = 0;
- long offset = 0;
+ timelib_long offset = 0;
char *tz_abbr;
t->is_localtime = 1;
gnunocolon = 't'? hour24lz minutelz;
/* gnunocolontz = hour24lz minutelz space? (tzcorrection | tz); */
-iso8601nocolon = 't'? hour24lz minutelz secondlz;
+iso8601nocolon = 't'? hour24lz minutelz secondlz;
/* iso8601nocolontz = hour24lz minutelz secondlz space? (tzcorrection | tz); */
/* Date formats */
/*!max:re2c */
-timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
+timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
{
Scanner in;
int t;
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
}
-timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
+timelib_time *timelib_parse_from_format(char *format, char *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
{
char *fptr = format;
char *ptr = string;
*/
}
-char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
+char *timelib_timezone_id_from_abbr(const char *abbr, timelib_long gmtoffset, int isdst)
{
const timelib_tz_lookup_table *tp;
-/* Generated by re2c 0.13.5 on Wed Nov 27 11:14:23 2013 */
+/* Generated by re2c 0.13.5 on Tue Sep 22 08:27:59 2015 */
#line 1 "ext/date/lib/parse_iso_intervals.re"
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
/* $Id$ */
}
}
-static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
+static timelib_long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
{
- long retval = 0;
+ timelib_long retval = 0;
*tz_not_found = 0;
{
uchar *cursor = s->cur;
char *str, *ptr = NULL;
-
+
std:
s->tok = cursor;
s->len = 0;
-#line 276 "ext/date/lib/parse_iso_intervals.re"
+#line 282 "ext/date/lib/parse_iso_intervals.re"
-#line 256 "ext/date/lib/parse_iso_intervals.c"
+#line 262 "ext/date/lib/parse_iso_intervals.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if (yych <= '9') goto yy98;
yy3:
YYDEBUG(3, *YYCURSOR);
-#line 389 "ext/date/lib/parse_iso_intervals.re"
+#line 395 "ext/date/lib/parse_iso_intervals.re"
{
add_error(s, "Unexpected character");
goto std;
}
-#line 331 "ext/date/lib/parse_iso_intervals.c"
+#line 337 "ext/date/lib/parse_iso_intervals.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yyaccept = 0;
if (yych == 'T') goto yy14;
yy6:
YYDEBUG(6, *YYCURSOR);
-#line 316 "ext/date/lib/parse_iso_intervals.re"
+#line 322 "ext/date/lib/parse_iso_intervals.re"
{
timelib_sll nr;
int in_time = 0;
case 'D': s->period->d = nr; break;
case 'H': s->period->h = nr; break;
case 'S': s->period->s = nr; break;
- case 'M':
+ case 'M':
if (in_time) {
s->period->i = nr;
} else {
- s->period->m = nr;
+ s->period->m = nr;
}
break;
default:
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
}
-#line 389 "ext/date/lib/parse_iso_intervals.c"
+#line 395 "ext/date/lib/parse_iso_intervals.c"
yy7:
YYDEBUG(7, *YYCURSOR);
++YYCURSOR;
YYDEBUG(8, *YYCURSOR);
-#line 378 "ext/date/lib/parse_iso_intervals.re"
+#line 384 "ext/date/lib/parse_iso_intervals.re"
{
goto std;
}
-#line 398 "ext/date/lib/parse_iso_intervals.c"
+#line 404 "ext/date/lib/parse_iso_intervals.c"
yy9:
YYDEBUG(9, *YYCURSOR);
++YYCURSOR;
YYDEBUG(10, *YYCURSOR);
-#line 383 "ext/date/lib/parse_iso_intervals.re"
+#line 389 "ext/date/lib/parse_iso_intervals.re"
{
s->pos = cursor; s->line++;
goto std;
}
-#line 408 "ext/date/lib/parse_iso_intervals.c"
+#line 414 "ext/date/lib/parse_iso_intervals.c"
yy11:
YYDEBUG(11, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(57, *YYCURSOR);
++YYCURSOR;
YYDEBUG(58, *YYCURSOR);
-#line 358 "ext/date/lib/parse_iso_intervals.re"
+#line 364 "ext/date/lib/parse_iso_intervals.re"
{
DEBUG_OUTPUT("combinedrep");
TIMELIB_INIT;
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
}
-#line 757 "ext/date/lib/parse_iso_intervals.c"
+#line 763 "ext/date/lib/parse_iso_intervals.c"
yy59:
YYDEBUG(59, *YYCURSOR);
yych = *++YYCURSOR;
YYDEBUG(83, *YYCURSOR);
++YYCURSOR;
YYDEBUG(84, *YYCURSOR);
-#line 292 "ext/date/lib/parse_iso_intervals.re"
+#line 298 "ext/date/lib/parse_iso_intervals.re"
{
timelib_time *current;
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
-#line 909 "ext/date/lib/parse_iso_intervals.c"
+#line 915 "ext/date/lib/parse_iso_intervals.c"
yy85:
YYDEBUG(85, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '9') goto yy98;
yy100:
YYDEBUG(100, *YYCURSOR);
-#line 281 "ext/date/lib/parse_iso_intervals.re"
+#line 287 "ext/date/lib/parse_iso_intervals.re"
{
DEBUG_OUTPUT("recurrences");
TIMELIB_INIT;
s->have_recurrences = 1;
return TIMELIB_PERIOD;
}
-#line 997 "ext/date/lib/parse_iso_intervals.c"
+#line 1003 "ext/date/lib/parse_iso_intervals.c"
}
-#line 393 "ext/date/lib/parse_iso_intervals.re"
+#line 399 "ext/date/lib/parse_iso_intervals.re"
}
#ifdef PHP_WIN32
#define YYMAXFILL 20
-void timelib_strtointerval(char *s, int len,
- timelib_time **begin, timelib_time **end,
- timelib_rel_time **period, int *recurrences,
+void timelib_strtointerval(char *s, size_t len,
+ timelib_time **begin, timelib_time **end,
+ timelib_rel_time **period, int *recurrences,
struct timelib_error_container **errors)
{
Scanner in;
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
/* $Id$ */
}
}
-static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
+static timelib_long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
{
- long retval = 0;
+ timelib_long retval = 0;
*tz_not_found = 0;
/*!max:re2c */
-void timelib_strtointerval(char *s, int len,
+void timelib_strtointerval(char *s, size_t len,
timelib_time **begin, timelib_time **end,
timelib_rel_time **period, int *recurrences,
struct timelib_error_container **errors)
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
-/* $Id$ */
-
#include "timelib.h"
#include <stdio.h>
printf("Geo Location: %f,%f\n", tz->location.latitude, tz->location.longitude);
printf("Comments:\n%s\n", tz->location.comments);
printf("BC: %s\n", tz->bc ? "" : "yes");
- printf("UTC/Local count: %lu\n", (unsigned long) tz->bit32.ttisgmtcnt);
- printf("Std/Wall count: %lu\n", (unsigned long) tz->bit32.ttisstdcnt);
- printf("Leap.sec. count: %lu\n", (unsigned long) tz->bit32.leapcnt);
- printf("Trans. count: %lu\n", (unsigned long) tz->bit32.timecnt);
- printf("Local types count: %lu\n", (unsigned long) tz->bit32.typecnt);
- printf("Zone Abbr. count: %lu\n", (unsigned long) tz->bit32.charcnt);
+ printf("UTC/Local count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.ttisgmtcnt);
+ printf("Std/Wall count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.ttisstdcnt);
+ printf("Leap.sec. count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.leapcnt);
+ printf("Trans. count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.timecnt);
+ printf("Local types count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.typecnt);
+ printf("Zone Abbr. count: " TIMELIB_ULONG_FMT "\n", (timelib_ulong) tz->bit32.charcnt);
printf ("%8s (%12s) = %3d [%5ld %1d %3d '%s' (%d,%d)]\n",
"", "", 0,
*transition_time = 0;
j = 0;
- while (j < tz->bit32.timecnt && tz->type[j].isdst) {
+ while (j < tz->bit32.timecnt && tz->type[tz->trans_idx[j]].isdst) {
++j;
}
if (j == tz->bit32.timecnt) {
j = 0;
}
- return &(tz->type[j]);
+ return &(tz->type[tz->trans_idx[j]]);
}
/* In all other cases we loop through the available transtion times to find
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
-/* $Id$ */
-
#include "timelib.h"
#include <ctype.h>
#include <math.h>
void timelib_time_tz_abbr_update(timelib_time* tm, char* tz_abbr)
{
unsigned int i;
-
+ size_t tz_abbr_len = strlen(tz_abbr);
+
TIMELIB_TIME_FREE(tm->tz_abbr);
tm->tz_abbr = strdup(tz_abbr);
- for (i = 0; i < strlen(tz_abbr); i++) {
+ for (i = 0; i < tz_abbr_len; i++) {
tm->tz_abbr[i] = toupper(tz_abbr[i]);
}
}
free(errors);
}
-signed long timelib_date_to_int(timelib_time *d, int *error)
+timelib_long timelib_date_to_int(timelib_time *d, int *error)
{
timelib_sll ts;
ts = d->sse;
- if (ts < LONG_MIN || ts > LONG_MAX) {
+ if (ts < TIMELIB_LONG_MIN || ts > TIMELIB_LONG_MAX) {
if (error) {
*error = 1;
}
if (error) {
*error = 0;
}
- return (signed long) d->sse;
+ return (timelib_long) d->sse;
}
void timelib_decimal_hour_to_hms(double h, int *hour, int *min, int *sec)
printf("\n");
}
-long timelib_parse_tz_cor(char **ptr)
+timelib_long timelib_parse_tz_cor(char **ptr)
{
char *begin = *ptr, *end;
- long tmp;
+ timelib_long tmp;
while (isdigit(**ptr) || **ptr == ':') {
++*ptr;
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
-/* $Id$ */
-
#ifndef __TIMELIB_H__
#define __TIMELIB_H__
#include <limits.h>
#endif
-#define TIMELIB_VERSION 201102
+#define TIMELIB_VERSION 201501
+#define TIMELIB_ASCII_VERSION "2015.01"
#define TIMELIB_NONE 0x00
#define TIMELIB_OVERRIDE_TIME 0x01
int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d);
/* From parse_date.re */
-timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
-timelib_time *timelib_parse_from_format(char *format, char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
+timelib_time *timelib_strtotime(char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
+timelib_time *timelib_parse_from_format(char *format, char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options);
-char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst);
+char *timelib_timezone_id_from_abbr(const char *abbr, timelib_long gmtoffset, int isdst);
const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void);
-long timelib_parse_tz_cor(char**);
+timelib_long timelib_parse_tz_cor(char**);
/* From parse_iso_intervals.re */
-void timelib_strtointerval(char *s, int len,
+void timelib_strtointerval(char *s, size_t len,
timelib_time **begin, timelib_time **end,
timelib_rel_time **period, int *recurrences,
struct timelib_error_container **errors);
void timelib_dump_tzinfo(timelib_tzinfo *tz);
const timelib_tzdb *timelib_builtin_db(void);
const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count);
-long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper);
+timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper);
/* From timelib.c */
timelib_tzinfo* timelib_tzinfo_ctor(char *name);
void timelib_error_container_dtor(timelib_error_container *errors);
-signed long timelib_date_to_int(timelib_time *d, int *error);
+timelib_long timelib_date_to_int(timelib_time *d, int *error);
void timelib_dump_date(timelib_time *d, int options);
void timelib_dump_rel_time(timelib_rel_time *d);
void timelib_decimal_hour_to_hms(double h, int *hour, int *min, int *sec);
-long timelib_parse_tz_cor(char **ptr);
+timelib_long timelib_parse_tz_cor(char **ptr);
/* from astro.c */
double timelib_ts_to_juliandate(timelib_sll ts);
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
-/* $Id$ */
-
#ifndef __TIMELIB_STRUCTS_H__
#define __TIMELIB_STRUCTS_H__
#include <strings.h>
#endif
+#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64)
+typedef int64_t timelib_long;
+typedef uint64_t timelib_ulong;
+# define TIMELIB_LONG_MAX INT64_MAX
+# define TIMELIB_LONG_MIN INT64_MIN
+# define TIMELIB_ULONG_MAX UINT64_MAX
+# define TIMELIB_LONG_FMT "%" PRId64
+# define TIMELIB_ULONG_FMT "%" PRIu64
+#else
+typedef int32_t timelib_long;
+typedef uint32_t timelib_ulong;
+# define TIMELIB_LONG_MAX INT32_MAX
+# define TIMELIB_LONG_MIN INT32_MIN
+# define TIMELIB_ULONG_MAX UINT32_MAX
+# define TIMELIB_LONG_FMT "%" PRId32
+# define TIMELIB_ULONG_FMT "%" PRIu32
+#endif
+
#if defined(_MSC_VER)
typedef uint64_t timelib_ull;
typedef int64_t timelib_sll;
} timelib_error_message;
typedef struct timelib_error_container {
- int warning_count;
+ struct timelib_error_message *error_messages;
struct timelib_error_message *warning_messages;
int error_count;
- struct timelib_error_message *error_messages;
+ int warning_count;
} timelib_error_container;
typedef struct _timelib_tz_lookup_table {
{ "acwst", 0, 31500, "Australia/Eucla" },
{ "addt", 1, -7200, "America/Goose_Bay" },
{ "addt", 1, -7200, "America/Pangnirtung" },
- { "admt", 0, 9320, "Africa/Addis_Ababa" },
- { "admt", 0, 9320, "Africa/Asmara" },
- { "admt", 0, 9320, "Africa/Asmera" },
{ "adt", 1, -10800, "America/Halifax" },
{ "adt", 1, -10800, "America/Barbados" },
{ "adt", 1, -10800, "America/Blanc-Sablon" },
{ "ant", 0, -16200, "America/Aruba" },
{ "ant", 0, -16200, "America/Kralendijk" },
{ "ant", 0, -16200, "America/Lower_Princes" },
- { "aot", 0, 3124, "Africa/Luanda" },
{ "apt", 1, -10800, "America/Halifax" },
{ "apt", 1, -10800, "America/Blanc-Sablon" },
{ "apt", 1, -10800, "America/Glace_Bay" },
{ "ast", 0, -14400, "America/Dominica" },
{ "ast", 0, -14400, "America/Glace_Bay" },
{ "ast", 0, -14400, "America/Goose_Bay" },
+ { "ast", 0, -14400, "America/Grand_Turk" },
{ "ast", 0, -14400, "America/Grenada" },
{ "ast", 0, -14400, "America/Guadeloupe" },
{ "ast", 0, -14400, "America/Halifax" },
{ "bdt", 1, -36000, "America/Nome" },
{ "bdt", 0, 21600, "Asia/Dhaka" },
{ "beat", 0, 9000, "Africa/Mogadishu" },
+ { "beat", 0, 9000, "Africa/Addis_Ababa" },
+ { "beat", 0, 9000, "Africa/Asmara" },
+ { "beat", 0, 9000, "Africa/Asmera" },
+ { "beat", 0, 9000, "Africa/Dar_es_Salaam" },
+ { "beat", 0, 9000, "Africa/Djibouti" },
{ "beat", 0, 9000, "Africa/Kampala" },
{ "beat", 0, 9000, "Africa/Nairobi" },
+ { "beat", 0, 9000, "Indian/Antananarivo" },
+ { "beat", 0, 9000, "Indian/Comoro" },
+ { "beat", 0, 9000, "Indian/Mayotte" },
{ "beaut", 0, 9900, "Africa/Nairobi" },
+ { "beaut", 0, 9900, "Africa/Addis_Ababa" },
+ { "beaut", 0, 9900, "Africa/Asmara" },
+ { "beaut", 0, 9900, "Africa/Asmera" },
{ "beaut", 0, 9900, "Africa/Dar_es_Salaam" },
+ { "beaut", 0, 9900, "Africa/Djibouti" },
{ "beaut", 0, 9900, "Africa/Kampala" },
+ { "beaut", 0, 9900, "Africa/Mogadishu" },
+ { "beaut", 0, 9900, "Indian/Antananarivo" },
+ { "beaut", 0, 9900, "Indian/Comoro" },
+ { "beaut", 0, 9900, "Indian/Mayotte" },
{ "bmt", 0, -14309, "America/Barbados" },
{ "bmt", 0, 6264, "Europe/Tiraspol" },
{ "bmt", 0, -17776, "America/Bogota" },
{ "bmt", 0, 10656, "Asia/Baghdad" },
{ "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" },
{ "bst", 1, 3600, "Europe/Isle_of_Man" },
{ "bst", 1, 3600, "Europe/Jersey" },
{ "bst", 1, 3600, "GB" },
+ { "bst", 0, 39600, "Pacific/Bougainville" },
{ "btt", 0, 21600, "Asia/Thimbu" },
{ "btt", 0, 21600, "Asia/Thimphu" },
{ "burt", 0, 23400, "Asia/Kolkata" },
{ "cant", 0, -3600, "Atlantic/Canary" },
{ "capt", 1, -32400, "America/Anchorage" },
{ "cast", 0, 34200, "Australia/Adelaide" },
- { "cast", 1, 10800, "Africa/Gaborone" },
{ "cast", 1, 10800, "Africa/Juba" },
{ "cast", 1, 10800, "Africa/Khartoum" },
{ "cast", 0, 39600, "Antarctica/Casey" },
{ "cdt", 1, 32400, "PRC" },
{ "cdt", 1, 32400, "ROC" },
{ "cemt", 1, 10800, "Europe/Berlin" },
- { "cemt", 1, 10800, "CET" },
{ "cest", 1, 7200, "Europe/Berlin" },
{ "cest", 1, 10800, "Europe/Kaliningrad" },
{ "cest", 1, 7200, "Africa/Algiers" },
{ "cest", 1, 7200, "Antarctica/Troll" },
{ "cest", 1, 7200, "Arctic/Longyearbyen" },
{ "cest", 1, 7200, "Atlantic/Jan_Mayen" },
- { "cest", 1, 7200, "CET" },
{ "cest", 1, 7200, "Europe/Amsterdam" },
{ "cest", 1, 7200, "Europe/Andorra" },
{ "cest", 1, 7200, "Europe/Athens" },
{ "cest", 1, 7200, "Europe/Zagreb" },
{ "cest", 1, 7200, "Europe/Zaporozhye" },
{ "cest", 1, 7200, "Europe/Zurich" },
- { "cest", 1, 7200, "WET" },
{ "cet", 0, 3600, "Europe/Berlin" },
{ "cet", 0, 7200, "Europe/Kaliningrad" },
{ "cet", 0, 3600, "Africa/Algiers" },
{ "cet", 0, 3600, "Africa/Tunis" },
{ "cet", 0, 3600, "Arctic/Longyearbyen" },
{ "cet", 0, 3600, "Atlantic/Jan_Mayen" },
- { "cet", 0, 3600, "CET" },
{ "cet", 0, 3600, "Europe/Amsterdam" },
{ "cet", 0, 3600, "Europe/Andorra" },
{ "cet", 0, 3600, "Europe/Athens" },
{ "cet", 0, 3600, "Europe/Zagreb" },
{ "cet", 0, 3600, "Europe/Zaporozhye" },
{ "cet", 0, 3600, "Europe/Zurich" },
- { "cet", 0, 3600, "WET" },
{ "cgst", 1, -3600, "America/Scoresbysund" },
{ "cgt", 0, -7200, "America/Scoresbysund" },
{ "chadt", 1, 49500, "Pacific/Chatham" },
{ "chast", 0, 44100, "Pacific/Chatham" },
{ "chdt", 1, -19800, "America/Belize" },
{ "chost", 1, 36000, "Asia/Choibalsan" },
+ { "chost", 1, 32400, "Asia/Choibalsan" },
{ "chot", 0, 32400, "Asia/Choibalsan" },
{ "chot", 0, 28800, "Asia/Choibalsan" },
{ "chut", 0, 36000, "Pacific/Chuuk" },
{ "clst", 1, -10800, "Chile/Continental" },
{ "clst", 1, -14400, "Chile/Continental" },
{ "clt", 0, -14400, "America/Santiago" },
+ { "clt", 0, -10800, "America/Santiago" },
{ "clt", 0, -18000, "America/Santiago" },
+ { "clt", 0, -10800, "Antarctica/Palmer" },
+ { "clt", 0, -10800, "Chile/Continental" },
{ "clt", 0, -14400, "Antarctica/Palmer" },
{ "clt", 0, -14400, "Chile/Continental" },
{ "clt", 0, -18000, "Chile/Continental" },
{ "cmt", 0, -15408, "America/Rosario" },
{ "cmt", 0, -16060, "America/Caracas" },
{ "cmt", 0, -16356, "America/La_Paz" },
+ { "cmt", 0, -19176, "America/Cayman" },
{ "cmt", 0, -19176, "America/Panama" },
{ "cmt", 0, 6900, "Europe/Chisinau" },
{ "cmt", 0, 6900, "Europe/Tiraspol" },
{ "easst", 1, -18000, "Chile/EasterIsland" },
{ "easst", 1, -18000, "Pacific/Easter" },
{ "easst", 1, -21600, "Pacific/Easter" },
+ { "east", 0, -18000, "Chile/EasterIsland" },
{ "east", 0, -21600, "Chile/EasterIsland" },
{ "east", 0, -25200, "Chile/EasterIsland" },
- { "east", 1, 14400, "Indian/Antananarivo" },
+ { "east", 0, -18000, "Pacific/Easter" },
{ "east", 0, -21600, "Pacific/Easter" },
{ "east", 0, -25200, "Pacific/Easter" },
{ "eat", 0, 10800, "Africa/Khartoum" },
{ "edt", 1, -14400, "America/Thunder_Bay" },
{ "edt", 1, -14400, "America/Toronto" },
{ "edt", 1, -14400, "Canada/Eastern" },
- { "edt", 1, -14400, "EST" },
{ "eest", 1, 10800, "Europe/Helsinki" },
{ "eest", 1, 10800, "Africa/Cairo" },
{ "eest", 1, 10800, "Asia/Amman" },
{ "eest", 1, 10800, "Asia/Hebron" },
{ "eest", 1, 10800, "Asia/Istanbul" },
{ "eest", 1, 10800, "Asia/Nicosia" },
- { "eest", 1, 10800, "EET" },
{ "eest", 1, 10800, "Europe/Athens" },
{ "eest", 1, 10800, "Europe/Bucharest" },
{ "eest", 1, 10800, "Europe/Chisinau" },
{ "eet", 0, 7200, "Asia/Hebron" },
{ "eet", 0, 7200, "Asia/Istanbul" },
{ "eet", 0, 7200, "Asia/Nicosia" },
- { "eet", 0, 7200, "EET" },
{ "eet", 0, 7200, "Europe/Athens" },
{ "eet", 0, 7200, "Europe/Bucharest" },
{ "eet", 0, 7200, "Europe/Chisinau" },
{ "ept", 1, -14400, "America/Thunder_Bay" },
{ "ept", 1, -14400, "America/Toronto" },
{ "ept", 1, -14400, "Canada/Eastern" },
- { "ept", 1, -14400, "EST" },
{ "est", 0, -18000, "America/New_York" },
- { "est", 0, -18000, "America/Antigua" },
{ "est", 0, -18000, "America/Atikokan" },
{ "est", 0, -18000, "America/Cambridge_Bay" },
{ "est", 0, -18000, "America/Cancun" },
{ "est", 0, -18000, "America/Thunder_Bay" },
{ "est", 0, -18000, "America/Toronto" },
{ "est", 0, -18000, "Canada/Eastern" },
- { "est", 0, -18000, "EST" },
{ "ewt", 1, -14400, "America/New_York" },
{ "ewt", 1, -14400, "America/Detroit" },
{ "ewt", 1, -14400, "America/Iqaluit" },
{ "ewt", 1, -14400, "America/Thunder_Bay" },
{ "ewt", 1, -14400, "America/Toronto" },
{ "ewt", 1, -14400, "Canada/Eastern" },
- { "ewt", 1, -14400, "EST" },
{ "fet", 0, 10800, "Europe/Kaliningrad" },
{ "fet", 0, 10800, "Europe/Minsk" },
{ "ffmt", 0, -14660, "America/Martinique" },
{ "gmt", 0, 0, "Africa/Dakar" },
{ "gmt", 0, 0, "Africa/Freetown" },
{ "gmt", 0, 0, "Africa/Lome" },
- { "gmt", 0, 0, "Africa/Malabo" },
{ "gmt", 0, 0, "Africa/Monrovia" },
- { "gmt", 0, 0, "Africa/Niamey" },
{ "gmt", 0, 0, "Africa/Nouakchott" },
{ "gmt", 0, 0, "Africa/Ouagadougou" },
- { "gmt", 0, 0, "Africa/Porto-Novo" },
{ "gmt", 0, 0, "Africa/Sao_Tome" },
{ "gmt", 0, 0, "Africa/Timbuktu" },
{ "gmt", 0, 0, "America/Danmarkshavn" },
{ "gst", 0, 14400, "Asia/Muscat" },
{ "gst", 0, 14400, "Asia/Qatar" },
{ "gst", 0, 36000, "Pacific/Guam" },
+ { "gst", 0, 36000, "Pacific/Saipan" },
{ "gyt", 0, -14400, "America/Guyana" },
{ "gyt", 0, -10800, "America/Guyana" },
{ "gyt", 0, -13500, "America/Guyana" },
{ "hast", 0, -36000, "America/Adak" },
{ "hast", 0, -36000, "America/Atka" },
{ "hdt", 1, -34200, "Pacific/Honolulu" },
- { "hdt", 1, -34200, "HST" },
{ "hdt", 1, -34200, "Pacific/Johnston" },
{ "hkst", 1, 32400, "Asia/Hong_Kong" },
{ "hkt", 0, 28800, "Asia/Hong_Kong" },
{ "hmt", 0, 21200, "Asia/Dacca" },
{ "hmt", 0, 21200, "Asia/Dhaka" },
{ "hmt", 0, 21200, "Asia/Kolkata" },
- { "hmt", 0, 5989, "EET" },
{ "hmt", 0, 5989, "Europe/Helsinki" },
{ "hmt", 0, 5989, "Europe/Mariehamn" },
{ "hovst", 1, 28800, "Asia/Hovd" },
{ "hovt", 0, 21600, "Asia/Hovd" },
{ "hst", 0, -36000, "Pacific/Honolulu" },
{ "hst", 0, -37800, "Pacific/Honolulu" },
- { "hst", 0, -36000, "HST" },
{ "hst", 0, -36000, "Pacific/Johnston" },
- { "hst", 0, -37800, "HST" },
{ "hst", 0, -37800, "Pacific/Johnston" },
{ "ict", 0, 25200, "Asia/Bangkok" },
{ "ict", 0, 25200, "Asia/Ho_Chi_Minh" },
{ "ict", 0, 25200, "Asia/Phnom_Penh" },
{ "ict", 0, 25200, "Asia/Saigon" },
{ "ict", 0, 25200, "Asia/Vientiane" },
- { "ict", 0, 28800, "Asia/Ho_Chi_Minh" },
- { "ict", 0, 28800, "Asia/Phnom_Penh" },
- { "ict", 0, 28800, "Asia/Saigon" },
- { "ict", 0, 28800, "Asia/Vientiane" },
{ "iddt", 1, 14400, "Asia/Jerusalem" },
{ "iddt", 1, 14400, "Asia/Tel_Aviv" },
{ "idt", 1, 10800, "Asia/Jerusalem" },
{ "idt", 1, 10800, "Asia/Gaza" },
{ "idt", 1, 10800, "Asia/Hebron" },
{ "idt", 1, 10800, "Asia/Tel_Aviv" },
+ { "idt", 0, 28800, "Asia/Ho_Chi_Minh" },
+ { "idt", 0, 28800, "Asia/Saigon" },
{ "ihst", 1, 21600, "Asia/Colombo" },
- { "imt", 0, 25035, "Asia/Irkutsk" },
+ { "imt", 0, 25025, "Asia/Irkutsk" },
{ "imt", 0, 7016, "Asia/Istanbul" },
{ "imt", 0, 7016, "Europe/Istanbul" },
{ "iot", 0, 21600, "Indian/Chagos" },
{ "jmt", 0, 8440, "Asia/Tel_Aviv" },
{ "jst", 0, 32400, "Asia/Tokyo" },
{ "jst", 0, 32400, "Asia/Dili" },
+ { "jst", 0, 32400, "Asia/Ho_Chi_Minh" },
{ "jst", 0, 32400, "Asia/Hong_Kong" },
{ "jst", 0, 32400, "Asia/Jakarta" },
{ "jst", 0, 32400, "Asia/Kuala_Lumpur" },
{ "jst", 0, 32400, "Asia/Pontianak" },
{ "jst", 0, 32400, "Asia/Pyongyang" },
{ "jst", 0, 32400, "Asia/Rangoon" },
+ { "jst", 0, 32400, "Asia/Saigon" },
{ "jst", 0, 32400, "Asia/Sakhalin" },
{ "jst", 0, 32400, "Asia/Seoul" },
{ "jst", 0, 32400, "Asia/Singapore" },
{ "jst", 0, 32400, "Asia/Taipei" },
{ "jst", 0, 32400, "Asia/Ujung_Pandang" },
+ { "jst", 0, 32400, "Pacific/Bougainville" },
{ "jst", 0, 32400, "Pacific/Nauru" },
{ "jst", 0, 32400, "ROC" },
{ "jst", 0, 32400, "ROK" },
{ "jwst", 0, 28800, "ROC" },
{ "kart", 0, 18000, "Asia/Karachi" },
{ "kdt", 1, 36000, "Asia/Seoul" },
- { "kdt", 1, 32400, "Asia/Seoul" },
- { "kdt", 1, 32400, "ROK" },
+ { "kdt", 1, 34200, "Asia/Seoul" },
+ { "kdt", 1, 34200, "ROK" },
{ "kdt", 1, 36000, "ROK" },
{ "kgst", 1, 21600, "Asia/Bishkek" },
{ "kgt", 0, 18000, "Asia/Bishkek" },
{ "kizt", 0, 14400, "Asia/Qyzylorda" },
{ "kizt", 0, 18000, "Asia/Qyzylorda" },
{ "kmt", 0, 5736, "Europe/Vilnius" },
- { "kmt", 0, -18431, "America/Cayman" },
{ "kmt", 0, -18431, "America/Grand_Turk" },
{ "kmt", 0, -18431, "America/Jamaica" },
{ "kmt", 0, 7324, "Europe/Kiev" },
{ "krat", 0, 28800, "Asia/Krasnoyarsk" },
{ "krat", 0, 21600, "Asia/Novokuznetsk" },
{ "krat", 0, 25200, "Asia/Novokuznetsk" },
- { "kst", 0, 28800, "Asia/Seoul" },
{ "kst", 0, 30600, "Asia/Seoul" },
{ "kst", 0, 32400, "Asia/Pyongyang" },
{ "kst", 0, 32400, "Asia/Seoul" },
- { "kst", 0, 28800, "Asia/Pyongyang" },
- { "kst", 0, 28800, "ROK" },
{ "kst", 0, 30600, "Asia/Pyongyang" },
{ "kst", 0, 30600, "ROK" },
{ "kst", 0, 32400, "ROK" },
{ "lkt", 0, 23400, "Asia/Colombo" },
{ "lkt", 0, 21600, "Asia/Colombo" },
{ "lrt", 0, -2670, "Africa/Monrovia" },
- { "lst", 1, 9388, "Europe/Riga" },
+ { "lst", 1, 9394, "Europe/Riga" },
{ "madmt", 1, 3600, "Atlantic/Madeira" },
{ "madst", 1, 0, "Atlantic/Madeira" },
{ "madt", 0, -3600, "Atlantic/Madeira" },
{ "mdt", 1, -21600, "Canada/Mountain" },
{ "mdt", 1, -21600, "Canada/Saskatchewan" },
{ "mdt", 1, -21600, "Mexico/BajaSur" },
- { "mdt", 1, -21600, "MST" },
- { "mest", 1, 7200, "MET" },
- { "met", 0, 3600, "MET" },
{ "mht", 0, 43200, "Pacific/Kwajalein" },
{ "mht", 0, 39600, "Pacific/Kwajalein" },
{ "mht", 0, 39600, "Pacific/Majuro" },
{ "mot", 0, 28800, "Asia/Macao" },
{ "mot", 0, 28800, "Asia/Macau" },
{ "mpt", 1, -21600, "America/Denver" },
- { "mpt", 0, 36000, "Pacific/Saipan" },
{ "mpt", 1, -21600, "America/Boise" },
{ "mpt", 1, -21600, "America/Cambridge_Bay" },
{ "mpt", 1, -21600, "America/Edmonton" },
{ "mpt", 1, -21600, "Canada/East-Saskatchewan" },
{ "mpt", 1, -21600, "Canada/Mountain" },
{ "mpt", 1, -21600, "Canada/Saskatchewan" },
- { "mpt", 1, -21600, "MST" },
- { "mpt", 0, 32400, "Pacific/Saipan" },
{ "msd", 1, 14400, "Europe/Moscow" },
{ "msd", 1, 14400, "Europe/Chisinau" },
{ "msd", 1, 14400, "Europe/Kaliningrad" },
{ "msd", 1, 14400, "Europe/Tiraspol" },
{ "msd", 1, 14400, "Europe/Uzhgorod" },
{ "msd", 1, 14400, "Europe/Vilnius" },
+ { "msd", 1, 14400, "Europe/Volgograd" },
{ "msd", 1, 14400, "Europe/Zaporozhye" },
{ "msk", 0, 10800, "Europe/Moscow" },
{ "msk", 0, 14400, "Europe/Moscow" },
{ "msk", 0, 10800, "Europe/Zaporozhye" },
{ "msk", 0, 14400, "Europe/Simferopol" },
{ "msk", 0, 14400, "Europe/Volgograd" },
- { "msk", 1, 14400, "Europe/Volgograd" },
{ "msm", 1, 18000, "Europe/Moscow" },
{ "mst", 0, -25200, "America/Denver" },
{ "mst", 0, -25200, "America/Bahia_Banderas" },
{ "mst", 0, -25200, "Mexico/BajaNorte" },
{ "mst", 0, -25200, "Mexico/BajaSur" },
{ "mst", 0, -25200, "Mexico/General" },
- { "mst", 0, -25200, "MST" },
{ "mst", 1, 12679, "Europe/Moscow" },
{ "must", 1, 18000, "Indian/Mauritius" },
{ "mut", 0, 14400, "Indian/Mauritius" },
{ "mwt", 1, -21600, "Canada/East-Saskatchewan" },
{ "mwt", 1, -21600, "Canada/Mountain" },
{ "mwt", 1, -21600, "Canada/Saskatchewan" },
- { "mwt", 1, -21600, "MST" },
{ "myt", 0, 28800, "Asia/Kuala_Lumpur" },
{ "myt", 0, 28800, "Asia/Kuching" },
{ "ncst", 1, 43200, "Pacific/Noumea" },
{ "nddt", 1, -5400, "Canada/Newfoundland" },
{ "ndt", 1, -9052, "America/St_Johns" },
{ "ndt", 1, -9000, "America/St_Johns" },
- { "ndt", 1, -36000, "Pacific/Midway" },
{ "ndt", 1, -9000, "America/Goose_Bay" },
{ "ndt", 1, -9000, "Canada/Newfoundland" },
{ "ndt", 1, -9052, "America/Goose_Bay" },
{ "nest", 1, 4800, "Europe/Amsterdam" },
{ "net", 0, 1200, "Europe/Amsterdam" },
{ "nft", 0, 41400, "Pacific/Norfolk" },
- { "nmt", 0, 20928, "Asia/Novokuznetsk" },
{ "nmt", 0, 40320, "Pacific/Norfolk" },
{ "novst", 1, 25200, "Asia/Novosibirsk" },
{ "novst", 1, 28800, "Asia/Novosibirsk" },
{ "pett", 0, 43200, "Asia/Kamchatka" },
{ "pett", 0, 39600, "Asia/Kamchatka" },
{ "pet", 0, -18000, "America/Lima" },
+ { "pgt", 0, 36000, "Pacific/Bougainville" },
{ "pgt", 0, 36000, "Pacific/Port_Moresby" },
{ "phot", 0, 46800, "Pacific/Enderbury" },
{ "phot", 0, -39600, "Pacific/Enderbury" },
{ "pht", 0, 28800, "Asia/Manila" },
{ "pkst", 1, 21600, "Asia/Karachi" },
{ "pkt", 0, 18000, "Asia/Karachi" },
+ { "plmt", 0, 25590, "Asia/Ho_Chi_Minh" },
+ { "plmt", 0, 25590, "Asia/Saigon" },
{ "pmdt", 1, -7200, "America/Miquelon" },
{ "pmst", 0, -10800, "America/Miquelon" },
{ "pmt", 0, -13236, "America/Paramaribo" },
{ "pmt", 0, -13252, "America/Paramaribo" },
{ "pmt", 0, 36000, "Antarctica/DumontDUrville" },
+ { "pmt", 0, 13505, "Asia/Yekaterinburg" },
{ "pmt", 0, 26240, "Asia/Pontianak" },
{ "pmt", 0, 561, "Africa/Algiers" },
{ "pmt", 0, 561, "Africa/Tunis" },
{ "pmt", 0, 561, "Europe/Monaco" },
{ "pmt", 0, 561, "Europe/Paris" },
- { "pmt", 0, 561, "WET" },
{ "pnt", 0, -30600, "Pacific/Pitcairn" },
{ "pont", 0, 39600, "Pacific/Pohnpei" },
{ "pont", 0, 39600, "Pacific/Ponape" },
{ "qyzt", 0, 21600, "Asia/Qyzylorda" },
{ "qyzt", 0, 18000, "Asia/Qyzylorda" },
{ "ret", 0, 14400, "Indian/Reunion" },
- { "rmt", 0, 5788, "Europe/Riga" },
- { "rmt", 0, -5268, "Atlantic/Reykjavik" },
+ { "rmt", 0, 5794, "Europe/Riga" },
{ "rmt", 0, 23080, "Asia/Rangoon" },
{ "rott", 0, -10800, "Antarctica/Rothera" },
{ "sakst", 1, 39600, "Asia/Sakhalin" },
{ "sast", 1, 10800, "Africa/Johannesburg" },
{ "sast", 0, 5400, "Africa/Johannesburg" },
{ "sast", 1, 10800, "Africa/Maseru" },
+ { "sast", 1, 10800, "Africa/Mbabane" },
{ "sast", 1, 10800, "Africa/Windhoek" },
- { "sast", 0, 5400, "Africa/Gaborone" },
+ { "sast", 0, 5400, "Africa/Maseru" },
+ { "sast", 0, 5400, "Africa/Mbabane" },
{ "sast", 0, 7200, "Africa/Maseru" },
{ "sast", 0, 7200, "Africa/Mbabane" },
{ "sast", 0, 7200, "Africa/Windhoek" },
{ "shet", 0, 21600, "Asia/Aqtau" },
{ "shet", 0, 18000, "Asia/Aqtau" },
{ "sjmt", 0, -20173, "America/Costa_Rica" },
- { "smt", 0, 25580, "Asia/Saigon" },
{ "smt", 0, -13884, "Atlantic/Stanley" },
{ "smt", 0, -16966, "America/Santiago" },
{ "smt", 0, -16966, "Chile/Continental" },
{ "smt", 0, 24925, "Asia/Kuala_Lumpur" },
{ "smt", 0, 24925, "Asia/Singapore" },
- { "smt", 0, 25580, "Asia/Ho_Chi_Minh" },
- { "smt", 0, 25580, "Asia/Phnom_Penh" },
- { "smt", 0, 25580, "Asia/Vientiane" },
{ "smt", 0, 8160, "Europe/Simferopol" },
{ "sret", 0, 39600, "Asia/Srednekolymsk" },
{ "srt", 0, -10800, "America/Paramaribo" },
{ "tbist", 1, 14400, "Asia/Tbilisi" },
{ "tbit", 0, 14400, "Asia/Tbilisi" },
{ "tbit", 0, 10800, "Asia/Tbilisi" },
- { "tbmt", 0, 10746, "Asia/Tbilisi" },
+ { "tbmt", 0, 10751, "Asia/Tbilisi" },
{ "tft", 0, 18000, "Indian/Kerguelen" },
{ "tjt", 0, 18000, "Asia/Dushanbe" },
{ "tkt", 0, -39600, "Pacific/Fakaofo" },
{ "tsat", 0, 10800, "Europe/Volgograd" },
{ "tvt", 0, 43200, "Pacific/Funafuti" },
{ "uct", 0, 0, "Etc/UCT" },
- { "uct", 0, 0, "UCT" },
{ "ulast", 1, 32400, "Asia/Ulaanbaatar" },
{ "ulast", 1, 32400, "Asia/Ulan_Bator" },
{ "ulat", 0, 28800, "Asia/Ulaanbaatar" },
{ "utc", 0, 0, "Etc/Universal" },
{ "utc", 0, 0, "Etc/UTC" },
{ "utc", 0, 0, "Etc/Zulu" },
- { "utc", 0, 0, "GMT" },
{ "utc", 0, 0, "UTC" },
{ "utc", 0, 0, "UTC" },
{ "uyhst", 1, -9000, "America/Montevideo" },
{ "wat", 0, 3600, "Africa/Brazzaville" },
{ "wat", 0, -3600, "Africa/Bissau" },
{ "wat", 0, -3600, "Africa/El_Aaiun" },
- { "wat", 0, -3600, "Africa/Niamey" },
{ "wat", 0, 3600, "Africa/Bangui" },
{ "wat", 0, 3600, "Africa/Douala" },
{ "wat", 0, 3600, "Africa/Kinshasa" },
{ "wemt", 1, 7200, "Europe/Madrid" },
{ "wemt", 1, 7200, "Europe/Monaco" },
{ "wemt", 1, 7200, "Europe/Paris" },
- { "wemt", 1, 7200, "WET" },
{ "west", 1, 3600, "Europe/Paris" },
{ "west", 1, 7200, "Europe/Luxembourg" },
{ "west", 1, 3600, "Africa/Algiers" },
{ "west", 1, 3600, "Europe/Luxembourg" },
{ "west", 1, 3600, "Europe/Madrid" },
{ "west", 1, 3600, "Europe/Monaco" },
- { "west", 1, 3600, "WET" },
{ "wet", 0, 0, "Europe/Paris" },
{ "wet", 0, 3600, "Europe/Luxembourg" },
{ "wet", 0, 0, "Africa/Algiers" },
{ "wet", 0, 0, "Europe/Luxembourg" },
{ "wet", 0, 0, "Europe/Madrid" },
{ "wet", 0, 0, "Europe/Monaco" },
- { "wet", 0, 0, "WET" },
{ "wft", 0, 43200, "Pacific/Wallis" },
{ "wgst", 1, -7200, "America/Godthab" },
{ "wgst", 1, -7200, "America/Danmarkshavn" },
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
-/* $Id$ */
-
#include "timelib.h"
/* jan feb mrt apr may jun jul aug sep oct nov dec */
/*
- +----------------------------------------------------------------------+
- | PHP Version 5 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Derick Rethans <derick@derickrethans.nl> |
- +----------------------------------------------------------------------+
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2015 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
*/
-/* $Id$ */
-
#include "timelib.h"
#include <stdio.h>