private.h revision 15923
1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by the University of 16 * California, Berkeley and its contributors. 17 * 4. Neither the name of the University nor the names of its contributors 18 * may be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * $Id:$ 34 */ 35 36 37#ifndef PRIVATE_H 38 39#define PRIVATE_H 40 41/* Stuff moved from Makefile.inc to reduce clutter */ 42#ifndef TM_GMTOFF 43#define TM_GMTOFF tm_gmtoff 44#define TM_ZONE tm_zone 45#define STD_INSPIRED 1 46#define PCTS 1 47#define HAVE_LONG_DOUBLE 1 48#define TZDIR "/usr/share/zoneinfo" 49#endif /* ndef TM_GMTOFF */ 50 51/* 52** This header is for use ONLY with the time conversion code. 53** There is no guarantee that it will remain unchanged, 54** or that it will remain at all. 55** Do NOT copy it to any system include directory. 56** Thank you! 57*/ 58 59/* 60** ID 61*/ 62 63#ifndef lint 64#ifndef NOID 65/*static char privatehid[] = "@(#)private.h 7.33";*/ 66#endif /* !defined NOID */ 67#endif /* !defined lint */ 68 69/* 70** Defaults for preprocessor symbols. 71** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'. 72*/ 73 74#ifndef HAVE_ADJTIME 75#define HAVE_ADJTIME 1 76#endif /* !defined HAVE_ADJTIME */ 77 78#ifndef HAVE_SETTIMEOFDAY 79#define HAVE_SETTIMEOFDAY 3 80#endif /* !defined HAVE_SETTIMEOFDAY */ 81 82#ifndef HAVE_UNISTD_H 83#define HAVE_UNISTD_H 1 84#endif /* !defined HAVE_UNISTD_H */ 85 86/* 87** Nested includes 88*/ 89 90#include "sys/types.h" /* for time_t */ 91#include "stdio.h" 92#include "ctype.h" 93#include "errno.h" 94#include "string.h" 95#include "limits.h" /* for CHAR_BIT */ 96#include "time.h" 97#include "stdlib.h" 98 99#if HAVE_UNISTD_H - 0 100#include "unistd.h" /* for F_OK and R_OK */ 101#endif /* HAVE_UNISTD_H - 0 */ 102 103#if !(HAVE_UNISTD_H - 0) 104#ifndef F_OK 105#define F_OK 0 106#endif /* !defined F_OK */ 107#ifndef R_OK 108#define R_OK 4 109#endif /* !defined R_OK */ 110#endif /* !(HAVE_UNISTD_H - 0) */ 111 112/* 113** Workarounds for compilers/systems. 114*/ 115 116/* 117** SunOS 4.1.1 cc lacks const. 118*/ 119 120#ifndef const 121#ifndef __STDC__ 122#define const 123#endif /* !defined __STDC__ */ 124#endif /* !defined const */ 125 126/* 127** SunOS 4.1.1 cc lacks prototypes. 128*/ 129 130#ifndef P 131#ifdef __STDC__ 132#define P(x) x 133#endif /* defined __STDC__ */ 134#ifndef __STDC__ 135#define P(x) () 136#endif /* !defined __STDC__ */ 137#endif /* !defined P */ 138 139/* 140** SunOS 4.1.1 headers lack EXIT_SUCCESS. 141*/ 142 143#ifndef EXIT_SUCCESS 144#define EXIT_SUCCESS 0 145#endif /* !defined EXIT_SUCCESS */ 146 147/* 148** SunOS 4.1.1 headers lack EXIT_FAILURE. 149*/ 150 151#ifndef EXIT_FAILURE 152#define EXIT_FAILURE 1 153#endif /* !defined EXIT_FAILURE */ 154 155/* 156** SunOS 4.1.1 headers lack FILENAME_MAX. 157*/ 158 159#ifndef FILENAME_MAX 160 161#ifndef MAXPATHLEN 162#ifdef unix 163#include "sys/param.h" 164#endif /* defined unix */ 165#endif /* !defined MAXPATHLEN */ 166 167#ifdef MAXPATHLEN 168#define FILENAME_MAX MAXPATHLEN 169#endif /* defined MAXPATHLEN */ 170#ifndef MAXPATHLEN 171#define FILENAME_MAX 1024 /* Pure guesswork */ 172#endif /* !defined MAXPATHLEN */ 173 174#endif /* !defined FILENAME_MAX */ 175 176/* 177** SunOS 4.1.1 libraries lack remove. 178*/ 179 180#ifndef remove 181extern int unlink P((const char * filename)); 182#define remove unlink 183#endif /* !defined remove */ 184 185/* 186** Finally, some convenience items. 187*/ 188 189#ifndef TRUE 190#define TRUE 1 191#endif /* !defined TRUE */ 192 193#ifndef FALSE 194#define FALSE 0 195#endif /* !defined FALSE */ 196 197#ifndef INT_STRLEN_MAXIMUM 198/* 199** 302 / 1000 is log10(2.0) rounded up. 200** Subtract one for the sign bit; 201** add one for integer division truncation; 202** add one more for a minus sign. 203*/ 204#define INT_STRLEN_MAXIMUM(type) \ 205 ((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2) 206#endif /* !defined INT_STRLEN_MAXIMUM */ 207 208/* 209** INITIALIZE(x) 210*/ 211 212#ifndef GNUC_or_lint 213#ifdef lint 214#define GNUC_or_lint 215#endif /* defined lint */ 216#ifndef lint 217#ifdef __GNUC__ 218#define GNUC_or_lint 219#endif /* defined __GNUC__ */ 220#endif /* !defined lint */ 221#endif /* !defined GNUC_or_lint */ 222 223#ifndef INITIALIZE 224#ifdef GNUC_or_lint 225#define INITIALIZE(x) ((x) = 0) 226#endif /* defined GNUC_or_lint */ 227#ifndef GNUC_or_lint 228#define INITIALIZE(x) 229#endif /* !defined GNUC_or_lint */ 230#endif /* !defined INITIALIZE */ 231 232/* 233** UNIX was a registered trademark of UNIX System Laboratories in 1993. 234*/ 235 236#endif /* !defined PRIVATE_H */ 237