Fix obsolete comment regarding FSM truncation.
[PostgreSQL.git] / src / include / pgtime.h
blob8231808c92ee9ab1f83c71e9a6478fb2f2d99500
1 /*-------------------------------------------------------------------------
3 * pgtime.h
4 * PostgreSQL internal timezone library
6 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
8 * IDENTIFICATION
9 * $PostgreSQL$
11 *-------------------------------------------------------------------------
13 #ifndef _PGTIME_H
14 #define _PGTIME_H
18 * The API of this library is generally similar to the corresponding
19 * C library functions, except that we use pg_time_t which (we hope) is
20 * 64 bits wide, and which is most definitely signed not unsigned.
23 typedef int64 pg_time_t;
25 struct pg_tm
27 int tm_sec;
28 int tm_min;
29 int tm_hour;
30 int tm_mday;
31 int tm_mon; /* origin 0, not 1 */
32 int tm_year; /* relative to 1900 */
33 int tm_wday;
34 int tm_yday;
35 int tm_isdst;
36 long int tm_gmtoff;
37 const char *tm_zone;
40 typedef struct pg_tz pg_tz;
41 typedef struct pg_tzenum pg_tzenum;
43 extern struct pg_tm *pg_localtime(const pg_time_t *timep, const pg_tz *tz);
44 extern struct pg_tm *pg_gmtime(const pg_time_t *timep);
45 extern int pg_next_dst_boundary(const pg_time_t *timep,
46 long int *before_gmtoff,
47 int *before_isdst,
48 pg_time_t *boundary,
49 long int *after_gmtoff,
50 int *after_isdst,
51 const pg_tz *tz);
52 extern size_t pg_strftime(char *s, size_t max, const char *format,
53 const struct pg_tm * tm);
55 extern void pg_timezone_pre_initialize(void);
56 extern void pg_timezone_initialize(void);
57 extern pg_tz *pg_tzset(const char *tzname);
58 extern bool tz_acceptable(pg_tz *tz);
59 extern bool pg_get_timezone_offset(const pg_tz *tz, long int *gmtoff);
60 extern const char *pg_get_timezone_name(pg_tz *tz);
62 extern pg_tzenum *pg_tzenumerate_start(void);
63 extern pg_tz *pg_tzenumerate_next(pg_tzenum *dir);
64 extern void pg_tzenumerate_end(pg_tzenum *dir);
66 extern pg_tz *session_timezone;
67 extern pg_tz *log_timezone;
68 extern pg_tz *gmt_timezone;
70 /* Maximum length of a timezone name (not including trailing null) */
71 #define TZ_STRLEN_MAX 255
73 #endif /* _PGTIME_H */