PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include "pgtz.h"
Go to the source code of this file.
Data Structures | |
struct | tztry |
Macros | |
#define | T_DAY ((time_t) (60*60*24)) |
#define | T_WEEK ((time_t) (60*60*24*7)) |
#define | T_MONTH ((time_t) (60*60*24*31)) |
#define | MAX_TEST_TIMES (52*100) /* 100 years */ |
Functions | |
const char * | select_default_timezone (const char *share_path) |
static const char * | pg_TZDIR (void) |
int | pg_open_tzfile (const char *name, char *canonname) |
static pg_tz * | pg_load_tz (const char *name) |
static bool | check_system_link_file (const char *linkname, struct tztry *tt, char *bestzonename) |
static void | scan_available_timezones (char *tzdir, char *tzdirsub, struct tztry *tt, int *bestscore, char *bestzonename) |
static int | get_timezone_offset (struct tm *tm) |
static time_t | build_time_t (int year, int month, int day) |
static bool | compare_tm (struct tm *s, struct pg_tm *p) |
static int | score_timezone (const char *tzname, struct tztry *tt) |
static bool | perfect_timezone_match (const char *tzname, struct tztry *tt) |
static const char * | identify_system_timezone (void) |
static int | zone_name_pref (const char *zonename) |
static bool | validate_zone (const char *tzname) |
Variables | |
static char | tzdirpath [MAXPGPATH] |
#define MAX_TEST_TIMES (52*100) /* 100 years */ |
Definition at line 156 of file findtimezone.c.
#define T_DAY ((time_t) (60*60*24)) |
Definition at line 152 of file findtimezone.c.
#define T_MONTH ((time_t) (60*60*24*31)) |
Definition at line 154 of file findtimezone.c.
#define T_WEEK ((time_t) (60*60*24*7)) |
Definition at line 153 of file findtimezone.c.
|
static |
Definition at line 190 of file findtimezone.c.
References tm, pg_tm::tm_isdst, pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
Referenced by identify_system_timezone().
|
static |
Definition at line 544 of file findtimezone.c.
References fprintf, len, MAXPGPATH, perfect_timezone_match(), readlink, and TZ_STRLEN_MAX.
Referenced by identify_system_timezone().
Definition at line 207 of file findtimezone.c.
References 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, and pg_tm::tm_year.
Referenced by score_timezone().
|
static |
Definition at line 175 of file findtimezone.c.
References TIMEZONE_GLOBAL, tm, and pg_tm::tm_gmtoff.
Referenced by identify_system_timezone().
|
static |
Definition at line 331 of file findtimezone.c.
References build_time_t(), check_system_link_file(), fprintf, get_timezone_offset(), MAX_TEST_TIMES, MAXPGPATH, tztry::n_test_times, pg_TZDIR(), scan_available_timezones(), score_timezone(), snprintf, strlcpy(), T_DAY, T_MONTH, T_WEEK, tztry::test_times, tm, pg_tm::tm_isdst, pg_tm::tm_year, and TZ_STRLEN_MAX.
Referenced by select_default_timezone().
Definition at line 320 of file findtimezone.c.
References tztry::n_test_times, and score_timezone().
Referenced by check_system_link_file().
|
static |
Definition at line 91 of file findtimezone.c.
References name, pg_tz::state, TZ_STRLEN_MAX, tzload(), pg_tz::TZname, and tzparse().
Referenced by score_timezone(), and validate_zone().
int pg_open_tzfile | ( | const char * | name, |
char * | canonname | ||
) |
Definition at line 65 of file findtimezone.c.
References MAXPGPATH, name, PG_BINARY, pg_TZDIR(), strlcpy(), and TZ_STRLEN_MAX.
Referenced by tzloadbody().
|
static |
Definition at line 37 of file findtimezone.c.
References tzdirpath.
Referenced by identify_system_timezone(), and pg_open_tzfile().
|
static |
Definition at line 657 of file findtimezone.c.
References fprintf, MAXPGPATH, name, pgfnames(), pgfnames_cleanup(), S_ISDIR, score_timezone(), snprintf, stat::st_mode, stat, strlcpy(), TZ_STRLEN_MAX, and zone_name_pref().
Referenced by identify_system_timezone().
|
static |
Definition at line 234 of file findtimezone.c.
References compare_tm(), fprintf, i, tztry::n_test_times, pg_load_tz(), pg_localtime(), pg_tz_acceptable(), tztry::test_times, tm, 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_year, pg_tm::tm_zone, and TZ_STRLEN_MAX.
Referenced by identify_system_timezone(), perfect_timezone_match(), and scan_available_timezones().
const char * select_default_timezone | ( | const char * | share_path | ) |
Definition at line 1757 of file findtimezone.c.
References identify_system_timezone(), share_path, snprintf, tzdirpath, and validate_zone().
Referenced by test_config_settings().
|
static |
Definition at line 1728 of file findtimezone.c.
References pg_load_tz(), and pg_tz_acceptable().
Referenced by select_default_timezone().
|
static |
|
static |
Definition at line 27 of file findtimezone.c.
Referenced by pg_TZDIR(), and select_default_timezone().