00001 #ifndef PRIVATE_H
00002
00003 #define PRIVATE_H
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef lint
00023 #ifndef NOID
00024 static char __attribute__((unused)) privatehid[] = "@(#)private.h 8.3";
00025 #endif
00026 #endif
00027
00028 #define GRANDPARENTED "Local time zone must be set--see zic manual page"
00029
00030
00031
00032
00033
00034
00035 #ifndef HAVE_ADJTIME
00036 #define HAVE_ADJTIME 1
00037 #endif
00038
00039 #ifndef HAVE_GETTEXT
00040 #define HAVE_GETTEXT 0
00041 #endif
00042
00043 #ifndef HAVE_INCOMPATIBLE_CTIME_R
00044 #define HAVE_INCOMPATIBLE_CTIME_R 0
00045 #endif
00046
00047 #ifndef HAVE_SETTIMEOFDAY
00048 #define HAVE_SETTIMEOFDAY 3
00049 #endif
00050
00051 #ifndef HAVE_STRERROR
00052 #define HAVE_STRERROR 1
00053 #endif
00054
00055 #ifndef HAVE_SYMLINK
00056 #define HAVE_SYMLINK 1
00057 #endif
00058
00059 #ifndef HAVE_SYS_STAT_H
00060 #define HAVE_SYS_STAT_H 1
00061 #endif
00062
00063 #ifndef HAVE_SYS_WAIT_H
00064 #define HAVE_SYS_WAIT_H 1
00065 #endif
00066
00067 #ifndef HAVE_UNISTD_H
00068 #define HAVE_UNISTD_H 1
00069 #endif
00070
00071 #ifndef HAVE_UTMPX_H
00072 #define HAVE_UTMPX_H 0
00073 #endif
00074
00075 #ifndef LOCALE_HOME
00076 #define LOCALE_HOME "/usr/lib/locale"
00077 #endif
00078
00079 #if HAVE_INCOMPATIBLE_CTIME_R
00080 #define asctime_r _incompatible_asctime_r
00081 #define ctime_r _incompatible_ctime_r
00082 #endif
00083
00084
00085
00086
00087
00088 #include "sys/types.h"
00089 #include "stdio.h"
00090 #include "errno.h"
00091 #include "string.h"
00092 #include "limits.h"
00093 #include "time.h"
00094 #include "stdlib.h"
00095
00096 #if HAVE_GETTEXT
00097 #include "libintl.h"
00098 #endif
00099
00100 #if HAVE_SYS_WAIT_H
00101 #include <sys/wait.h>
00102 #endif
00103
00104 #ifndef WIFEXITED
00105 #define WIFEXITED(status) (((status) & 0xff) == 0)
00106 #endif
00107 #ifndef WEXITSTATUS
00108 #define WEXITSTATUS(status) (((status) >> 8) & 0xff)
00109 #endif
00110
00111 #if HAVE_UNISTD_H
00112 #include "unistd.h"
00113 #endif
00114
00115 #if !HAVE_UNISTD_H
00116 #ifndef F_OK
00117 #define F_OK 0
00118 #endif
00119 #ifndef R_OK
00120 #define R_OK 4
00121 #endif
00122 #endif
00123
00124
00125 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
00126
00127
00128
00129
00130
00131
00132
00133 #ifndef HAVE_STDINT_H
00134 #define HAVE_STDINT_H \
00135 (199901 <= __STDC_VERSION__ || \
00136 2 < (__GLIBC__ + (0 < __GLIBC_MINOR__)))
00137 #endif
00138
00139 #if HAVE_STDINT_H
00140 #include "stdint.h"
00141 #endif
00142
00143 #ifndef INT_FAST64_MAX
00144
00145 #if defined LLONG_MAX || defined __LONG_LONG_MAX__
00146 typedef long long int_fast64_t;
00147 #else
00148 #if (LONG_MAX >> 31) < 0xffffffff
00149 Please use a compiler that supports a 64-bit integer type (or wider);
00150 you may need to compile with "-DHAVE_STDINT_H".
00151 #endif
00152 typedef long int_fast64_t;
00153 #endif
00154 #endif
00155
00156 #ifndef INT32_MAX
00157 #define INT32_MAX 0x7fffffff
00158 #endif
00159 #ifndef INT32_MIN
00160 #define INT32_MIN (-1 - INT32_MAX)
00161 #endif
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171 #ifndef P
00172 #define P(x) x
00173 #endif
00174
00175
00176
00177
00178
00179 #ifndef EXIT_SUCCESS
00180 #define EXIT_SUCCESS 0
00181 #endif
00182
00183
00184
00185
00186
00187 #ifndef EXIT_FAILURE
00188 #define EXIT_FAILURE 1
00189 #endif
00190
00191
00192
00193
00194
00195 #ifndef FILENAME_MAX
00196
00197 #ifndef MAXPATHLEN
00198 #ifdef unix
00199 #include "sys/param.h"
00200 #endif
00201 #endif
00202
00203 #ifdef MAXPATHLEN
00204 #define FILENAME_MAX MAXPATHLEN
00205 #endif
00206 #ifndef MAXPATHLEN
00207 #define FILENAME_MAX 1024
00208 #endif
00209
00210 #endif
00211
00212
00213
00214
00215
00216 #ifndef remove
00217 extern int unlink P((const char * filename));
00218 #define remove unlink
00219 #endif
00220
00221
00222
00223
00224
00225
00226
00227 #ifndef errno
00228 extern int errno;
00229 #endif
00230
00231
00232
00233
00234
00235 char * icalloc P((int nelem, int elsize));
00236 char * icatalloc P((char * old, const char * new));
00237 char * icpyalloc P((const char * string));
00238 char * imalloc P((int n));
00239 void * irealloc P((void * pointer, int size));
00240 void icfree P((char * pointer));
00241 void ifree P((char * pointer));
00242 const char * scheck P((const char * string, const char * format));
00243
00244
00245
00246
00247
00248 #ifndef TRUE
00249 #define TRUE 1
00250 #endif
00251
00252 #ifndef FALSE
00253 #define FALSE 0
00254 #endif
00255
00256 #ifndef TYPE_BIT
00257 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
00258 #endif
00259
00260 #ifndef TYPE_SIGNED
00261 #define TYPE_SIGNED(type) (((type) -1) < 0)
00262 #endif
00263
00264
00265
00266
00267
00268
00269 #ifndef TYPE_INTEGRAL
00270 #define TYPE_INTEGRAL(type) (((type) 0.5) != 0.5)
00271 #endif
00272
00273 #ifndef INT_STRLEN_MAXIMUM
00274
00275
00276
00277
00278
00279
00280 #define INT_STRLEN_MAXIMUM(type) \
00281 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + \
00282 1 + TYPE_SIGNED(type))
00283 #endif
00284
00285
00286
00287
00288
00289 #ifndef GNUC_or_lint
00290 #ifdef lint
00291 #define GNUC_or_lint
00292 #endif
00293 #ifndef lint
00294 #ifdef __GNUC__
00295 #define GNUC_or_lint
00296 #endif
00297 #endif
00298 #endif
00299
00300 #ifndef INITIALIZE
00301 #ifdef GNUC_or_lint
00302 #define INITIALIZE(x) ((x) = 0)
00303 #endif
00304 #ifndef GNUC_or_lint
00305 #define INITIALIZE(x)
00306 #endif
00307 #endif
00308
00309
00310
00311
00312
00313
00314
00315 #ifndef _
00316 #if HAVE_GETTEXT
00317 #define _(msgid) gettext(msgid)
00318 #else
00319 #define _(msgid) msgid
00320 #endif
00321 #endif
00322
00323 #ifndef TZ_DOMAIN
00324 #define TZ_DOMAIN "tz"
00325 #endif
00326
00327 #if HAVE_INCOMPATIBLE_CTIME_R
00328 #undef asctime_r
00329 #undef ctime_r
00330 char *asctime_r P((struct tm const *, char *));
00331 char *ctime_r P((time_t const *, char *));
00332 #endif
00333
00334 #ifndef YEARSPERREPEAT
00335 #define YEARSPERREPEAT 400
00336 #endif
00337
00338
00339
00340
00341
00342 #ifndef AVGSECSPERYEAR
00343 #define AVGSECSPERYEAR 31556952L
00344 #endif
00345
00346 #ifndef SECSPERREPEAT
00347 #define SECSPERREPEAT ((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)
00348 #endif
00349
00350 #ifndef SECSPERREPEAT_BITS
00351 #define SECSPERREPEAT_BITS 34
00352 #endif
00353
00354
00355
00356
00357
00358 #endif