Deleted Added
full compact
private.h (15927) private.h (17209)
1
2
3#ifndef PRIVATE_H
4
5#define PRIVATE_H
1#ifndef PRIVATE_H
2
3#define PRIVATE_H
4/*
5** This file is in the public domain, so clarified as of
6** June 5, 1996 by Arthur David Olson (arthur_david_olson@nih.gov).
7*/
6
7/* Stuff moved from Makefile.inc to reduce clutter */
8#ifndef TM_GMTOFF
9#define TM_GMTOFF tm_gmtoff
10#define TM_ZONE tm_zone
11#define STD_INSPIRED 1
12#define PCTS 1
13#define HAVE_LONG_DOUBLE 1
8
9/* Stuff moved from Makefile.inc to reduce clutter */
10#ifndef TM_GMTOFF
11#define TM_GMTOFF tm_gmtoff
12#define TM_ZONE tm_zone
13#define STD_INSPIRED 1
14#define PCTS 1
15#define HAVE_LONG_DOUBLE 1
16#define HAVE_STRERROR 1
17#define HAVE_UNISTD_H 1
18#define LOCALE_HOME _PATH_LOCALE
14#define TZDIR "/usr/share/zoneinfo"
15#endif /* ndef TM_GMTOFF */
16
17/*
18** This header is for use ONLY with the time conversion code.
19** There is no guarantee that it will remain unchanged,
20** or that it will remain at all.
21** Do NOT copy it to any system include directory.
22** Thank you!
23*/
24
25/*
26** ID
27*/
28
29#ifndef lint
30#ifndef NOID
19#define TZDIR "/usr/share/zoneinfo"
20#endif /* ndef TM_GMTOFF */
21
22/*
23** This header is for use ONLY with the time conversion code.
24** There is no guarantee that it will remain unchanged,
25** or that it will remain at all.
26** Do NOT copy it to any system include directory.
27** Thank you!
28*/
29
30/*
31** ID
32*/
33
34#ifndef lint
35#ifndef NOID
31/*static char privatehid[] = "@(#)private.h 7.33";*/
36/*
37static char privatehid[] = "@(#)private.h 7.43";
38*/
32#endif /* !defined NOID */
33#endif /* !defined lint */
34
35/*
36** Defaults for preprocessor symbols.
37** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
38*/
39
40#ifndef HAVE_ADJTIME
41#define HAVE_ADJTIME 1
42#endif /* !defined HAVE_ADJTIME */
43
39#endif /* !defined NOID */
40#endif /* !defined lint */
41
42/*
43** Defaults for preprocessor symbols.
44** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
45*/
46
47#ifndef HAVE_ADJTIME
48#define HAVE_ADJTIME 1
49#endif /* !defined HAVE_ADJTIME */
50
51#ifndef HAVE_GETTEXT
52#define HAVE_GETTEXT 0
53#endif /* !defined HAVE_GETTEXT */
54
44#ifndef HAVE_SETTIMEOFDAY
45#define HAVE_SETTIMEOFDAY 3
46#endif /* !defined HAVE_SETTIMEOFDAY */
47
55#ifndef HAVE_SETTIMEOFDAY
56#define HAVE_SETTIMEOFDAY 3
57#endif /* !defined HAVE_SETTIMEOFDAY */
58
59#ifndef HAVE_STRERROR
60#define HAVE_STRERROR 0
61#endif /* !defined HAVE_STRERROR */
62
48#ifndef HAVE_UNISTD_H
49#define HAVE_UNISTD_H 1
50#endif /* !defined HAVE_UNISTD_H */
51
63#ifndef HAVE_UNISTD_H
64#define HAVE_UNISTD_H 1
65#endif /* !defined HAVE_UNISTD_H */
66
67#ifndef HAVE_UTMPX_H
68#define HAVE_UTMPX_H 0
69#endif /* !defined HAVE_UTMPX_H */
70
71#ifndef LOCALE_HOME
72#define LOCALE_HOME "/usr/lib/locale"
73#endif /* !defined LOCALE_HOME */
74
52/*
53** Nested includes
54*/
55
56#include "sys/types.h" /* for time_t */
57#include "stdio.h"
75/*
76** Nested includes
77*/
78
79#include "sys/types.h" /* for time_t */
80#include "stdio.h"
58#include "ctype.h"
59#include "errno.h"
60#include "string.h"
61#include "limits.h" /* for CHAR_BIT */
62#include "time.h"
63#include "stdlib.h"
64
81#include "errno.h"
82#include "string.h"
83#include "limits.h" /* for CHAR_BIT */
84#include "time.h"
85#include "stdlib.h"
86
87#if HAVE_GETTEXT - 0
88#include "libintl.h"
89#endif /* HAVE_GETTEXT - 0 */
90
65#if HAVE_UNISTD_H - 0
66#include "unistd.h" /* for F_OK and R_OK */
67#endif /* HAVE_UNISTD_H - 0 */
68
69#if !(HAVE_UNISTD_H - 0)
70#ifndef F_OK
71#define F_OK 0
72#endif /* !defined F_OK */
73#ifndef R_OK
74#define R_OK 4
75#endif /* !defined R_OK */
76#endif /* !(HAVE_UNISTD_H - 0) */
77
91#if HAVE_UNISTD_H - 0
92#include "unistd.h" /* for F_OK and R_OK */
93#endif /* HAVE_UNISTD_H - 0 */
94
95#if !(HAVE_UNISTD_H - 0)
96#ifndef F_OK
97#define F_OK 0
98#endif /* !defined F_OK */
99#ifndef R_OK
100#define R_OK 4
101#endif /* !defined R_OK */
102#endif /* !(HAVE_UNISTD_H - 0) */
103
104/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
105#define is_digit(c) ((unsigned)(c) - '0' <= 9)
106
78/*
79** Workarounds for compilers/systems.
80*/
81
107/*
108** Workarounds for compilers/systems.
109*/
110
82/*
83** SunOS 4.1.1 cc lacks const.
84*/
85
86#ifndef const
87#ifndef __STDC__
88#define const
89#endif /* !defined __STDC__ */
90#endif /* !defined const */
91
92/*
93** SunOS 4.1.1 cc lacks prototypes.
94*/
95
96#ifndef P
97#ifdef __STDC__
98#define P(x) x
99#endif /* defined __STDC__ */
100#ifndef __STDC__
101#define P(x) ()
102#endif /* !defined __STDC__ */
103#endif /* !defined P */
104
105/*
111#ifndef P
112#ifdef __STDC__
113#define P(x) x
114#endif /* defined __STDC__ */
115#ifndef __STDC__
116#define P(x) ()
117#endif /* !defined __STDC__ */
118#endif /* !defined P */
119
120/*
106** SunOS 4.1.1 headers lack EXIT_SUCCESS.
107*/
108
109#ifndef EXIT_SUCCESS
110#define EXIT_SUCCESS 0
111#endif /* !defined EXIT_SUCCESS */
112
113/*
114** SunOS 4.1.1 headers lack EXIT_FAILURE.
115*/
116
117#ifndef EXIT_FAILURE
118#define EXIT_FAILURE 1
119#endif /* !defined EXIT_FAILURE */
120
121/*
122** SunOS 4.1.1 headers lack FILENAME_MAX.
123*/
124
125#ifndef FILENAME_MAX
126
127#ifndef MAXPATHLEN
128#ifdef unix
129#include "sys/param.h"

