TZ-Lib
$VERSION$
|
#include "version.h"
#include "private.h"
#include "stdio.h"
#include "string.h"
#include "sys/types.h"
#include "time.h"
#include "stdlib.h"
#include "limits.h"
#include <errno.h>
Macros | |
#define | __EXTENSIONS__ 1 |
#define | _GNU_SOURCE 1 |
#define | ATTRIBUTE_PURE /* empty */ |
#define | bool int |
#define | DAYSPERNYEAR 365 |
#define | DIVISOR 10 |
#define | EPOCH_YEAR 1970 |
#define | EXIT_FAILURE 1 |
#define | EXIT_SUCCESS 0 |
#define | false 0 |
#define | HAVE_LOCALTIME_R 1 |
#define | HAVE_LOCALTIME_RZ 0 |
#define | HAVE_TZSET 1 |
#define | HOURSPERDAY 24 |
#define | is_digit(c) ((unsigned)(c) - '0' <= 9) |
#define | isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) |
#define | isleap_sum(a, b) isleap((a) % 400 + (b) % 400) |
#define | localtime_r zdump_localtime_r |
#define | localtime_rz zdump_localtime_rz |
#define | MAX_STRING_LENGTH 1024 |
#define | MINSPERHOUR 60 |
#define | my_localtime_rz localtime_rz |
#define | SECSPER400YEARS |
#define | SECSPERDAY ((int_fast32_t) SECSPERHOUR * HOURSPERDAY) |
#define | SECSPERHOUR (SECSPERMIN * MINSPERHOUR) |
#define | SECSPERLYEAR (SECSPERNYEAR + SECSPERDAY) |
#define | SECSPERMIN 60 |
#define | SECSPERNYEAR (SECSPERDAY * DAYSPERNYEAR) |
#define | timezone_t char ** |
#define | TM_YEAR_BASE 1900 |
#define | true 1 |
#define | tzalloc zdump_tzalloc |
#define | tzfree zdump_tzfree |
#define | USE_LOCALTIME_RZ false |
#define | USE_LTZ 1 |
#define | ZDUMP_HI_YEAR 2500 |
#define | ZDUMP_LO_YEAR (-500) |
Enumerations | |
enum | |
enum | { atime_shift = CHAR_BIT * sizeof (time_t) - 2 } |
Functions | |
static char const * | abbr (struct tm const *) |
static void | abbrok (const char *const abbrp, const char *const zone) |
static int | adjusted_yday (struct tm const *a, struct tm const *b) |
static void | close_file (FILE *stream) |
static intmax_t | delta (struct tm *, struct tm *) |
static void | dumptime (register const struct tm *timeptr) |
static int | format_local_time (char *buf, size_t size, struct tm const *tm) |
static size_t | format_quoted_string (char *buf, size_t size, char const *p) |
static int | format_utc_offset (char *buf, size_t size, struct tm const *tm, time_t t) |
static long | gmtoff (struct tm const *a, time_t *t, struct tm const *b) |
static void | gmtzinit (void) |
static time_t | hunt (timezone_t tz, char *name, time_t lot, time_t hit) |
static bool | istrftime (char *buf, size_t size, char const *time_fmt, struct tm const *tm, time_t t, char const *ab, char const *zone_name) |
static struct tm * | localtime_r (time_t *tp, struct tm *tmp) |
static struct tm * | localtime_rz (timezone_t rz, time_t *tp, struct tm *tmp) |
int | main (int argc, char *argv[]) |
static struct tm * | my_gmtime_r (time_t *tp, struct tm *tmp) |
static char const * | saveabbr (char **buf, size_t *bufalloc, struct tm const *tmp) |
static void | show (timezone_t tz, char *zone, time_t t, bool v) |
static void | showtrans (char const *time_fmt, struct tm const *tm, time_t t, char const *ab, char const *zone_name) |
static size_t | sumsize (size_t a, size_t b) |
static const char * | tformat (void) |
static timezone_t | tzalloc (char const *val) |
static void | tzfree (timezone_t env) |
static void | usage (FILE *const stream, const int status) |
static void * | xmalloc (size_t size) |
static time_t | yeartot (intmax_t y) |
Variables | |
static time_t const | absolute_max_time |
static time_t const | absolute_min_time |
char ** | environ |
static bool | errout |
static timezone_t | gmtz |
static int | longest |
static char * | progname |
static bool | warned |
#define __EXTENSIONS__ 1 |
#define _GNU_SOURCE 1 |
#define ATTRIBUTE_PURE /* empty */ |
#define bool int |
#define DAYSPERNYEAR 365 |
#define DIVISOR 10 |
Referenced by dumptime().
#define EPOCH_YEAR 1970 |
Referenced by yeartot().
#define EXIT_FAILURE 1 |
Referenced by addtype(), associate(), change_directory(), close_file(), dolink(), errensure(), getfields(), gmtzinit(), infile(), leapadd(), main(), memory_exhausted(), mkdirs(), newabbr(), rpytime(), rulesub(), sumsize(), time_overflow(), writezone(), xmalloc(), and yearistype().
#define EXIT_SUCCESS 0 |
Referenced by errensure(), main(), and usage().
#define false 0 |
#define HAVE_LOCALTIME_R 1 |
#define HAVE_LOCALTIME_RZ 0 |
Referenced by saveabbr().
#define HAVE_TZSET 1 |
#define HOURSPERDAY 24 |
#define is_digit | ( | c | ) | ((unsigned)(c) - '0' <= 9) |
Referenced by abbrok().
#define isleap | ( | y | ) | (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) |
Referenced by yeartot().
#define isleap_sum | ( | a, | |
b | |||
) | isleap((a) % 400 + (b) % 400) |
Referenced by adjusted_yday().
#define localtime_r zdump_localtime_r |
Referenced by localtime_rz().
#define localtime_rz zdump_localtime_rz |
Referenced by main(), and my_gmtime_r().
#define MAX_STRING_LENGTH 1024 |
#define MINSPERHOUR 60 |
#define my_localtime_rz localtime_rz |
#define SECSPER400YEARS |
Referenced by yeartot().
#define SECSPERDAY ((int_fast32_t) SECSPERHOUR * HOURSPERDAY) |
Referenced by main().
#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) |
#define SECSPERLYEAR (SECSPERNYEAR + SECSPERDAY) |
Referenced by yeartot().
#define SECSPERMIN 60 |
#define SECSPERNYEAR (SECSPERDAY * DAYSPERNYEAR) |
Referenced by yeartot().
#define timezone_t char ** |
#define TM_YEAR_BASE 1900 |
Referenced by adjusted_yday(), and dumptime().
#define true 1 |
#define tzalloc zdump_tzalloc |
Referenced by gmtzinit(), and main().
#define tzfree zdump_tzfree |
Referenced by main().
#define USE_LOCALTIME_RZ false |
Referenced by gmtzinit(), and my_gmtime_r().
#define USE_LTZ 1 |
#define ZDUMP_HI_YEAR 2500 |
Referenced by main().
#define ZDUMP_LO_YEAR (-500) |
Referenced by main().
anonymous enum |
|
static |
Referenced by format_utc_offset(), hunt(), main(), saveabbr(), and show().
|
static |
References _, is_alpha(), and is_digit.
Referenced by show().
References isleap_sum, and TM_YEAR_BASE.
Referenced by gmtoff().
|
static |
References _, and EXIT_FAILURE.
|
static |
References DIVISOR, and TM_YEAR_BASE.
Referenced by show().
|
static |
Referenced by istrftime().
|
static |
Referenced by istrftime().
|
static |
References abbr(), and gmtoff().
Referenced by istrftime().
References adjusted_yday(), my_gmtime_r(), and tm.
Referenced by addtype(), format_utc_offset(), init_ttinfo(), outzone(), show(), and stringrule().
|
static |
References EXIT_FAILURE, tzalloc, and USE_LOCALTIME_RZ.
Referenced by main().
|
static |
References abbr(), delta(), my_localtime_rz, saveabbr(), and tm.
Referenced by main().
|
static |
References format_local_time(), format_quoted_string(), format_utc_offset(), is_alpha(), strftime(), and xmalloc().
Referenced by showtrans().
References localtime(), and tm.
|
static |
References localtime_r.
int main | ( | int | argc, |
char * | argv[] | ||
) |
References _, abbr(), absolute_max_time, absolute_min_time, close_file(), delta(), EXIT_FAILURE, EXIT_SUCCESS, gmtzinit(), hunt(), INITIALIZE, localtime_rz, my_localtime_rz, PKGVERSION, saveabbr(), SECSPERDAY, show(), showtrans(), strtoimax, tm, TZ_DOMAIN, tzalloc, tzfree, TZVERSION, usage(), yeartot(), ZDUMP_HI_YEAR, and ZDUMP_LO_YEAR.
References gmtime_r(), localtime_rz, and USE_LOCALTIME_RZ.
|
static |
|
static |
References abbr(), abbrok(), dumptime(), gmtoff(), my_gmtime_r(), my_localtime_rz, tformat(), and tm.
Referenced by main().
|
static |
References istrftime(), sumsize(), tformat(), and xmalloc().
Referenced by main().
|
static |
References EXIT_FAILURE.
Referenced by saveabbr(), showtrans(), and tzalloc().
|
static |
References PRIdMAX, and PRIuMAX.
Referenced by show(), and showtrans().
|
static |
|
static |
References environ.
|
static |
References _, close_file(), EXIT_SUCCESS, and REPORT_BUGS_TO.
Referenced by main().
|
static |
References EXIT_FAILURE.
Referenced by istrftime(), saveabbr(), showtrans(), and tzalloc().
|
static |
References absolute_max_time, absolute_min_time, EPOCH_YEAR, INTMAX_MAX, isleap, SECSPER400YEARS, SECSPERLYEAR, and SECSPERNYEAR.
Referenced by main().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |