PostgreSQL Source Code
git master
|
#include "c.h"
#include <fcntl.h>
#include "datatype/timestamp.h"
#include "pgtz.h"
#include "private.h"
#include "tzfile.h"
Go to the source code of this file.
Data Structures | |
struct | rule |
union | input_buffer |
union | local_storage |
struct | local_storage::file_analysis |
Macros | |
#define | WILDABBR " " |
#define | TZDEFRULESTRING ",M3.2.0,M11.1.0" |
Enumerations | |
enum | r_type { JULIAN_DAY , DAY_OF_YEAR , MONTH_NTH_DAY_OF_WEEK } |
Functions | |
static struct pg_tm * | gmtsub (pg_time_t const *timep, int32 offset, struct pg_tm *tmp) |
static bool | increment_overflow (int *ip, int j) |
static bool | increment_overflow_time (pg_time_t *tp, int32 j) |
static int64 | leapcorr (struct state const *sp, pg_time_t t) |
static struct pg_tm * | timesub (pg_time_t const *timep, int32 offset, struct state const *sp, struct pg_tm *tmp) |
static bool | typesequiv (struct state const *sp, int a, int b) |
static void | init_ttinfo (struct ttinfo *s, int32 utoff, bool isdst, int desigidx) |
static int32 | detzcode (const char *const codep) |
static int64 | detzcode64 (const char *const codep) |
static bool | differ_by_repeat (const pg_time_t t1, const pg_time_t t0) |
static int | tzloadbody (char const *name, char *canonname, struct state *sp, bool doextend, union local_storage *lsp) |
int | tzload (const char *name, char *canonname, struct state *sp, bool doextend) |
static const char * | getzname (const char *strp) |
static const char * | getqzname (const char *strp, const int delim) |
static const char * | getnum (const char *strp, int *const nump, const int min, const int max) |
static const char * | getsecs (const char *strp, int32 *const secsp) |
static const char * | getoffset (const char *strp, int32 *const offsetp) |
static const char * | getrule (const char *strp, struct rule *const rulep) |
static int32 | transtime (const int year, const struct rule *const rulep, const int32 offset) |
bool | tzparse (const char *name, struct state *sp, bool lastditch) |
static void | gmtload (struct state *const sp) |
static struct pg_tm * | localsub (struct state const *sp, pg_time_t const *timep, struct pg_tm *const tmp) |
struct pg_tm * | pg_localtime (const pg_time_t *timep, const pg_tz *tz) |
struct pg_tm * | pg_gmtime (const pg_time_t *timep) |
static int | leaps_thru_end_of_nonneg (int y) |
static int | leaps_thru_end_of (const int y) |
int | pg_next_dst_boundary (const pg_time_t *timep, long int *before_gmtoff, int *before_isdst, pg_time_t *boundary, long int *after_gmtoff, int *after_isdst, const pg_tz *tz) |
bool | pg_interpret_timezone_abbrev (const char *abbrev, const pg_time_t *timep, long int *gmtoff, int *isdst, const pg_tz *tz) |
bool | pg_get_timezone_offset (const pg_tz *tz, long int *gmtoff) |
const char * | pg_get_timezone_name (pg_tz *tz) |
bool | pg_tz_acceptable (pg_tz *tz) |
Variables | |
static const char | wildabbr [] = WILDABBR |
static const char | gmt [] = "GMT" |
static struct pg_tm | tm |
static const int | mon_lengths [2][MONSPERYEAR] |
static const int | year_lengths [2] |
#define TZDEFRULESTRING ",M3.2.0,M11.1.0" |
Definition at line 61 of file localtime.c.
#define WILDABBR " " |
Definition at line 48 of file localtime.c.
enum r_type |
|
static |
Definition at line 118 of file localtime.c.
References i, and TWOS_COMPLEMENT.
Referenced by tzloadbody().
|
static |
Definition at line 144 of file localtime.c.
References i, and TWOS_COMPLEMENT.
Referenced by tzloadbody().
Definition at line 170 of file localtime.c.
References SECSPERREPEAT, SECSPERREPEAT_BITS, TYPE_BIT, and TYPE_SIGNED.
Referenced by tzloadbody().
|
static |
|
static |
|
static |
|
static |
Definition at line 778 of file localtime.c.
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 |
Definition at line 710 of file localtime.c.
References DAYSPERWEEK, getnum(), HOURSPERDAY, MINSPERHOUR, SECSPERHOUR, and SECSPERMIN.
Referenced by getoffset().
|
static |
|
static |
Definition at line 1245 of file localtime.c.
References gmt, tzload(), and tzparse().
Referenced by gmtsub().
Definition at line 1357 of file localtime.c.
References state::chars, gmtload(), malloc, timesub(), state::tmp, and wildabbr.
Referenced by localsub(), and pg_gmtime().
|
static |
Definition at line 1557 of file localtime.c.
References j, TIME_T_MAX, TIME_T_MIN, and TYPE_SIGNED.
Referenced by tzparse().
Definition at line 108 of file localtime.c.
References desigidx, ttinfo::tt_desigidx, ttinfo::tt_isdst, ttinfo::tt_ttisstd, ttinfo::tt_ttisut, and ttinfo::tt_utoff.
Referenced by tzparse().
Definition at line 1574 of file localtime.c.
References i, state::leapcnt, lsinfo::ls_corr, lsinfo::ls_trans, and state::lsis.
Referenced by tzloadbody().
|
static |
Definition at line 1406 of file localtime.c.
References leaps_thru_end_of_nonneg(), and y.
Referenced by timesub().
|
static |
|
static |
Definition at line 1259 of file localtime.c.
References state::ats, AVGSECSPERYEAR, state::chars, state::defaulttype, gmtsub(), state::goahead, state::goback, i, SECSPERREPEAT, state::timecnt, timesub(), pg_tm::tm_isdst, pg_tm::tm_year, pg_tm::tm_zone, ttinfo::tt_desigidx, ttinfo::tt_isdst, ttinfo::tt_utoff, state::ttis, state::types, unconstify, and YEARSPERREPEAT.
Referenced by pg_localtime().
const char* pg_get_timezone_name | ( | pg_tz * | tz | ) |
Definition at line 1875 of file localtime.c.
References pg_tz::TZname.
Referenced by show_log_timezone(), show_timezone(), and timetz_at_local().
Definition at line 1851 of file localtime.c.
References i, pg_tz::state, ttinfo::tt_utoff, state::ttis, and state::typecnt.
Referenced by DecodeTimeOnly(), and TimestampTimestampTzRequiresRewrite().
Definition at line 1389 of file localtime.c.
Referenced by AddFileToBackupManifest(), and GetEpochTime().
bool pg_interpret_timezone_abbrev | ( | const char * | abbrev, |
const pg_time_t * | timep, | ||
long int * | gmtoff, | ||
int * | isdst, | ||
const pg_tz * | tz | ||
) |
Definition at line 1757 of file localtime.c.
References state::charcnt, charcnt, state::chars, i, pg_tz::state, state::timecnt, ttinfo::tt_desigidx, ttinfo::tt_isdst, ttinfo::tt_utoff, state::ttis, and state::types.
Referenced by DetermineTimeZoneAbbrevOffsetInternal().
Definition at line 1344 of file localtime.c.
References localsub(), pg_tz::state, and tm.
Referenced by build_backup_content(), get_formatted_log_time(), get_formatted_start_time(), log_status_format(), logfile_getname(), score_timezone(), set_next_rotation_time(), str_time(), timeofday(), and timestamp2tm().
int pg_next_dst_boundary | ( | const pg_time_t * | timep, |
long int * | before_gmtoff, | ||
int * | before_isdst, | ||
pg_time_t * | boundary, | ||
long int * | after_gmtoff, | ||
int * | after_isdst, | ||
const pg_tz * | tz | ||
) |
Definition at line 1610 of file localtime.c.
References state::ats, AVGSECSPERYEAR, state::goahead, state::goback, i, j, pg_next_dst_boundary(), pg_tz::state, state::timecnt, ttinfo::tt_isdst, ttinfo::tt_utoff, state::ttis, state::typecnt, state::types, and YEARSPERREPEAT.
Referenced by DetermineTimeZoneOffsetInternal(), and pg_next_dst_boundary().
Definition at line 1890 of file localtime.c.
Referenced by check_log_timezone(), check_timezone(), pg_tzenumerate_next(), score_timezone(), and validate_zone().
|
static |
Definition at line 1414 of file localtime.c.
References corr, DAYSPERLYEAR, DAYSPERNYEAR, DAYSPERWEEK, EOVERFLOW, EPOCH_WDAY, EPOCH_YEAR, i, increment_overflow(), isleap, state::leapcnt, leaps_thru_end_of(), lsinfo::ls_corr, lsinfo::ls_trans, state::lsis, mon_lengths, SECSPERDAY, SECSPERHOUR, SECSPERMIN, pg_tm::tm_gmtoff, pg_tm::tm_hour, pg_tm::tm_isdst, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_wday, pg_tm::tm_yday, pg_tm::tm_year, TM_YEAR_BASE, TYPE_SIGNED, while(), y, and year_lengths.
Referenced by gmtsub(), and localsub().
|
static |
Definition at line 839 of file localtime.c.
References DAY_OF_YEAR, DAYSPERWEEK, i, INITIALIZE, isleap, JULIAN_DAY, mon_lengths, MONTH_NTH_DAY_OF_WEEK, rule::r_day, rule::r_mon, rule::r_time, rule::r_type, rule::r_week, SECSPERDAY, and value.
Referenced by tzparse().
Definition at line 602 of file localtime.c.
References a, b, state::chars, ttinfo::tt_desigidx, ttinfo::tt_isdst, ttinfo::tt_ttisstd, ttinfo::tt_ttisut, ttinfo::tt_utoff, state::ttis, and state::typecnt.
Referenced by tzloadbody().
Definition at line 586 of file localtime.c.
References err(), free, malloc, name, and tzloadbody().
Referenced by gmtload(), pg_load_tz(), pg_tzenumerate_next(), and pg_tzset().
|
static |
Definition at line 211 of file localtime.c.
References state::ats, input_buffer::buf, state::charcnt, charcnt, state::chars, close, corr, state::defaulttype, desigidx, detzcode(), detzcode64(), differ_by_repeat(), err(), for(), state::goahead, state::goback, i, j, state::leapcnt, leapcnt, leapcorr(), lsinfo::ls_corr, lsinfo::ls_trans, state::lsis, name, pg_open_tzfile(), read, SECSPERDAY, local_storage::file_analysis::st, TIME_T_MAX, TIME_T_MIN, state::timecnt, timecnt, ttinfo::tt_desigidx, ttinfo::tt_isdst, ttinfo::tt_ttisstd, ttinfo::tt_ttisut, ttinfo::tt_utoff, state::ttis, TYPE_SIGNED, state::typecnt, typecnt, state::types, typesequiv(), TZ_MAX_CHARS, TZ_MAX_LEAPS, TZ_MAX_TIMES, TZ_MAX_TYPES, TZDEFAULT, tzhead::tzh_charcnt, tzhead::tzh_leapcnt, tzhead::tzh_timecnt, tzhead::tzh_ttisstdcnt, tzhead::tzh_ttisutcnt, tzhead::tzh_typecnt, tzhead::tzh_version, input_buffer::tzhead, tzparse(), local_storage::file_analysis::u, and local_storage::u.
Referenced by tzload().
Definition at line 936 of file localtime.c.
References state::ats, state::charcnt, charcnt, state::chars, state::defaulttype, EPOCH_YEAR, getoffset(), getqzname(), getrule(), getzname(), state::goahead, state::goback, i, if(), increment_overflow_time(), init_ttinfo(), isleap, j, state::leapcnt, name, SECSPERDAY, SECSPERHOUR, start, state::timecnt, timecnt, transtime(), ttinfo::tt_isdst, ttinfo::tt_ttisstd, ttinfo::tt_ttisut, ttinfo::tt_utoff, state::ttis, state::typecnt, state::types, TZ_MAX_TIMES, TZDEFRULESTRING, year_lengths, and YEARSPERREPEAT.
Referenced by gmtload(), pg_load_tz(), pg_tzset(), and tzloadbody().
|
static |
Definition at line 53 of file localtime.c.
Referenced by gbt_tstz_compress(), and gmtload().
|
static |
Definition at line 626 of file localtime.c.
Referenced by timesub(), and transtime().
|
static |
Definition at line 93 of file localtime.c.
Referenced by abstime2tm(), AdjustFractDays(), AdjustFractSeconds(), AppendTimestampSeconds(), build_time_t(), cache_locale_time(), check_recovery_target_time(), ClearPgTm(), createBackupLabel(), date2timestamptz_opt_overflow(), date_in(), date_out(), DCH_to_char(), DecodeDate(), DecodeDateTime(), DecodeInterval(), DecodeISO8601Interval(), DecodeNumber(), DecodeNumberField(), DecodeTime(), DecodeTimeOnly(), DetermineTimeZoneAbbrevOffset(), DetermineTimeZoneAbbrevOffsetTS(), DetermineTimeZoneOffset(), DetermineTimeZoneOffsetInternal(), do_to_timestamp(), dttofmtasc_replace(), EncodeDateOnly(), EncodeDateTime(), EncodeInterval(), EncodeTimeOnly(), executeDateTimeMethod(), gbt_num_compress(), get_timezone_offset(), GetCurrentDateTime(), GetCurrentTimeUsec(), GetEpochTime(), GetSQLCurrentDate(), GetSQLCurrentTime(), GetSQLLocalTime(), identify_system_timezone(), interval2tm(), interval_part_common(), interval_to_char(), interval_trunc(), JsonEncodeDateTime(), llvm_create_jit_instance(), locale_date_order(), make_date(), make_timestamp_internal(), map_sql_value_to_xml_value(), my_strftime(), parse_datetime(), parse_sane_timezone(), pg_gmtime(), pg_localtime(), PGTYPESdate_defmt_asc(), PGTYPESdate_fmt_asc(), PGTYPESdate_from_asc(), PGTYPESdate_to_asc(), PGTYPESdate_today(), PGTYPESinterval_from_asc(), PGTYPESinterval_to_asc(), PGTYPEStimestamp_add_interval(), PGTYPEStimestamp_current(), PGTYPEStimestamp_defmt_scan(), PGTYPEStimestamp_fmt_asc(), PGTYPEStimestamp_from_asc(), PGTYPEStimestamp_to_asc(), pqTraceFormatTimestamp(), ReadHead(), score_timezone(), set_next_rotation_time(), SetEpochTimestamp(), tarOpen(), time2tm(), time_in(), time_out(), time_part_common(), time_t_to_timestamptz(), time_timetz(), timestamp2timestamptz_opt_overflow(), timestamp2tm(), timestamp_age(), timestamp_date(), timestamp_in(), timestamp_out(), timestamp_part_common(), timestamp_pl_interval(), timestamp_recv(), timestamp_time(), timestamp_to_char(), timestamp_trunc(), timestamp_zone(), timestamptz2timestamp(), timestamptz_age(), timestamptz_date(), timestamptz_in(), timestamptz_out(), timestamptz_part_common(), timestamptz_pl_interval_internal(), timestamptz_recv(), timestamptz_time(), timestamptz_timetz(), timestamptz_to_char(), timestamptz_to_str(), timestamptz_trunc_internal(), timestamptz_zone(), timetz2tm(), timetz_in(), timetz_out(), timetz_part_common(), timetz_zone(), tm2interval(), tm2time(), tm2timestamp(), tm2timetz(), to_date(), to_timestamp(), typenameTypeMod(), ValidateDate(), WriteHead(), and writezone().
|
static |
Definition at line 51 of file localtime.c.
Referenced by gmtsub().
|
static |
Definition at line 631 of file localtime.c.