--- 5 unchanged lines hidden (view full) ---

135#endif /* defined MAXPATHLEN */
136#ifndef MAXPATHLEN
137#define FILENAME_MAX 1024 /* Pure guesswork */
138#endif /* !defined MAXPATHLEN */
139
140#endif /* !defined FILENAME_MAX */
141
142/*
121** SunOS 4.1.1 headers lack FILENAME_MAX.
122*/
123
124#ifndef FILENAME_MAX
125
126#ifndef MAXPATHLEN
127#ifdef unix
128#include "sys/param.h"

--- 5 unchanged lines hidden (view full) ---

134#endif /* defined MAXPATHLEN */
135#ifndef MAXPATHLEN
136#define FILENAME_MAX 1024 /* Pure guesswork */
137#endif /* !defined MAXPATHLEN */
138
139#endif /* !defined FILENAME_MAX */
140
141/*
143** SunOS 4.1.1 libraries lack remove.
144*/
145
146#ifndef remove
147extern int unlink P((const char * filename));
148#define remove unlink
149#endif /* !defined remove */
150
151/*
152** Finally, some convenience items.
153*/
154
155#ifndef TRUE
156#define TRUE 1
157#endif /* !defined TRUE */
158
159#ifndef FALSE
160#define FALSE 0
161#endif /* !defined FALSE */
162
142** Finally, some convenience items.
143*/
144
145#ifndef TRUE
146#define TRUE 1
147#endif /* !defined TRUE */
148
149#ifndef FALSE
150#define FALSE 0
151#endif /* !defined FALSE */
152
153#ifndef TYPE_BIT
154#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
155#endif /* !defined TYPE_BIT */
156
157#ifndef TYPE_SIGNED
158#define TYPE_SIGNED(type) (((type) -1) < 0)
159#endif /* !defined TYPE_SIGNED */
160
163#ifndef INT_STRLEN_MAXIMUM
164/*
165** 302 / 1000 is log10(2.0) rounded up.
161#ifndef INT_STRLEN_MAXIMUM
162/*
163** 302 / 1000 is log10(2.0) rounded up.
166** Subtract one for the sign bit;
164** Subtract one for the sign bit if the type is signed;
167** add one for integer division truncation;
165** add one for integer division truncation;
168** add one more for a minus sign.
166** add one more for a minus sign if the type is signed.
169*/
170#define INT_STRLEN_MAXIMUM(type) \
167*/
168#define INT_STRLEN_MAXIMUM(type) \
171 ((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2)
169 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 100 + 1 + TYPE_SIGNED(type))
172#endif /* !defined INT_STRLEN_MAXIMUM */
173
174/*
175** INITIALIZE(x)
176*/
177
178#ifndef GNUC_or_lint
179#ifdef lint

