PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 strtoimax   strtoll
 
#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 91 of file private.h.

◆ AVGSECSPERYEAR

#define AVGSECSPERYEAR   31556952L

Definition at line 154 of file private.h.

◆ DAYSPERLYEAR

#define DAYSPERLYEAR   366

Definition at line 102 of file private.h.

◆ DAYSPERNYEAR

#define DAYSPERNYEAR   365

Definition at line 101 of file private.h.

◆ DAYSPERWEEK

#define DAYSPERWEEK   7

Definition at line 100 of file private.h.

◆ ENOTSUP

#define ENOTSUP   EINVAL

Definition at line 38 of file private.h.

◆ EOVERFLOW

#define EOVERFLOW   EINVAL

Definition at line 41 of file private.h.

◆ EPOCH_WDAY

#define EPOCH_WDAY   TM_THURSDAY

Definition at line 131 of file private.h.

◆ EPOCH_YEAR

#define EPOCH_YEAR   1970

Definition at line 130 of file private.h.

◆ GRANDPARENTED

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

Definition at line 30 of file private.h.

◆ HOURSPERDAY

#define HOURSPERDAY   24

Definition at line 99 of file private.h.

◆ INITIALIZE

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

Definition at line 88 of file private.h.

◆ INT_STRLEN_MAXIMUM

#define INT_STRLEN_MAXIMUM (   type)
Value:
((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + \
#define TYPE_BIT(type)
Definition: private.h:56
#define TYPE_SIGNED(type)
Definition: private.h:57
const char * type

Definition at line 81 of file private.h.

◆ is_digit

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

Definition at line 45 of file private.h.

◆ isleap

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

Definition at line 133 of file private.h.

◆ isleap_sum

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

Definition at line 147 of file private.h.

◆ MAXVAL

#define MAXVAL (   t,
  b 
)
Value:
((t) (((t) 1 << ((b) - 1 - TYPE_SIGNED(t))) \
- 1 + ((t) 1 << ((b) - 1 - TYPE_SIGNED(t)))))
int b
Definition: isn.c:69

Definition at line 65 of file private.h.

◆ MINSPERHOUR

#define MINSPERHOUR   60

Definition at line 98 of file private.h.

◆ MINVAL

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

Definition at line 68 of file private.h.

◆ MONSPERYEAR

#define MONSPERYEAR   12

Definition at line 105 of file private.h.

◆ SECSPERDAY

#define SECSPERDAY   ((int32) SECSPERHOUR * HOURSPERDAY)

Definition at line 104 of file private.h.

◆ SECSPERHOUR

#define SECSPERHOUR   (SECSPERMIN * MINSPERHOUR)

Definition at line 103 of file private.h.

◆ SECSPERMIN

#define SECSPERMIN   60

Definition at line 97 of file private.h.

◆ SECSPERREPEAT

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

Definition at line 155 of file private.h.

◆ SECSPERREPEAT_BITS

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

Definition at line 157 of file private.h.

◆ strtoimax

#define strtoimax   strtoll

Definition at line 49 of file private.h.

◆ TIME_T_MAX

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

Definition at line 73 of file private.h.

◆ TIME_T_MIN

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

Definition at line 72 of file private.h.

◆ TM_APRIL

#define TM_APRIL   3

Definition at line 118 of file private.h.

◆ TM_AUGUST

#define TM_AUGUST   7

Definition at line 122 of file private.h.

◆ TM_DECEMBER

#define TM_DECEMBER   11

Definition at line 126 of file private.h.

◆ TM_FEBRUARY

#define TM_FEBRUARY   1

Definition at line 116 of file private.h.

◆ TM_FRIDAY

#define TM_FRIDAY   5

Definition at line 112 of file private.h.

◆ TM_JANUARY

#define TM_JANUARY   0

Definition at line 115 of file private.h.

◆ TM_JULY

#define TM_JULY   6

Definition at line 121 of file private.h.

◆ TM_JUNE

#define TM_JUNE   5

Definition at line 120 of file private.h.

◆ TM_MARCH

#define TM_MARCH   2

Definition at line 117 of file private.h.

◆ TM_MAY

#define TM_MAY   4

Definition at line 119 of file private.h.

◆ TM_MONDAY

#define TM_MONDAY   1

Definition at line 108 of file private.h.

◆ TM_NOVEMBER

#define TM_NOVEMBER   10

Definition at line 125 of file private.h.

◆ TM_OCTOBER

#define TM_OCTOBER   9

Definition at line 124 of file private.h.

◆ TM_SATURDAY

#define TM_SATURDAY   6

Definition at line 113 of file private.h.

◆ TM_SEPTEMBER

#define TM_SEPTEMBER   8

Definition at line 123 of file private.h.

◆ TM_SUNDAY

#define TM_SUNDAY   0

Definition at line 107 of file private.h.

◆ TM_THURSDAY

#define TM_THURSDAY   4

Definition at line 111 of file private.h.

◆ TM_TUESDAY

#define TM_TUESDAY   2

Definition at line 109 of file private.h.

◆ TM_WEDNESDAY

#define TM_WEDNESDAY   3

Definition at line 110 of file private.h.

◆ TM_YEAR_BASE

#define TM_YEAR_BASE   1900

Definition at line 128 of file private.h.

◆ TWOS_COMPLEMENT

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

Definition at line 58 of file private.h.

◆ TYPE_BIT

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

Definition at line 56 of file private.h.

◆ TYPE_SIGNED

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

Definition at line 57 of file private.h.

◆ YEARSPERREPEAT

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

Definition at line 95 of file private.h.