5
* This file is in the public domain, so clarified as of
6
* 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
9
* $PostgreSQL: pgsql/src/timezone/private.h,v 1.9 2004-08-29 05:07:02 momjian Exp $
13
* This header is for use ONLY with the time conversion code.
14
* There is no guarantee that it will remain unchanged,
15
* or that it will remain at all.
16
* Do NOT copy it to any system include directory.
20
#include <limits.h> /* for CHAR_BIT */
21
#include <sys/wait.h> /* for WIFEXITED and WEXITSTATUS */
22
#include <unistd.h> /* for F_OK and R_OK */
28
#define WIFEXITED(status) (((status) & 0xff) == 0)
29
#endif /* !defined WIFEXITED */
31
#define WEXITSTATUS(status) (((status) >> 8) & 0xff)
32
#endif /* !defined WEXITSTATUS */
34
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
35
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
38
* SunOS 4.1.1 headers lack EXIT_SUCCESS.
42
#define EXIT_SUCCESS 0
43
#endif /* !defined EXIT_SUCCESS */
46
* SunOS 4.1.1 headers lack EXIT_FAILURE.
50
#define EXIT_FAILURE 1
51
#endif /* !defined EXIT_FAILURE */
54
* SunOS 4.1.1 libraries lack remove.
58
extern int unlink(const char *filename);
61
#endif /* !defined remove */
64
* Private function declarations.
66
extern char *icalloc(int nelem, int elsize);
67
extern char *icatalloc(char *old, const char *new);
68
extern char *icpyalloc(const char *string);
69
extern char *imalloc(int n);
70
extern void *irealloc(void *pointer, int size);
71
extern void icfree(char *pointer);
72
extern void ifree(char *pointer);
73
extern char *scheck(const char *string, const char *format);
77
* Finally, some convenience items.
82
#endif /* !defined TRUE */
86
#endif /* !defined FALSE */
89
#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
90
#endif /* !defined TYPE_BIT */
93
#define TYPE_SIGNED(type) (((type) -1) < 0)
94
#endif /* !defined TYPE_SIGNED */
96
#ifndef INT_STRLEN_MAXIMUM
98
* 302 / 1000 is log10(2.0) rounded up.
99
* Subtract one for the sign bit if the type is signed;
100
* add one for integer division truncation;
101
* add one more for a minus sign if the type is signed.
103
#define INT_STRLEN_MAXIMUM(type) \
104
((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type))
105
#endif /* !defined INT_STRLEN_MAXIMUM */
107
#define _(msgid) (msgid)
110
* UNIX was a registered trademark of The Open Group in 2003.
113
#endif /* !defined PRIVATE_H */