private.h revision 9936
1#ifndef PRIVATE_H 2 3#define PRIVATE_H 4 5/* Stuff moved from Makefile.inc to reduce clutter */ 6#ifndef TM_GMTOFF 7#define TM_GMTOFF tm_gmtoff 8#define TM_ZONE tm_zone 9#define STD_INSPIRED 1 10#define PCTS 1 11#define HAVE_LONG_DOUBLE 1 12#define TZDIR "/usr/share/zoneinfo" 13#endif /* ndef TM_GMTOFF */ 14 15/* 16** This header is for use ONLY with the time conversion code. 17** There is no guarantee that it will remain unchanged, 18** or that it will remain at all. 19** Do NOT copy it to any system include directory. 20** Thank you! 21*/ 22 23/* 24** ID 25*/ 26 27#ifndef lint 28#ifndef NOID 29/*static char privatehid[] = "@(#)private.h 7.33";*/ 30#endif /* !defined NOID */ 31#endif /* !defined lint */ 32 33/* 34** Defaults for preprocessor symbols. 35** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'. 36*/ 37 38#ifndef HAVE_ADJTIME 39#define HAVE_ADJTIME 1 40#endif /* !defined HAVE_ADJTIME */ 41 42#ifndef HAVE_SETTIMEOFDAY 43#define HAVE_SETTIMEOFDAY 3 44#endif /* !defined HAVE_SETTIMEOFDAY */ 45 46#ifndef HAVE_UNISTD_H 47#define HAVE_UNISTD_H 1 48#endif /* !defined HAVE_UNISTD_H */ 49 50/* 51** Nested includes 52*/ 53 54#include "sys/types.h" /* for time_t */ 55#include "stdio.h" 56#include "ctype.h" 57#include "errno.h" 58#include "string.h" 59#include "limits.h" /* for CHAR_BIT */ 60#include "time.h" 61#include "stdlib.h" 62 63#if HAVE_UNISTD_H - 0 64#include "unistd.h" /* for F_OK and R_OK */ 65#endif /* HAVE_UNISTD_H - 0 */ 66 67#if !(HAVE_UNISTD_H - 0) 68#ifndef F_OK 69#define F_OK 0 70#endif /* !defined F_OK */ 71#ifndef R_OK 72#define R_OK 4 73#endif /* !defined R_OK */ 74#endif /* !(HAVE_UNISTD_H - 0) */ 75 76/* 77** Workarounds for compilers/systems. 78*/ 79 80/* 81** SunOS 4.1.1 cc lacks const. 82*/ 83 84#ifndef const 85#ifndef __STDC__ 86#define const 87#endif /* !defined __STDC__ */ 88#endif /* !defined const */ 89 90/* 91** SunOS 4.1.1 cc lacks prototypes. 92*/ 93 94#ifndef P 95#ifdef __STDC__ 96#define P(x) x 97#endif /* defined __STDC__ */ 98#ifndef __STDC__ 99#define P(x) () 100#endif /* !defined __STDC__ */ 101#endif /* !defined P */ 102 103/* 104** SunOS 4.1.1 headers lack EXIT_SUCCESS. 105*/ 106 107#ifndef EXIT_SUCCESS 108#define EXIT_SUCCESS 0 109#endif /* !defined EXIT_SUCCESS */ 110 111/* 112** SunOS 4.1.1 headers lack EXIT_FAILURE. 113*/ 114 115#ifndef EXIT_FAILURE 116#define EXIT_FAILURE 1 117#endif /* !defined EXIT_FAILURE */ 118 119/* 120** SunOS 4.1.1 headers lack FILENAME_MAX. 121*/ 122 123#ifndef FILENAME_MAX 124 125#ifndef MAXPATHLEN 126#ifdef unix 127#include "sys/param.h" 128#endif /* defined unix */ 129#endif /* !defined MAXPATHLEN */ 130 131#ifdef MAXPATHLEN 132#define FILENAME_MAX MAXPATHLEN 133#endif /* defined MAXPATHLEN */ 134#ifndef MAXPATHLEN 135#define FILENAME_MAX 1024 /* Pure guesswork */ 136#endif /* !defined MAXPATHLEN */ 137 138#endif /* !defined FILENAME_MAX */ 139 140/* 141** SunOS 4.1.1 libraries lack remove. 142*/ 143 144#ifndef remove 145extern int unlink P((const char * filename)); 146#define remove unlink 147#endif /* !defined remove */ 148 149/* 150** Finally, some convenience items. 151*/ 152 153#ifndef TRUE 154#define TRUE 1 155#endif /* !defined TRUE */ 156 157#ifndef FALSE 158#define FALSE 0 159#endif /* !defined FALSE */ 160 161#ifndef INT_STRLEN_MAXIMUM 162/* 163** 302 / 1000 is log10(2.0) rounded up. 164** Subtract one for the sign bit; 165** add one for integer division truncation; 166** add one more for a minus sign. 167*/ 168#define INT_STRLEN_MAXIMUM(type) \ 169 ((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2) 170#endif /* !defined INT_STRLEN_MAXIMUM */ 171 172/* 173** INITIALIZE(x) 174*/ 175 176#ifndef GNUC_or_lint 177#ifdef lint 178#define GNUC_or_lint 179#endif /* defined lint */ 180#ifndef lint 181#ifdef __GNUC__ 182#define GNUC_or_lint 183#endif /* defined __GNUC__ */ 184#endif /* !defined lint */ 185#endif /* !defined GNUC_or_lint */ 186 187#ifndef INITIALIZE 188#ifdef GNUC_or_lint 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** UNIX was a registered trademark of UNIX System Laboratories in 1993. 198*/ 199 200#endif /* !defined PRIVATE_H */ 201