25#ifndef __TIMELIB_PRIVATE_H__
26#define __TIMELIB_PRIVATE_H__
28#ifdef HAVE_TIMELIB_CONFIG_H
29# include "timelib_config.h"
37# ifdef HAVE_WINSOCK2_H
44#ifdef HAVE_SYS_TYPES_H
48#if defined(HAVE_STDINT_H)
67#define TIMELIB_SECOND 1
68#define TIMELIB_MINUTE 2
71#define TIMELIB_MONTH 5
73#define TIMELIB_WEEKDAY 7
74#define TIMELIB_SPECIAL 8
75#define TIMELIB_MICROSEC 9
77#define TIMELIB_SPECIAL_WEEKDAY 0x01
78#define TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH 0x02
79#define TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH 0x03
81#define TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH 0x01
82#define TIMELIB_SPECIAL_LAST_DAY_OF_MONTH 0x02
84#define TIMELIB_TIME_PART_DONT_KEEP 0x00
85#define TIMELIB_TIME_PART_KEEP 0x01
87#define MINS_PER_HOUR 60
88#define SECS_PER_ERA TIMELIB_LL_CONST(12622780800)
89#define SECS_PER_DAY 86400
90#define SECS_PER_HOUR 3600
91#define USECS_PER_HOUR TIMELIB_LL_CONST(3600000000)
93#define DAYS_PER_WEEK 7
94#define DAYS_PER_YEAR 365
95#define DAYS_PER_LYEAR 366
96#define MONTHS_PER_YEAR 12
98#define DAYS_PER_ERA 146097
99#define YEARS_PER_ERA 400
100#define HINNANT_EPOCH_SHIFT 719468
102#define TIMELIB_TZINFO_PHP 0x01
103#define TIMELIB_TZINFO_ZONEINFO 0x02
105#define timelib_is_leap(y) ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
107#define TIMELIB_DEBUG(s) if (0) { s }
109#define TIMELIB_TIME_FREE(m) \
115#if defined (__GNUC__)
116# define TIMELIB_GNUC_CHECK_VERSION(major, minor) \
117 ((__GNUC__ > (major)) || \
118 ((__GNUC__ == (major)) && (__GNUC_MINOR__ >= (minor))))
120# define TIMELIB_GNUC_CHECK_VERSION(major, minor) 0
123#if TIMELIB_GNUC_CHECK_VERSION(7, 0)
124# define TIMELIB_BREAK_INTENTIONALLY_MISSING __attribute__ ((fallthrough));
126# define TIMELIB_BREAK_INTENTIONALLY_MISSING
129#if defined(__has_builtin)
130# if __has_builtin(__builtin_saddll_overflow)
131# define TIMELIB_HAVE_BUILTIN_SADDLL_OVERFLOW 1
135#ifndef TIMELIB_HAVE_BUILTIN_SADDLL_OVERFLOW
136# define TIMELIB_HAVE_BUILTIN_SADDLL_OVERFLOW 0
156#define LONG_MAX 2147483647L
160#define LONG_MIN (- LONG_MAX - 1)
localtime(?int $timestamp=null, bool $associative=false)
struct _timelib_time timelib_time
signed long long timelib_sll
struct _timelib_tzinfo timelib_tzinfo
int timelib_strncasecmp(const char *s1, const char *s2, size_t n)
ttinfo * timelib_fetch_posix_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib_sll *transition_time)
timelib_sll timelib_ts_at_start_of_year(timelib_sll year)
int timelib_strcasecmp(const char *s1, const char *s2)
void timelib_time_tz_abbr_update(timelib_time *tm, const char *tz_abbr)
int timelib_apply_localtime(timelib_time *t, unsigned int localtime)
ttinfo * timelib_fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib_sll *transition_time)