PostgreSQL Source Code  git master
private.h File Reference
#include <limits.h>
#include <sys/wait.h>
#include <unistd.h>
#include "pgtime.h"
Include dependency graph for private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GRANDPARENTED   "Local time zone must be set--see zic manual page"
 
#define ENOTSUP   EINVAL
 
#define EOVERFLOW   EINVAL
 
#define is_digit(c)   ((unsigned)(c) - '0' <= 9)
 
#define TYPE_BIT(type)   (sizeof (type) * CHAR_BIT)
 
#define TYPE_SIGNED(type)   (((type) -1) < 0)
 
#define TWOS_COMPLEMENT(t)   ((t) ~ (t) 0 < 0)
 
#define MAXVAL(t, b)
 
#define MINVAL(t, b)   ((t) (TYPE_SIGNED(t) ? - TWOS_COMPLEMENT(t) - MAXVAL(t, b) : 0))
 
#define TIME_T_MIN   MINVAL(pg_time_t, TYPE_BIT(pg_time_t))
 
#define TIME_T_MAX   MAXVAL(pg_time_t, TYPE_BIT(pg_time_t))
 
#define INT_STRLEN_MAXIMUM(type)
 
#define INITIALIZE(x)   ((x) = 0)
 
#define _(msgid)   (msgid)
 
#define YEARSPERREPEAT   400 /* years before a Gregorian repeat */
 
#define SECSPERMIN   60
 
#define MINSPERHOUR   60
 
#define HOURSPERDAY   24
 
#define DAYSPERWEEK   7
 
#define DAYSPERNYEAR   365
 
#define DAYSPERLYEAR   366
 
#define SECSPERHOUR   (SECSPERMIN * MINSPERHOUR)
 
#define SECSPERDAY   ((int32) SECSPERHOUR * HOURSPERDAY)
 
#define MONSPERYEAR   12
 
#define TM_SUNDAY   0
 
#define TM_MONDAY   1
 
#define TM_TUESDAY   2
 
#define TM_WEDNESDAY   3
 
#define TM_THURSDAY   4
 
#define TM_FRIDAY   5
 
#define TM_SATURDAY   6
 
#define TM_JANUARY   0
 
#define TM_FEBRUARY   1
 
#define TM_MARCH   2
 
#define TM_APRIL   3
 
#define TM_MAY   4
 
#define TM_JUNE   5
 
#define TM_JULY   6
 
#define TM_AUGUST   7
 
#define TM_SEPTEMBER   8
 
#define TM_OCTOBER   9
 
#define TM_NOVEMBER   10
 
#define TM_DECEMBER   11
 
#define TM_YEAR_BASE   1900
 
#define EPOCH_YEAR   1970
 
#define EPOCH_WDAY   TM_THURSDAY
 
#define isleap(y)   (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
 
#define isleap_sum(a, b)   isleap((a) % 400 + (b) % 400)
 
#define AVGSECSPERYEAR   31556952L
 
#define SECSPERREPEAT   ((int64) YEARSPERREPEAT * (int64) AVGSECSPERYEAR)
 
#define SECSPERREPEAT_BITS   34 /* ceil(log2(SECSPERREPEAT)) */
 

Macro Definition Documentation

◆ _

#define _ (   msgid)    (msgid)

Definition at line 84 of file private.h.

◆ AVGSECSPERYEAR

#define AVGSECSPERYEAR   31556952L

Definition at line 147 of file private.h.

Referenced by localsub(), and pg_next_dst_boundary().

◆ DAYSPERLYEAR

#define DAYSPERLYEAR   366

Definition at line 95 of file private.h.

Referenced by _fmt(), getrule(), and timesub().

◆ DAYSPERNYEAR

#define DAYSPERNYEAR   365

Definition at line 94 of file private.h.

Referenced by _fmt(), getrule(), and timesub().

◆ DAYSPERWEEK

#define DAYSPERWEEK   7

Definition at line 93 of file private.h.

