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 privatehid[] = "@(#)private.h 7.55";
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 void logwtmp(char *, char *, char *);
00085
00086
00087
00088
00089
00090 #include "sys/types.h"
00091 #include "stdio.h"
00092 #include "errno.h"
00093 #include "string.h"
00094 #include "limits.h"
00095 #include "time.h"
00096 #include "stdlib.h"
00097
00098 #if HAVE_GETTEXT
00099 #include "libintl.h"
00100 #endif
00101
00102 #if HAVE_SYS_WAIT_H
00103 #include <sys/wait.h>
00104 #endif
00105
00106 #ifndef WIFEXITED
00107 #define WIFEXITED(status) (((status) & 0xff) == 0)
00108 #endif
00109 #ifndef WEXITSTATUS
00110 #define WEXITSTATUS(status) (((status) >> 8) & 0xff)
00111 #endif
00112
00113 #if HAVE_UNISTD_H
00114 #include "unistd.h"
00115 #endif
00116
00117 #if !HAVE_UNISTD_H
00118 #ifndef F_OK
00119 #define F_OK 0
00120 #endif
00121 #ifndef R_OK
00122 #define R_OK 4
00123 #endif
00124 #endif
00125
00126
00127 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137 #ifndef P
00138 #if __STDC__
00139 #define P(x) x
00140 #else
00141 #define P(x) ()
00142 #endif
00143 #endif
00144
00145
00146
00147
00148
00149 #ifndef EXIT_SUCCESS
00150 #define EXIT_SUCCESS 0
00151 #endif
00152
00153
00154
00155
00156
00157 #ifndef EXIT_FAILURE
00158 #define EXIT_FAILURE 1
00159 #endif
00160
00161
00162
00163
00164
00165 #ifndef FILENAME_MAX
00166
00167 #ifndef MAXPATHLEN
00168 #ifdef unix
00169 #include "sys/param.h"
00170 #endif
00171 #endif
00172
00173 #ifdef MAXPATHLEN
00174 #define FILENAME_MAX MAXPATHLEN
00175 #endif
00176 #ifndef MAXPATHLEN
00177 #define FILENAME_MAX 1024
00178 #endif
00179
00180 #endif
00181
00182
00183
00184
00185
00186 #ifndef remove
00187 extern int unlink P((const char * filename));
00188 #define remove unlink
00189 #endif
00190
00191
00192
00193
00194
00195
00196
00197 #ifndef errno
00198 extern int errno;
00199 #endif
00200
00201
00202
00203
00204
00205
00206
00207 #ifndef asctime_r
00208 extern char * asctime_r(register const struct tm *, char *);
00209 #endif
00210
00211
00212
00213
00214
00215 char * icalloc P((int nelem, int elsize));
00216 char * icatalloc P((char * old, const char * new));
00217 char * icpyalloc P((const char * string));
00218 char * imalloc P((int n));
00219 void * irealloc P((void * pointer, int size));
00220 void icfree P((char * pointer));
00221 void ifree P((char * pointer));
00222 const char *scheck P((const char *string, const char *format));
00223
00224
00225
00226
00227
00228 #ifndef TRUE
00229 #define TRUE 1
00230 #endif
00231
00232 #ifndef FALSE
00233 #define FALSE 0
00234 #endif
00235
00236 #ifndef TYPE_BIT
00237 #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
00238 #endif
00239
00240 #ifndef TYPE_SIGNED
00241 #define TYPE_SIGNED(type) (((type) -1) < 0)
00242 #endif
00243
00244
00245
00246
00247
00248
00249 #ifndef TYPE_INTEGRAL
00250 #define TYPE_INTEGRAL(type) (((type) 0.5) != 0.5)
00251 #endif
00252
00253 #ifndef INT_STRLEN_MAXIMUM
00254
00255
00256
00257
00258
00259
00260 #define INT_STRLEN_MAXIMUM(type) \
00261 ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + \
00262 1 + TYPE_SIGNED(type))
00263 #endif
00264
00265
00266
00267
00268
00269 #ifndef GNUC_or_lint
00270 #ifdef lint
00271 #define GNUC_or_lint
00272 #endif
00273 #ifndef lint
00274 #ifdef __GNUC__
00275 #define GNUC_or_lint
00276 #endif
00277 #endif
00278 #endif
00279
00280 #ifndef INITIALIZE
00281 #ifdef GNUC_or_lint
00282 #define INITIALIZE(x) ((x) = 0)
00283 #endif
00284 #ifndef GNUC_or_lint
00285 #define INITIALIZE(x)
00286 #endif
00287 #endif
00288
00289
00290
00291
00292
00293
00294
00295 #ifndef _
00296 #if HAVE_GETTEXT
00297 #define _(msgid) gettext(msgid)
00298 #else
00299 #define _(msgid) msgid
00300 #endif
00301 #endif
00302
00303 #ifndef TZ_DOMAIN
00304 #define TZ_DOMAIN "tz"
00305 #endif
00306
00307 #if HAVE_INCOMPATIBLE_CTIME_R
00308 #undef asctime_r
00309 #undef ctime_r
00310 char *asctime_r P((struct tm const *, char *));
00311 char *ctime_r P((time_t const *, char *));
00312 #endif
00313
00314
00315
00316
00317
00318 #endif