private.h (2741) | private.h (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 --- 12 unchanged lines hidden (view full) --- 21*/ 22 23/* 24** ID 25*/ 26 27#ifndef lint 28#ifndef NOID | 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 --- 12 unchanged lines hidden (view full) --- 21*/ 22 23/* 24** ID 25*/ 26 27#ifndef lint 28#ifndef NOID |
29static char privatehid[] = "@(#)private.h 7.5"; | 29/*static char privatehid[] = "@(#)private.h 7.33";*/ |
30#endif /* !defined NOID */ 31#endif /* !defined lint */ 32 33/* | 30#endif /* !defined NOID */ 31#endif /* !defined lint */ 32 33/* |
34** const | 34** Defaults for preprocessor symbols. 35** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'. |
35*/ 36 | 36*/ 37 |
37#ifndef const 38#ifndef __STDC__ 39#define const 40#endif /* !defined __STDC__ */ 41#endif /* !defined const */ | 38#ifndef HAVE_ADJTIME 39#define HAVE_ADJTIME 1 40#endif /* !defined HAVE_ADJTIME */ |
42 | 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 |
|
43/* | 50/* |
44** void | 51** Nested includes |
45*/ 46 | 52*/ 53 |
47#ifndef void | 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 |
48#ifndef __STDC__ | 85#ifndef __STDC__ |
49#ifndef vax 50#ifndef sun 51#define void char 52#endif /* !defined sun */ 53#endif /* !defined vax */ | 86#define const |
54#endif /* !defined __STDC__ */ | 87#endif /* !defined __STDC__ */ |
55#endif /* !defined void */ | 88#endif /* !defined const */ |
56 57/* | 89 90/* |
58** P((args)) | 91** SunOS 4.1.1 cc lacks prototypes. |
59*/ 60 61#ifndef P 62#ifdef __STDC__ 63#define P(x) x 64#endif /* defined __STDC__ */ 65#ifndef __STDC__ | 92*/ 93 94#ifndef P 95#ifdef __STDC__ 96#define P(x) x 97#endif /* defined __STDC__ */ 98#ifndef __STDC__ |
66#define ASTERISK * 67#define P(x) ( /ASTERISK x ASTERISK/ ) | 99#define P(x) () |
68#endif /* !defined __STDC__ */ 69#endif /* !defined P */ 70 71/* | 100#endif /* !defined __STDC__ */ 101#endif /* !defined P */ 102 103/* |
72** genericptr_t | 104** SunOS 4.1.1 headers lack EXIT_SUCCESS. |
73*/ 74 | 105*/ 106 |
75#ifdef __STDC__ 76typedef void * genericptr_t; 77#endif /* defined __STDC__ */ 78#ifndef __STDC__ 79typedef char * genericptr_t; 80#endif /* !defined __STDC__ */ | 107#ifndef EXIT_SUCCESS 108#define EXIT_SUCCESS 0 109#endif /* !defined EXIT_SUCCESS */ |
81 | 110 |
82#include "sys/types.h" /* for time_t */ 83#include "stdio.h" 84#include "ctype.h" 85#include "errno.h" 86#include "string.h" 87#include "limits.h" /* for CHAR_BIT */ 88#ifndef _TIME_ 89#include "time.h" 90#endif /* !defined _TIME_ */ | 111/* 112** SunOS 4.1.1 headers lack EXIT_FAILURE. 113*/ |
91 | 114 |
92#ifndef remove 93extern int unlink P((const char * filename)); 94#define remove unlink 95#endif /* !defined remove */ | 115#ifndef EXIT_FAILURE 116#define EXIT_FAILURE 1 117#endif /* !defined EXIT_FAILURE */ |
96 | 118 |
119/* 120** SunOS 4.1.1 headers lack FILENAME_MAX. 121*/ 122 |
|
97#ifndef FILENAME_MAX 98 99#ifndef MAXPATHLEN 100#ifdef unix 101#include "sys/param.h" 102#endif /* defined unix */ 103#endif /* !defined MAXPATHLEN */ 104 105#ifdef MAXPATHLEN 106#define FILENAME_MAX MAXPATHLEN 107#endif /* defined MAXPATHLEN */ 108#ifndef MAXPATHLEN 109#define FILENAME_MAX 1024 /* Pure guesswork */ 110#endif /* !defined MAXPATHLEN */ 111 112#endif /* !defined FILENAME_MAX */ 113 | 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 |
114#ifndef EXIT_SUCCESS 115#define EXIT_SUCCESS 0 116#endif /* !defined EXIT_SUCCESS */ | 140/* 141** SunOS 4.1.1 libraries lack remove. 142*/ |
117 | 143 |
118#ifndef EXIT_FAILURE 119#define EXIT_FAILURE 1 120#endif /* !defined EXIT_FAILURE */ | 144#ifndef remove 145extern int unlink P((const char * filename)); 146#define remove unlink 147#endif /* !defined remove */ |
121 | 148 |
122#ifdef __STDC__ 123 124#define alloc_size_t size_t 125#define qsort_size_t size_t 126#define fwrite_size_t size_t 127 128#endif /* defined __STDC__ */ 129#ifndef __STDC__ 130 131#ifndef alloc_size_t 132#define alloc_size_t unsigned 133#endif /* !defined alloc_size_t */ 134 135#ifndef qsort_size_t 136#ifdef USG 137#define qsort_size_t unsigned 138#endif /* defined USG */ 139#ifndef USG 140#define qsort_size_t int 141#endif /* !defined USG */ 142#endif /* !defined qsort_size_t */ 143 144#ifndef fwrite_size_t 145#define fwrite_size_t int 146#endif /* !defined fwrite_size_t */ 147 148#ifndef USG 149extern char * sprintf P((char * buf, const char * format, ...)); 150#endif /* !defined USG */ 151 152#endif /* !defined __STDC__ */ 153 | |
154/* | 149/* |
155** Ensure that these are declared--redundantly declaring them shouldn't hurt. | 150** Finally, some convenience items. |
156*/ 157 | 151*/ 152 |
158extern char * getenv P((const char * name)); 159extern genericptr_t malloc P((alloc_size_t size)); 160extern genericptr_t calloc P((alloc_size_t nelem, alloc_size_t elsize)); 161extern genericptr_t realloc P((genericptr_t oldptr, alloc_size_t newsize)); 162 163#ifdef USG 164extern void exit P((int s)); 165extern void qsort P((genericptr_t base, qsort_size_t nelem, 166 qsort_size_t elsize, int (*comp)())); 167extern void perror P((const char * string)); 168extern void free P((char * buf)); 169#endif /* defined USG */ 170 | |
171#ifndef TRUE 172#define TRUE 1 173#endif /* !defined TRUE */ 174 175#ifndef FALSE 176#define FALSE 0 177#endif /* !defined FALSE */ 178 --- 4 unchanged lines hidden (view full) --- 183** add one for integer division truncation; 184** add one more for a minus sign. 185*/ 186#define INT_STRLEN_MAXIMUM(type) \ 187 ((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2) 188#endif /* !defined INT_STRLEN_MAXIMUM */ 189 190/* | 153#ifndef TRUE 154#define TRUE 1 155#endif /* !defined TRUE */ 156 157#ifndef FALSE 158#define FALSE 0 159#endif /* !defined FALSE */ 160 --- 4 unchanged lines hidden (view full) --- 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/* |
191** UNIX is a registered trademark of AT&T. 192** VAX is a trademark of Digital Equipment Corporation. | 173** INITIALIZE(x) |
193*/ 194 | 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 |
|
195#endif /* !defined PRIVATE_H */ | 200#endif /* !defined PRIVATE_H */ |