Referenced by _fmt(), getrule(), getsecs(), stringoffset(), stringrule(), timesub(), and transtime().

◆ ENOTSUP

#define ENOTSUP   EINVAL

Definition at line 35 of file private.h.

Referenced by dolink(), and get_errno_symbol().

◆ EOVERFLOW

#define EOVERFLOW   EINVAL

Definition at line 38 of file private.h.

Referenced by get_errno_symbol(), itsdir(), and timesub().

◆ EPOCH_WDAY

#define EPOCH_WDAY   TM_THURSDAY

Definition at line 124 of file private.h.

Referenced by rpytime(), and timesub().

◆ EPOCH_YEAR

#define EPOCH_YEAR   1970

Definition at line 123 of file private.h.

Referenced by inleap(), outzone(), rpytime(), timesub(), and tzparse().

◆ GRANDPARENTED

#define GRANDPARENTED   "Local time zone must be set--see zic manual page"

Definition at line 27 of file private.h.

Referenced by newabbr(), and writezone().

◆ HOURSPERDAY

#define HOURSPERDAY   24

Definition at line 92 of file private.h.

Referenced by _fmt(), gethms(), getsecs(), and stringoffset().

◆ INITIALIZE

#define INITIALIZE (   x)    ((x) = 0)

Definition at line 81 of file private.h.

Referenced by outzone(), and transtime().

◆ INT_STRLEN_MAXIMUM

#define INT_STRLEN_MAXIMUM (   type)
Value:
((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + \
#define TYPE_BIT(type)
Definition: private.h:49
#define TYPE_SIGNED(type)
Definition: private.h:50

Definition at line 74 of file private.h.

Referenced by _conv(), and yearistype().

◆ is_digit

#define is_digit (   c)    ((unsigned)(c) - '0' <= 9)

Definition at line 42 of file private.h.

Referenced by getnum(), getrule(), and getzname().

◆ isleap

#define isleap (   y)    (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))

Definition at line 126 of file private.h.

◆ isleap_sum

#define isleap_sum (   a,
 
)    isleap((a) % 400 + (b) % 400)

Definition at line 140 of file private.h.

Referenced by _fmt().

◆ MAXVAL

#define MAXVAL (   t,
 
)
Value:
((t) (((t) 1 << ((b) - 1 - TYPE_SIGNED(t))) \
- 1 + ((t) 1 << ((b) - 1 - TYPE_SIGNED(t)))))
#define TYPE_SIGNED(type)
Definition: private.h:50

Definition at line 58 of file private.h.

◆ MINSPERHOUR

#define MINSPERHOUR   60

Definition at line 91 of file private.h.

Referenced by _fmt(), abbroffset(), gethms(), getsecs(), stringoffset(), stringrule(), and stringzone().

◆ MINVAL

#define MINVAL (   t,
 
)    ((t) (TYPE_SIGNED(t) ? - TWOS_COMPLEMENT(t) - MAXVAL(t, b) : 0))

Definition at line 61 of file private.h.

◆ MONSPERYEAR

#define MONSPERYEAR   12

Definition at line 98 of file private.h.

Referenced by _fmt(), and getrule().

◆ SECSPERDAY

#define SECSPERDAY   ((int32) SECSPERHOUR * HOURSPERDAY)

◆ SECSPERHOUR

#define SECSPERHOUR   (SECSPERMIN * MINSPERHOUR)

Definition at line 96 of file private.h.

Referenced by gethms(), getrule(), getsecs(), timesub(), and tzparse().

◆ SECSPERMIN

#define SECSPERMIN   60

Definition at line 90 of file private.h.

Referenced by _fmt(), abbroffset(), gethms(), getsecs(), stringoffset(), stringrule(), stringzone(), and timesub().

◆ SECSPERREPEAT

#define SECSPERREPEAT   ((int64) YEARSPERREPEAT * (int64) AVGSECSPERYEAR)

Definition at line 148 of file private.h.

