#include "timelib.h"
-static const int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
-static const int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
+static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
+static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
static timelib_sll century_value(timelib_sll j)
{
}
/* jan feb mar apr may jun jul aug sep oct nov dec */
-static const int d_table_common[13] = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
-static const int d_table_leap[13] = { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 };
-static const int ml_table_common[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-static const int ml_table_leap[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+static int d_table_common[13] = { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+static int d_table_leap[13] = { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 };
+static int ml_table_common[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+static int ml_table_leap[13] = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
timelib_sll timelib_day_of_year(timelib_sll y, timelib_sll m, timelib_sll d)
{
int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
{
- const unsigned char *tzf;
- return (seek_to_tz_position(&tzf, timezone, tzdb));
+ unsigned char *tzf;
+ return (seek_to_tz_position((unsigned char**) &tzf, timezone, tzdb));
}
timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb)
const unsigned char *tzf;
timelib_tzinfo *tmp;
- if (seek_to_tz_position(&tzf, timezone, tzdb)) {
+ if (seek_to_tz_position((unsigned char**) &tzf, timezone, tzdb)) {
tmp = timelib_tzinfo_ctor(timezone);
read_header((char**) &tzf, tmp);
-static const timelib_tzdb_index_entry timezonedb_idx_builtin[538] = {
+const timelib_tzdb_index_entry timezonedb_idx_builtin[538] = {
{ "Africa/Abidjan" , 0x000000 },
{ "Africa/Accra" , 0x000049 },
{ "Africa/Addis_Ababa" , 0x0000E5 },
{ "Zulu" , 0x03904E },
};
/* This is a generated file, do not modify */
-static const unsigned char timelib_timezone_db_data_builtin[233606] = {
+const unsigned char timelib_timezone_db_data_builtin[233606] = {
/* Africa/Abidjan */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, };
-static const timelib_tzdb timezonedb_builtin = { "2006.1", 538, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
+const timelib_tzdb timezonedb_builtin = { "2006.1", 538, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
static PHP_GINIT_FUNCTION(date);
/* True global */
-static timelib_tzdb *php_date_global_timezone_db;
-static int php_date_global_timezone_db_enabled;
+timelib_tzdb *php_date_global_timezone_db;
+int php_date_global_timezone_db_enabled;
#define DATE_DEFAULT_LATITUDE "31.7667"
#define DATE_DEFAULT_LONGITUDE "35.2333"
/* {{{ date() and gmdate() data */
#include "ext/standard/php_smart_str.h"
-static const char *mon_full_names[] = {
+static char *mon_full_names[] = {
"January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December"
};
-static const char *mon_short_names[] = {
+static char *mon_short_names[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
-static const char *day_full_names[] = {
+static char *day_full_names[] = {
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
};
-static const char *day_short_names[] = {
+static char *day_short_names[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
-static const char *english_suffix(timelib_sll number)
+static char *english_suffix(timelib_sll number)
{
if (number >= 10 && number <= 19) {
return "th";
/* }}} */
/* {{{ day of week helpers */
-static const char *php_date_full_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
+char *php_date_full_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
{
timelib_sll day_of_week = timelib_day_of_week(y, m, d);
if (day_of_week < 0) {
return "Unknown";
}
- return day_full_names[day_of_week];
+ return day_full_names[day_of_week];
}
-static const char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
+char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
{
timelib_sll day_of_week = timelib_day_of_week(y, m, d);
if (day_of_week < 0) {