TZ-Lib
$VERSION$
|
Classes | |
union | input_buffer |
union | local_storage |
struct | lsinfo |
struct | rule |
struct | state |
struct | ttinfo |
Macros | |
#define | BIGGEST(a, b) (((a) > (b)) ? (a) : (b)) |
#define | gmtptr (&gmtmem) |
#define | lclptr (&lclmem) |
#define | LOCALTIME_IMPLEMENTATION |
#define | MY_TZNAME_MAX 255 |
#define | NETBSD_INSPIRED_EXTERN |
#define | OPEN_MODE O_RDONLY |
#define | SMALLEST(a, b) (((a) < (b)) ? (a) : (b)) |
#define | TZ_ABBR_CHAR_SET "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 :+-._" |
#define | TZ_ABBR_ERR_CHAR '_' |
#define | TZ_ABBR_MAX_LEN 16 |
#define | TZ_STRLEN_MAX 255 |
#define | TZDEFRULESTRING ",M4.1.0,M10.5.0" |
#define | WILDABBR " " |
#define | WRONG (-1) |
Enumerations | |
enum | r_type { JULIAN_DAY, DAY_OF_YEAR, MONTH_NTH_DAY_OF_WEEK } |
Functions | |
char * | ctime (const time_t *timep) |
char * | ctime_r (const time_t *timep, char *buf) |
static int_fast32_t | detzcode (const char *const codep) |
static int_fast64_t | detzcode64 (const char *const codep) |
static bool | differ_by_repeat (const time_t t1, const time_t t0) |
static const char * | getnum (register const char *strp, int *const nump, const int min, const int max) |
static const char * | getoffset (register const char *strp, int_fast32_t *const offsetp) |
static const char *ATTRIBUTE_PURE | getqzname (register const char *strp, const int delim) |
static const char * | getrule (const char *strp, register struct rule *const rulep) |
static const char * | getsecs (register const char *strp, int_fast32_t *const secsp) |
static const char *ATTRIBUTE_PURE | getzname (register const char *strp) |
static void | gmtcheck (void) |
struct tm * | gmtime (const time_t *timep) |
struct tm * | gmtime_r (const time_t *timep, struct tm *tmp) |
static void | gmtload (struct state *const sp) |
static struct tm * | gmtsub (struct state const *, time_t const *, int_fast32_t, struct tm *) |
static bool | increment_overflow (int *, int) |
static bool | increment_overflow32 (int_fast32_t *const lp, int const m) |
static bool | increment_overflow_time (time_t *, int_fast32_t) |
static void | init_ttinfo (struct ttinfo *s, int_fast32_t gmtoff, bool isdst, int abbrind) |
static int ATTRIBUTE_PURE | leaps_thru_end_of (register const int y) |
static struct tm * | localsub (struct state const *sp, time_t const *timep, int_fast32_t setname, struct tm *const tmp) |
struct tm * | localtime (const time_t *timep) |
struct tm * | localtime_r (const time_t *timep, struct tm *tmp) |
struct tm * | localtime_rz (struct state *sp, time_t const *timep, struct tm *tmp) |
static struct tm * | localtime_tzset (time_t const *timep, struct tm *tmp, bool setname) |
static int | lock (void) |
time_t | mktime (struct tm *tmp) |
static time_t | mktime_tzname (struct state *sp, struct tm *tmp, bool setname) |
time_t | mktime_z (struct state *sp, struct tm *tmp) |
static bool | normalize_overflow (int *const tensptr, int *const unitsptr, const int base) |
static bool | normalize_overflow32 (int_fast32_t *, int *, int) |
static void | scrub_abbrs (struct state *sp) |
static void | settzname (void) |
static time_t | time1 (struct tm *const tmp, struct tm *(*funcp)(struct state const *, time_t const *, int_fast32_t, struct tm *), struct state const *sp, const int_fast32_t offset) |
static time_t | time2 (struct tm *const tmp, struct tm *(*funcp)(struct state const *, time_t const *, int_fast32_t, struct tm *), struct state const *sp, const int_fast32_t offset, bool *okayp) |
static time_t | time2sub (struct tm *const tmp, struct tm *(*funcp)(struct state const *, time_t const *, int_fast32_t, struct tm *), struct state const *sp, const int_fast32_t offset, bool *okayp, bool do_norm_secs) |
static struct tm * | timesub (time_t const *, int_fast32_t, struct state const *, struct tm *) |
static int | tmcomp (register const struct tm *const atmp, register const struct tm *const btmp) |
static int_fast32_t ATTRIBUTE_PURE | transtime (const int year, register const struct rule *const rulep, const int_fast32_t offset) |
static bool | typesequiv (struct state const *, int, int) |
timezone_t | tzalloc (char const *name) |
void | tzfree (timezone_t sp) |
static int | tzload (char const *name, struct state *sp, bool doextend) |
static int | tzloadbody (char const *name, struct state *sp, bool doextend, union local_storage *lsp) |
static bool | tzparse (char const *, struct state *, bool) |
void | tzset (void) |
static void | tzset_unlocked (void) |
static void | tzsetlcl (char const *name) |
static void | unlock (void) |
static void | update_tzname_etc (struct state const *sp, struct ttinfo const *ttisp) |
static int | zoneinit (struct state *sp, char const *name) |
Variables | |
static const char | gmt [] = "GMT" |
static struct state | gmtmem |
static int | lcl_is_set |
static char | lcl_TZname [TZ_STRLEN_MAX+1] |
static struct state | lclmem |
static const int | mon_lengths [2][MONSPERYEAR] |
static struct tm | tm |
static const char | wildabbr [] = WILDABBR |
static const int | year_lengths [2] |
#define BIGGEST | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
Referenced by time2sub().
#define gmtptr (&gmtmem) |
#define lclptr (&lclmem) |
Referenced by settzname(), and tzsetlcl().
#define LOCALTIME_IMPLEMENTATION |
#define MY_TZNAME_MAX 255 |
#define NETBSD_INSPIRED_EXTERN |
#define OPEN_MODE O_RDONLY |
Referenced by tzloadbody().
#define SMALLEST | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
Referenced by time2sub().
#define TZ_ABBR_CHAR_SET "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 :+-._" |
Referenced by scrub_abbrs().
#define TZ_ABBR_ERR_CHAR '_' |
Referenced by scrub_abbrs().
#define TZ_ABBR_MAX_LEN 16 |
Referenced by scrub_abbrs().
#define TZ_STRLEN_MAX 255 |
#define TZDEFRULESTRING ",M4.1.0,M10.5.0" |
Referenced by tzparse().
#define WILDABBR " " |
#define WRONG (-1) |
Referenced by time1(), and time2sub().
enum r_type |
char* ctime | ( | const time_t * | timep | ) |
References asctime(), localtime(), and tm.
char* ctime_r | ( | const time_t * | timep, |
char * | buf | ||
) |
References asctime_r(), localtime_r(), and tm.
|
static |
References TWOS_COMPLEMENT.
Referenced by tzloadbody().
|
static |
References int_fast64_t, TWOS_COMPLEMENT, and uint_fast64_t.
Referenced by tzloadbody().
|
static |
References SECSPERREPEAT, SECSPERREPEAT_BITS, TYPE_BIT, and TYPE_SIGNED.
Referenced by tzloadbody().
|
static |
|
static |
|
static |
Referenced by tzparse().
|
static |
References DAY_OF_YEAR, DAYSPERLYEAR, DAYSPERNYEAR, DAYSPERWEEK, getnum(), getoffset(), is_digit, JULIAN_DAY, MONSPERYEAR, MONTH_NTH_DAY_OF_WEEK, rule::r_day, rule::r_mon, rule::r_time, rule::r_type, rule::r_week, and SECSPERHOUR.
Referenced by tzparse().
|
static |
References DAYSPERWEEK, getnum(), HOURSPERDAY, MINSPERHOUR, SECSPERHOUR, and SECSPERMIN.
Referenced by getoffset().
|
static |
|
static |
References gmtload(), lock(), and unlock().
Referenced by gmtime_r(), and mktime_tzname().
struct tm* gmtime | ( | const time_t * | timep | ) |
References gmtime_r(), and tm.
References gmtcheck(), and gmtsub().
Referenced by gmtime(), and my_gmtime_r().
|
static |
References gmt, tzload(), and tzparse().
Referenced by gmtcheck().
|
static |
References state::chars, gmt, timesub(), tm, and wildabbr.
Referenced by gmtime_r(), localsub(), and mktime_tzname().
|
static |
Referenced by normalize_overflow(), time2sub(), and timesub().
|
static |
References INT_FAST32_MAX, and INT_FAST32_MIN.
Referenced by normalize_overflow32(), and time2sub().
|
static |
References time_t_max, time_t_min, and TYPE_SIGNED.
Referenced by time2sub(), and tzparse().
|
static |
References gmtoff(), ttinfo::tt_abbrind, ttinfo::tt_gmtoff, ttinfo::tt_isdst, ttinfo::tt_ttisgmt, and ttinfo::tt_ttisstd.
Referenced by tzparse(), and zoneinit().
|
static |
Referenced by timesub().
|
static |
References state::ats, AVGSECSPERYEAR, state::chars, state::defaulttype, gmtsub(), state::goahead, state::goback, int_fast64_t, SECSPERREPEAT, state::timecnt, timesub(), tm, ttinfo::tt_abbrind, ttinfo::tt_gmtoff, ttinfo::tt_isdst, state::ttis, state::types, update_tzname_etc(), and YEARSPERREPEAT.
Referenced by localtime_rz(), localtime_tzset(), and mktime_tzname().
struct tm* localtime | ( | const time_t * | timep | ) |
References localtime_tzset(), and tm.
Referenced by ctime(), display(), and localtime_r().
References localtime_tzset().
Referenced by ctime_r().
References localsub().
References localsub(), lock(), tzset_unlocked(), and unlock().
Referenced by localtime(), and localtime_r().
|
static |
Referenced by gmtcheck(), localtime_tzset(), mktime(), and tzset().
time_t mktime | ( | struct tm * | tmp | ) |
References lock(), mktime_tzname(), tzset_unlocked(), and unlock().
Referenced by _fmt().
References gmtcheck(), gmtsub(), localsub(), and time1().
Referenced by mktime(), and mktime_z().
References mktime_tzname().
|
static |
References increment_overflow().
Referenced by time2sub().
|
static |
References increment_overflow32().
Referenced by time2sub().
|
static |
References state::charcnt, state::chars, GRANDPARENTED, ttinfo::tt_abbrind, state::ttis, state::typecnt, TZ_ABBR_CHAR_SET, TZ_ABBR_ERR_CHAR, and TZ_ABBR_MAX_LEN.
Referenced by zoneinit().
|
static |
References gmt, lclptr, state::timecnt, ttinfo::tt_isdst, state::ttis, state::typecnt, state::types, update_tzname_etc(), and wildabbr.
Referenced by tzsetlcl().
|
static |
References time2(), state::timecnt, ttinfo::tt_gmtoff, ttinfo::tt_isdst, state::ttis, state::typecnt, state::types, TZ_MAX_TYPES, and WRONG.
Referenced by difftime(), and mktime_tzname().
|
static |
References time2sub().
Referenced by time1().
|
static |
References BIGGEST, DAYSPERLYEAR, EPOCH_YEAR, HOURSPERDAY, increment_overflow(), increment_overflow32(), increment_overflow_time(), INT_FAST32_MAX, INT_FAST32_MIN, isleap, MINSPERHOUR, MONSPERYEAR, normalize_overflow(), normalize_overflow32(), SECSPERDAY, SECSPERMIN, SMALLEST, time_t_max, time_t_min, tm, TM_YEAR_BASE, tmcomp(), ttinfo::tt_gmtoff, ttinfo::tt_isdst, state::ttis, state::typecnt, and WRONG.
Referenced by time2().
|
static |
References corr, DAYSPERLYEAR, DAYSPERNYEAR, DAYSPERWEEK, EOVERFLOW, EPOCH_WDAY, EPOCH_YEAR, increment_overflow(), int_fast64_t, isleap, state::leapcnt, leaps_thru_end_of(), lsinfo::ls_corr, lsinfo::ls_trans, state::lsis, SECSPERDAY, SECSPERHOUR, SECSPERMIN, TM_YEAR_BASE, and TYPE_SIGNED.
Referenced by gmtsub(), and localsub().
|
static |
Referenced by time2sub().
|
static |
References DAY_OF_YEAR, DAYSPERWEEK, INITIALIZE, isleap, JULIAN_DAY, MONTH_NTH_DAY_OF_WEEK, rule::r_day, rule::r_mon, rule::r_time, rule::r_type, rule::r_week, and SECSPERDAY.
Referenced by tzparse().
References state::chars, ttinfo::tt_abbrind, ttinfo::tt_gmtoff, ttinfo::tt_isdst, ttinfo::tt_ttisgmt, ttinfo::tt_ttisstd, state::ttis, and state::typecnt.
Referenced by tzloadbody().
timezone_t tzalloc | ( | char const * | name | ) |
References zoneinit().
void tzfree | ( | timezone_t | sp | ) |
References tzloadbody().
Referenced by gmtload(), tzparse(), and zoneinit().
|
static |
References state::ats, input_buffer::buf, state::charcnt, charcnt, state::chars, corr, state::defaulttype, detzcode(), detzcode64(), differ_by_repeat(), ENAMETOOLONG, local_storage::fullname, state::goahead, state::goback, int_fast64_t, state::leapcnt, leapcnt, lsinfo::ls_corr, lsinfo::ls_trans, state::lsis, OPEN_MODE, R_OK, time_t_max, time_t_min, state::timecnt, timecnt, trans, ttinfo::tt_abbrind, ttinfo::tt_gmtoff, ttinfo::tt_isdst, ttinfo::tt_ttisgmt, ttinfo::tt_ttisstd, state::ttis, TYPE_SIGNED, state::typecnt, typecnt, state::types, typesequiv(), TZ_MAX_CHARS, TZ_MAX_LEAPS, TZ_MAX_TIMES, TZ_MAX_TYPES, TZDEFAULT, TZDIR, tzhead::tzh_charcnt, tzhead::tzh_leapcnt, tzhead::tzh_timecnt, tzhead::tzh_ttisgmtcnt, tzhead::tzh_ttisstdcnt, tzhead::tzh_typecnt, tzhead::tzh_version, input_buffer::tzhead, tzparse(), and local_storage::u.
Referenced by tzload().
References state::ats, state::charcnt, charcnt, state::chars, state::defaulttype, EPOCH_YEAR, getoffset(), getqzname(), getrule(), getzname(), gmt, increment_overflow_time(), init_ttinfo(), isleap, state::leapcnt, SECSPERDAY, SECSPERHOUR, state::timecnt, timecnt, transtime(), ttinfo::tt_gmtoff, ttinfo::tt_isdst, ttinfo::tt_ttisgmt, ttinfo::tt_ttisstd, state::ttis, state::typecnt, state::types, TZ_MAX_TIMES, TZDEFRULES, TZDEFRULESTRING, tzload(), and YEARSPERREPEAT.
Referenced by gmtload(), tzloadbody(), and zoneinit().
void tzset | ( | void | ) |
References lock(), tzset_unlocked(), and unlock().
Referenced by strftime(), and tzalloc().
|
static |
References tzsetlcl().
Referenced by localtime_tzset(), mktime(), and tzset().
|
static |
References lclptr, settzname(), and zoneinit().
Referenced by tzset_unlocked().
|
static |
Referenced by gmtcheck(), localtime_tzset(), mktime(), and tzset().
References state::chars, ttinfo::tt_abbrind, ttinfo::tt_gmtoff, and ttinfo::tt_isdst.
Referenced by localsub(), and settzname().
|
static |
References state::charcnt, state::chars, state::defaulttype, gmt, state::goahead, state::goback, init_ttinfo(), state::leapcnt, scrub_abbrs(), state::timecnt, state::ttis, state::typecnt, tzload(), and tzparse().
Referenced by tzalloc(), and tzsetlcl().
|
static |
Referenced by gmtload(), gmtsub(), settzname(), tzparse(), and zoneinit().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Referenced by _fmt(), ctime(), ctime_r(), display(), gmtime(), gmtoff(), gmtsub(), hunt(), localsub(), localtime(), localtime_r(), main(), parseTime(), show(), time2sub(), timeout(), and TimeStamp::TimeStamp().
|
static |
Referenced by gmtsub(), and settzname().
|
static |