Referenced by differ_by_repeat(), and localsub().

◆ SECSPERREPEAT_BITS

#define SECSPERREPEAT_BITS   34 /* ceil(log2(SECSPERREPEAT)) */

Definition at line 150 of file private.h.

Referenced by differ_by_repeat().

◆ TIME_T_MAX

#define TIME_T_MAX   MAXVAL(pg_time_t, TYPE_BIT(pg_time_t))

Definition at line 66 of file private.h.

Referenced by increment_overflow_time(), and tzloadbody().

◆ TIME_T_MIN

#define TIME_T_MIN   MINVAL(pg_time_t, TYPE_BIT(pg_time_t))

Definition at line 65 of file private.h.

Referenced by increment_overflow_time(), and tzloadbody().

◆ TM_APRIL

#define TM_APRIL   3

Definition at line 111 of file private.h.

◆ TM_AUGUST

#define TM_AUGUST   7

Definition at line 115 of file private.h.

◆ TM_DECEMBER

#define TM_DECEMBER   11

Definition at line 119 of file private.h.

Referenced by stringzone().

◆ TM_FEBRUARY

#define TM_FEBRUARY   1

Definition at line 109 of file private.h.

Referenced by rpytime(), and stringrule().

◆ TM_FRIDAY

#define TM_FRIDAY   5

Definition at line 105 of file private.h.

◆ TM_JANUARY

#define TM_JANUARY   0

Definition at line 108 of file private.h.

Referenced by inleap(), outzone(), rpytime(), and stringzone().

◆ TM_JULY

#define TM_JULY   6

Definition at line 114 of file private.h.

◆ TM_JUNE

#define TM_JUNE   5

Definition at line 113 of file private.h.

◆ TM_MARCH

#define TM_MARCH   2

Definition at line 110 of file private.h.

◆ TM_MAY

#define TM_MAY   4

Definition at line 112 of file private.h.

◆ TM_MONDAY

#define TM_MONDAY   1

Definition at line 101 of file private.h.

◆ TM_NOVEMBER

#define TM_NOVEMBER   10

Definition at line 118 of file private.h.

◆ TM_OCTOBER

#define TM_OCTOBER   9

Definition at line 117 of file private.h.

◆ TM_SATURDAY

#define TM_SATURDAY   6

Definition at line 106 of file private.h.

◆ TM_SEPTEMBER

#define TM_SEPTEMBER   8

Definition at line 116 of file private.h.

◆ TM_SUNDAY

#define TM_SUNDAY   0

Definition at line 100 of file private.h.

◆ TM_THURSDAY

#define TM_THURSDAY   4

Definition at line 104 of file private.h.

◆ TM_TUESDAY

#define TM_TUESDAY   2

Definition at line 102 of file private.h.

◆ TM_WEDNESDAY

#define TM_WEDNESDAY   3

Definition at line 103 of file private.h.

◆ TM_YEAR_BASE

#define TM_YEAR_BASE   1900

Definition at line 121 of file private.h.

Referenced by _fmt(), and timesub().

◆ TWOS_COMPLEMENT

#define TWOS_COMPLEMENT (   t)    ((t) ~ (t) 0 < 0)

Definition at line 51 of file private.h.

Referenced by detzcode(), and detzcode64().

◆ TYPE_BIT

#define TYPE_BIT (   type)    (sizeof (type) * CHAR_BIT)

Definition at line 49 of file private.h.

Referenced by differ_by_repeat(), and main().

◆ TYPE_SIGNED

#define TYPE_SIGNED (   type)    (((type) -1) < 0)

Definition at line 50 of file private.h.

Referenced by differ_by_repeat(), increment_overflow_time(), timesub(), and tzloadbody().

◆ YEARSPERREPEAT

#define YEARSPERREPEAT   400 /* years before a Gregorian repeat */

Definition at line 88 of file private.h.

Referenced by localsub(), outzone(), pg_next_dst_boundary(), and tzparse().