File: system.h

package info (click to toggle)
cproto 4.7m-4
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 984 kB
  • sloc: ansic: 4,110; sh: 3,268; lex: 1,059; yacc: 870; makefile: 269
file content (217 lines) | stat: -rw-r--r-- 4,345 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
/* $Id: system.h,v 4.13 2011/01/02 19:23:38 tom Exp $
 *
 * cproto configuration and system dependencies
 */
#ifndef	SYSTEM_H
#define	SYSTEM_H
 
#include <stdio.h>
#include <ctype.h>

#ifndef TRUE
#define	TRUE	(1)
#endif

#ifndef FALSE
#define	FALSE	(0)
#endif

/* Watcom C++ predefines __DOS__ when the target platform is MS-DOS */
/* Borland C++ for MS-DOS predefines __MSDOS__ */
#if defined(__DOS__) || defined(__MSDOS__)
#ifndef MSDOS
#define MSDOS
#endif
#endif

/* Watcom C++ predefines __OS2__ when the target platform is OS/2 */
#ifdef __OS2__
#ifndef OS2
#define OS2
#endif
#endif

/* Watcom C++ predefines __NT__ when the target platform is Windows NT */
#ifdef __NT__
#ifndef WIN32
#define WIN32
#endif
#endif

/* Turbo C preprocessor */
#ifdef __TURBOC__
#define YY_READ_BUF_SIZE 256	/* patch */
#define HAVE_TMPFILE 1
#define HAVE_GETOPT_H 1	/* use the one from porting-directory */
#include <io.h>		/* declares 'read()' for flex */
#endif

#ifdef TURBO_CPP
#define CPP "cpp -P-"
#endif

/* EMX C preprocessor */
#ifdef __EMX__
#ifndef CPP
#define CPP "cpp"
#endif
#endif

/* Watcom C preprocessor */
#ifdef __WATCOMC__
#ifndef CPP
#define CPP "wcl386 /p"
#endif
#define HAVE_POPEN_PROTOTYPE 1
#define popen _popen
#define pclose _pclose
#define HAVE_TMPFILE 1
#endif

/* Microsoft C preprocessor */
#ifdef M_I86
#ifndef CPP
#define CPP "cl /E /nologo"
#endif
#define HAVE_TMPFILE 1
#endif

/* Vax C */
#ifdef vms
#ifndef CPP
#define CPP "cc /preprocess_only=%s"
#endif
#define unlink remove
#define HAVE_TMPFILE 1
#define HAVE_GETOPT_H 1
#define USE_flex 1
#define CURRENT_DIR "[]"
#endif

/* Set configuration parameters for systems on which we cannot run autoconf.
 * (Assumes Posix unless overridden).
 */
#ifndef HAVE_GETOPT_H
#define HAVE_GETOPT_H 0
#endif 

#ifndef HAVE_LIBDBMALLOC
#define HAVE_LIBDBMALLOC 0
#endif

#ifndef HAVE_LIBDMALLOC
#define HAVE_LIBDMALLOC 0
#endif

#ifndef HAVE_STDLIB_H
#define HAVE_STDLIB_H 1
#endif

#ifndef HAVE_STRING_H
#define HAVE_STRING_H 1
#endif

#ifndef HAVE_STRSTR
#define HAVE_STRSTR 1
#endif

#ifndef HAVE_UNISTD_H
#define HAVE_UNISTD_H 0
#endif

#ifndef STDC_HEADERS
#define STDC_HEADERS 1
#endif

/* Default C preprocessor on UNIX systems */
#ifndef MSDOS
#ifndef CPP
#define CPP "/lib/cpp"
#endif
#endif

/* maximum include file nesting (for parsing externs) */
#ifndef MAX_INC_DEPTH
#define MAX_INC_DEPTH 999999
#endif

/* string denoting current-directory, for includes */
#ifndef CURRENT_DIR
#define CURRENT_DIR "."
#endif

/* maximum text buffer size (for tokens) */
#ifndef MAX_TEXT_SIZE
#define MAX_TEXT_SIZE 4096
#endif

#if HAVE_STDLIB_H
#include <stdlib.h>
#else
extern char *malloc  (size_t n);
extern char *realloc (char *p, size_t n);
extern char *getenv  (const char *v);
#endif

/* Declare argument for exit() function */
#ifdef vms
#include <stsdef.h>
#define	EXIT_SUCCESS	(STS$M_INHIB_MSG | STS$K_SUCCESS)
#define	EXIT_FAILURE	(STS$M_INHIB_MSG | STS$K_ERROR)
#else
#ifndef EXIT_SUCCESS
#define	EXIT_SUCCESS	(0)
#endif
#ifndef EXIT_FAILURE
#define	EXIT_FAILURE	(1)
#endif
#endif /* vms */

#if HAVE_UNISTD_H
#include <unistd.h>
#endif

#if STDC_HEADERS || HAVE_STRING_H
#  include <string.h>
/* An ANSI string.h and pre-ANSI memory.h might conflict.  */
#  if !STDC_HEADERS && HAVE_MEMORY_H
#    include <memory.h>
#  endif /* not STDC_HEADERS and HAVE_MEMORY_H */
#else /* not STDC_HEADERS and not HAVE_STRING_H */
#  include <strings.h>
#  define strchr index
#  define strrchr rindex
extern char *strstr  (const char *s, const char *p);
/* memory.h and strings.h conflict on some systems.  */
#endif /* not STDC_HEADERS and not HAVE_STRING_H */

/*
 * The DOALLOC symbol controls whether we compile in the simple memory tests
 * in 'trace.c' (use dbmalloc for more rigorous testing).
 */
#ifdef DOALLOC
#include <trace.h>
#endif /* DOALLOC */

/*
 * Lint libraries are useful only on systems that are likely to have lint.
 * The OPT_LINTLIBRARY symbol controls whether we compile in the lint library
 * support.
 */
#ifndef OPT_LINTLIBRARY
# define OPT_LINTLIBRARY 0
#endif

#if BISON_HAS_YYTNAME || YACC_HAS_YYTOKS || YACC_HAS_YYTOKS_2 || YACC_HAS_YYNAME
# define YYDEBUG 1
#endif

#if HAVE_LIBDMALLOC
#include <dmalloc.h>	/* Gray Watson's library */
#endif

#if HAVE_LIBDBMALLOC
#include <dbmalloc.h>	/* Conor Cahill's library */
#endif

#endif /* SYSTEM_H */