ArchWizard

DGD/

source navigation ]
diff markup ]
identifier search ]
file search ]
Version: [ 1.0.a0 ] [ 1.1 ] [ 1.2 ] [ 1.2p1 ] [ 1.2p2 ] [ 1.2p3 ] [ 1.2p4 ] [ 1.2.151 ]

  1 # if defined(__STDC__) || defined(__cplusplus)
  2 #  define P(proto)      proto
  3 #  define cvoid         const void
  4 # else
  5 #  define P(proto)      ()
  6 #  define cvoid         char
  7 # endif
  8 
  9 
 10 # ifdef BEOS
 11 
 12 # define UCHAR(c)       ((int) ((c) & 0xff))    /* unsigned character */
 13 # define SCHAR(c)       ((char) (c))            /* signed character */
 14 
 15 typedef int Int;
 16 typedef unsigned int Uint;
 17 
 18 # include <limits.h>
 19 # include <sys/types.h>
 20 # include <unistd.h>
 21 
 22 # ifdef INCLUDE_FILE_IO
 23 # include <fcntl.h>
 24 # include <sys/stat.h>
 25 # endif
 26 
 27 # ifdef INCLUDE_CTYPE
 28 # include <ctype.h>
 29 # endif
 30 
 31 # ifdef INCLUDE_TELNET
 32 # include "host/telnet.h"
 33 # endif
 34 
 35 # include <stdlib.h>
 36 # include <string.h>
 37 # include <setjmp.h>
 38 # include <stdio.h>
 39 
 40 # include <alloca.h>
 41 
 42 # define STRUCT_AL              4       /* define this if align(struct) > 2 */
 43 # define ALLOCA(type, size)     ((type *) alloca(sizeof(type) * \
 44                                                              (size_t) (size)))
 45 # define AFREE(ptr)             /* on function return */
 46 
 47 # define FS_BLOCK_SIZE          8192
 48 
 49 # define bool                   dgd_bool
 50 # define string                 dgd_string
 51 # define exit                   dgd_exit
 52 # define abort                  dgd_abort
 53 
 54 # endif /* BEOS */
 55 
 56 
 57 # ifdef WIN32
 58 
 59 # define UCHAR(c)       ((int)((c) & 0xff))     /* unsigned character */
 60 # define SCHAR(c)       ((char) (c))            /* signed character */
 61 
 62 typedef int Int;
 63 typedef unsigned int Uint;
 64 
 65 # include <limits.h>
 66 # include <sys\types.h>
 67 # include <malloc.h>
 68 
 69 # ifdef INCLUDE_FILE_IO
 70 # include <io.h>
 71 # include <direct.h>
 72 # include <fcntl.h>
 73 # include <sys\stat.h>
 74 
 75 # define F_OK   0
 76 # define R_OK   4
 77 # define W_OK   2
 78 # endif
 79 
 80 # ifdef INCLUDE_CTYPE
 81 # include <ctype.h>
 82 # endif
 83 
 84 # ifdef INCLUDE_TELNET
 85 # include "host\telnet.h"
 86 # endif
 87 
 88 # include <stdlib.h>
 89 # include <string.h>
 90 # include <setjmp.h>
 91 # include <stdio.h>
 92 
 93 # define STRUCT_AL              4       /* define this if align(struct) > 2 */
 94 # define ALLOCA(type, size)     ((type *) alloca(sizeof(type) * \
 95                                                              (size_t) (size)))
 96 # define AFREE(ptr)             /* on function return */
 97 
 98 # define FS_BLOCK_SIZE          2048
 99 