--- 11 unchanged lines hidden (view full) ---

191#define INITIALIZE(x) ((x) = 0)
192#endif /* defined GNUC_or_lint */
193#ifndef GNUC_or_lint
194#define INITIALIZE(x)
195#endif /* !defined GNUC_or_lint */
196#endif /* !defined INITIALIZE */
197
198/*
170#endif /* !defined INT_STRLEN_MAXIMUM */
171
172/*
173** INITIALIZE(x)
174*/
175
176#ifndef GNUC_or_lint
177#ifdef lint

--- 11 unchanged lines hidden (view full) ---

189#define INITIALIZE(x) ((x) = 0)
190#endif /* defined GNUC_or_lint */
191#ifndef GNUC_or_lint
192#define INITIALIZE(x)
193#endif /* !defined GNUC_or_lint */
194#endif /* !defined INITIALIZE */
195
196/*
197** For the benefit of GNU folk...
198** `_(MSGID)' uses the current locale's message library string for MSGID.
199** The default is to use gettext if available, and use MSGID otherwise.
200*/
201
202#ifndef _
203#if HAVE_GETTEXT - 0
204#define _(msgid) gettext(msgid)
205#else /* !(HAVE_GETTEXT - 0) */
206#define _(msgid) msgid
207#endif /* !(HAVE_GETTEXT - 0) */
208#endif /* !defined _ */
209
210#ifndef TZ_DOMAIN
211#define TZ_DOMAIN "tz"
212#endif /* !defined TZ_DOMAIN */
213
214/*
199** UNIX was a registered trademark of UNIX System Laboratories in 1993.
200*/
201
202#endif /* !defined PRIVATE_H */
215** UNIX was a registered trademark of UNIX System Laboratories in 1993.
216*/
217
218#endif /* !defined PRIVATE_H */