100 # define bool                   dgd_bool
101 # define exit                   dgd_exit
102 # define abort                  dgd_abort
103 
104 extern void dgd_exit(int);
105 extern void dgd_abort(void);
106 
107 # endif /* WIN32 */
108 
109 
110 # ifdef MACOS
111 
112 # define UCHAR(c)       ((int)((c) & 0xff))     /* unsigned character */
113 # define SCHAR(c)       ((char) (c))            /* signed character */
114 
115 typedef int Int;
116 typedef unsigned int Uint;
117 
118 # include <limits.h>
119 # include "macdgd.h"
120 
121 # ifdef INCLUDE_TELNET
122 # include "telnet.h"
123 # endif
124 
125 # define ALLOCA(type, size)     ALLOC(type, size)
126 # define AFREE(ptr)             FREE(ptr)
127 
128 # define FS_BLOCK_SIZE          2048
129 
130 # endif /* MACOS */
131 
132 
133 # ifdef SUNOS4
134 
135 # define GENERIC_BSD
136 
137 # include <alloca.h>
138 # define ALLOCA(type, size)     ((type *) alloca(sizeof(type) * \
139                                                              (size_t) (size)))
140 # define AFREE(ptr)             /* on function return */
141 
142 # endif /* SUNOS4 */
143 
144 
145 # ifdef SOLARIS
146 
147 # define GENERIC_SYSV
148 
149 # include <alloca.h>
150 # define ALLOCA(type, size)     ((type *) alloca(sizeof(type) * \
151                                                              (size_t) (size)))
152 # define AFREE(ptr)             /* on function return */
153 
154 # include <sys/file.h>          /* for FNDELAY */
155 
156 # endif /* SOLARIS */
157 
158 
159 # ifdef DECALPHA
160 
161 # define GENERIC_SYSV
162 
163 # define STRUCT_AL              8       /* define this if align(struct) > 2 */
164 
165 # include <alloca.h>
166 # define ALLOCA(type, size)     ((type *) alloca(sizeof(type) * \
167                                                              (size_t) (size)))
168 # define AFREE(ptr)             /* on function return */
169 
170 # endif /* DECALPHA */
171 
172 
173 # if defined(NETBSD) || defined(BSD386)
174 
175 # ifdef __alpha__
176 # define STRUCT_AL              8       /* define this if align(struct) > 2 */
177 # endif
178 
179 # define GENERIC_BSD
180 
181 # define ALLOCA(type, size)     ((type *) alloca(sizeof(type) * \
182                                                              (size_t) (size)))
183 # define AFREE(ptr)             /* on function return */
184 
185 # endif /* NETBSD || BSD386 */
186 
187 
188 # ifdef LINUX
189 
190 # define GENERIC_SYSV
191 
192 # define ALLOCA(type, size)     ((type *) alloca(sizeof(type) * \
193                                                              (size_t) (size)))
194 # define AFREE(ptr)             /* on function return */
195 
196 # endif /* LINUX */
197 
198 
199 # ifdef GENERIC_BSD
200 
201 # define UCHAR(c)       ((int) ((c) & 0xff))    /* unsigned character */
202 # define SCHAR(c)       ((char) (c))            /* signed character */
203 
204 typedef int Int;
205 typedef unsigned int Uint;
206 
207 # include <limits.h>
208 # include <sys/types.h>
209 # include <unistd.h>
210 
211 # ifdef INCLUDE_FILE_IO
212 # include <fcntl.h>
213 # include <sys/stat.h>
214 # endif
215 
216 # ifdef INCLUDE_CTYPE
217 # include <ctype.h>
218 # endif
219 
220 # ifdef INCLUDE_TELNET
221 # include "host/telnet.h"
222 # endif
223 
224 # include <stdlib.h>
225 # include <string.h>
226 # include <setjmp.h>
227 # include <stdio.h>
228 
229 # ifndef STRUCT_AL
230 # define STRUCT_AL              4       /* define this if align(struct) > 2 */
231 # endif
232 # ifndef ALLOCA
233 # define ALLOCA(type, size)     ALLOC(type, size)
234 # define AFREE(ptr)             FREE(ptr)
235 # endif
236 
237 # define FS_BLOCK_SIZE          8192
238 
239 # endif /* GENERIC_BSD */
240 
241 
242 # ifdef GENERIC_SYSV
243 
244 # define UCHAR(c)       ((int) ((c) & 0xff))    /* unsigned character */
245 # define SCHAR(c)       ((char) (c))            /* signed character */
246 
247 typedef int Int;
248 typedef unsigned int Uint;
249 
250 # include <limits.h>
251 # include <sys/types.h>
252 # include <unistd.h>
253 
254 # ifdef INCLUDE_FILE_IO
255 # include <fcntl.h>
256 # include <sys/stat.h>
257 # ifndef FNDELAY
258 # define FNDELAY        O_NDELAY
259 # endif
260 # endif
261 
262 # ifdef INCLUDE_CTYPE
263 # include <ctype.h>
264 # endif
265 
266 # ifdef INCLUDE_TELNET
267 # include "host/telnet.h"
268 # endif
269 
270 # include <stdlib.h>
271 # include <string.h>
272 # include <setjmp.h>
273 # include <stdio.h>
274 
275 # ifndef STRUCT_AL
276 # define STRUCT_AL              4       /* define this if align(struct) > 2 */
277 # endif
278 # ifndef ALLOCA
279 # define ALLOCA(type, size)     ALLOC(type, size)
280 # define AFREE(ptr)             FREE(ptr)
281 # endif
282 
283 # define FS_BLOCK_SIZE          8192
284 
285 # endif /* GENERIC_SYSV */
286 
287 
288 typedef char bool;
289 # ifndef TRUE
290 # define TRUE           1
291 # define FALSE          0
292 # endif
293 
294 
295 extern void  P_message  P((char*));
296 
297 # ifndef O_BINARY
298 # define O_BINARY       0
299 # endif
300 
301 # ifdef INCLUDE_FILE_IO
302 # if defined(GENERIC_BSD) || defined(GENERIC_SYSV) || defined(BEOS)
303         /* no filename translation */
304 # define path_native(buf, path) (path)
305 
306 # define P_open         open
307 # define P_close        close
308 # define P_read         read
309 # define P_write        write
310 # define P_lseek        lseek
311 # define P_fstat        fstat
312 # define P_stat         stat
313 # define P_access       access
314 # define P_unlink       unlink
315 # define P_rename       rename
316 # define P_mkdir        mkdir
317 # define P_rmdir        rmdir
318 # define P_chdir        chdir
319 # else
320         /* filename translation */
321 extern char *path_native        P((char*, char*));
322 
323 extern int P_open       P((char*, int, int));
324 extern int P_close      P((int));
325 extern int P_read       P((int, char*, int));
326 extern int P_write      P((int, char*, int));
327 extern long P_lseek     P((int, long, int));
328 extern int P_fstat      P((int, struct stat*));
329 extern int P_stat       P((char*, struct stat*));
330 extern int P_access     P((char*, int));
331 extern int P_unlink     P((char*));
332 extern int P_rename     P((char*, char*));
333 extern int P_mkdir      P((char*, int));
334 extern int P_rmdir      P((char*));
335 extern int P_chdir      P((char*));
336 # endif
337 # endif /* INCLUDE_FILE_IO */
338 
339 extern bool  P_opendir  P((char*));
340 extern char *P_readdir  P((void));
341 extern void  P_closedir P((void));
342 
343 extern void  P_srandom  P((long));
344 extern long  P_random   P((void));
345 
346 extern Uint  P_time     P((void));
347 extern Uint  P_mtime    P((unsigned short*));
348 extern char *P_ctime    P((char*, Uint));
349 
350 extern void  P_timer    P((Uint, unsigned int));
351 extern bool  P_timeout  P((Uint*, unsigned short*));
352 
353 extern char *P_crypt    P((char*, char*));
354 
355 /* these must be the same on all hosts */
356 # define BEL    '\007'
357 # define BS     '\010'
358 # define HT     '\011'
359 # define LF     '\012'
360 # define VT     '\013'
361 # define FF     '\014'
362 # define CR     '\015'
363 
364 # define ALGN(x, s)     (((x) + (s) - 1) & ~((s) - 1))
365 
366 
367 # ifdef HOST_WITH_UNSIGNED_CHAR
368 # undef UCHAR
369 # undef SCHAR
370 # define UCHAR(c)       ((char) (c))                    /* unsigned character */
371 # define SCHAR(c)       ((((char) (c)) - 128) ^ -128)   /* signed character */
372 # endif
373 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.