~ubuntu-branches/ubuntu/karmic/fweb/karmic

« back to all changes in this revision

Viewing changes to Web/os.h

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2002-01-04 23:20:22 UTC
  • Revision ID: james.westby@ubuntu.com-20020104232022-330ad4iyzpvb5bm4
Tags: upstream-1.62
ImportĀ upstreamĀ versionĀ 1.62

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if(0)
 
2
  FTANGLE v1.60,
 
3
 created with UNIX on "Thursday, September 24, 1998 at 16:12." 
 
4
  COMMAND LINE: "Web/ftangle Web/os -A -# --F -= 1.62/Web/os.h"
 
5
  RUN TIME:     "Friday, September 25, 1998 at 8:02."
 
6
  WEB FILE:     "Web/os.web"
 
7
  CHANGE FILE:  (none)
 
8
#endif
 
9
 
 
10
 
 
11
 
 
12
#ifndef OS_H_
 
13
#define OS_H_
 
14
 
 
15
#ifdef HAVE_CONFIG_H
 
16
#include "config.h" 
 
17
#endif 
 
18
 
 
19
 
 
20
 
 
21
 
 
22
#include "custom.h" 
 
23
 
 
24
 
 
25
 
 
26
 
 
27
#if OLD_PROTOTYPES
 
28
#define PROTO(args) () 
 
29
#else
 
30
#define PROTO(args) args 
 
31
#endif 
 
32
 
 
33
 
 
34
 
 
35
#if(0)
 
36
 
 
37
#if(NUM_VA_ARGS == 1)
 
38
#undef NUM_VA_ARGS
 
39
#define NUM_VA_ARGS 2
 
40
#endif
 
41
#endif
 
42
 
 
43
#if VARIABLE_ARGUMENTS
 
44
#define ELLIPSIS ,... 
 
45
 
 
46
#define VA_ARGS
 
47
#define VA_start
 
48
#if(NUM_VA_ARGS == 1)
 
49
#define VA_ALIST(args) (va_alist) 
 
50
#define VA_DCL(args) va_dcl
 
51
#define VA_START(a,n) va_start(a)
 
52
#else
 
53
#define VA_ALIST(args) args 
 
54
#define VA_DCL(args) args
 
55
#define VA_START(a,n) va_start(a,n)
 
56
#endif
 
57
#define VA_LIST(a) va_list a;
 
58
#else
 
59
#define ELLIPSIS 
 
60
 
 
61
#define VA_ARGS ,arg_ptr
 
62
#define arg_ptr arg1,arg2,arg3,arg4,arg5,arg6,\
 
63
arg7,arg8,arg9,arg10,arg11,arg12,arg13
 
64
#define VA_start outer_char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,\
 
65
*arg7,*arg8,*arg9,*arg10,*arg11,*arg12,*arg13;
 
66
#define VA_ALIST(args) args
 
67
#define VA_DCL(args) args
 
68
#define VA_LIST(a)
 
69
#define VA_START(a,n)
 
70
#ifdef va_arg
 
71
#undef va_arg
 
72
#define va_arg(a,type) (type)"KLUDGE for va_arg"
 
73
#endif
 
74
#define va_end(a)
 
75
#define vprintf printf
 
76
#define vsprintf sprintf
 
77
#endif 
 
78
 
 
79
 
 
80
 
 
81
#if !NO_VOID  
 
82
 
 
83
#define VOID void
 
84
#define SRTN void
 
85
#else
 
86
#define VOID 
 
87
#define void char
 
88
#define SRTN int
 
89
#endif 
 
90
 
 
91
#if KEEP_CONST
 
92
#define CONST const
 
93
#else
 
94
#define CONST
 
95
#endif
 
96
 
 
97
 
 
98
 
 
99
#if OLD_PROTOTYPES
 
100
 
 
101
#define FCN(args) args
 
102
#define C0(cmnt) ;
 
103
#define C1(cmnt) ;
 
104
#define C2(cmnt) ;VA_start
 
105
#else
 
106
 
 
107
 
 
108
 
 
109
#define FCN(args) (
 
110
 
 
111
#define C0(cmnt) , 
 
112
 
 
113
#define C1(cmnt) ) 
 
114
 
 
115
#define C2(cmnt) ,...) 
 
116
#endif 
 
117
 
 
118
 
 
119
 
 
120
 
 
121
 
 
122
#ifndef ANSI_CTYPE_H
 
123
#define ANSI_CTYPE_H 0
 
124
#endif
 
125
 
 
126
#ifndef ANSI_SPRINTF
 
127
#define ANSI_SPRINTF 0
 
128
#endif
 
129
 
 
130
#ifndef ANSI_SSCANF
 
131
#define ANSI_SSCANF 0
 
132
#endif
 
133
 
 
134
#ifndef ANSI_SYSTEM
 
135
#define ANSI_SYSTEM 0
 
136
#endif
 
137
 
 
138
#ifndef DEBUG_XCHR
 
139
#define DEBUG_XCHR 0
 
140
#endif
 
141
 
 
142
#ifndef FCN_CALLS
 
143
#define FCN_CALLS 0
 
144
#endif
 
145
 
 
146
#ifndef FANCY_SPLIT
 
147
#define FANCY_SPLIT 0
 
148
#endif
 
149
 
 
150
#ifndef HAVE_ERROR
 
151
#define HAVE_ERROR 0
 
152
#endif
 
153
 
 
154
#ifndef HAVE_GETENV
 
155
#define HAVE_GETENV 0
 
156
#endif
 
157
 
 
158
#ifndef HAVE_GETTIMEOFDAY
 
159
#define HAVE_GETTIMEOFDAY 0
 
160
#endif
 
161
 
 
162
#ifndef HAVE_LIMITS_H
 
163
#define HAVE_LIMITS_H 0
 
164
#endif
 
165
 
 
166
#ifndef HAVE_SYS_TIMEB_H
 
167
#define HAVE_SYS_TIMEB_H 0
 
168
#endif
 
169
 
 
170
#ifndef HAVE_STDARG_H
 
171
#define HAVE_STDARG_H 0
 
172
#endif
 
173
 
 
174
#ifndef HAVE_STDDEF_H
 
175
#define HAVE_STDDEF_H 0
 
176
#endif
 
177
 
 
178
#ifndef HAVE_STDLIB_H
 
179
#define HAVE_STDLIB_H 0
 
180
#endif
 
181
 
 
182
#ifndef HAVE_STD_PROTOTYPES
 
183
#define HAVE_STD_PROTOTYPES 0
 
184
#endif
 
185
 
 
186
#ifndef HAVE_STRERROR
 
187
#define HAVE_STRERROR 0
 
188
#endif
 
189
 
 
190
#ifndef HAVE_VALUES_H
 
191
#define HAVE_VALUES_H 0
 
192
#endif
 
193
 
 
194
#ifndef HUGE_POINTERS
 
195
#define HUGE_POINTERS 0
 
196
#endif
 
197
 
 
198
#ifndef KEEP_CONST
 
199
#define KEEP_CONST 0
 
200
#endif
 
201
 
 
202
#ifndef NEW_DIFFTIME
 
203
#define NEW_DIFFTIME 0
 
204
#endif
 
205
 
 
206
#ifndef NO_VOID
 
207
#define NO_VOID 0
 
208
#endif
 
209
 
 
210
#ifndef NON_ANSI_CALLOC
 
211
#define NON_ANSI_CALLOC 0
 
212
#endif
 
213
 
 
214
#ifndef OLD_PROTOTYPES
 
215
#define OLD_PROTOTYPES 0
 
216
#endif
 
217
 
 
218
#ifndef PRINT_AVAILABLE_MEMORY
 
219
#define PRINT_AVAILABLE_MEMORY 0
 
220
#endif
 
221
 
 
222
#ifndef SIZE_T_DEFINED
 
223
#define SIZE_T_DEFINED 0
 
224
#endif
 
225
 
 
226
#ifndef TIMING
 
227
#define TIMING 0
 
228
#endif
 
229
 
 
230
#ifndef TRANSLATE_ASCII
 
231
#define TRANSLATE_ASCII 0
 
232
#endif
 
233
 
 
234
#ifndef UNIX_PATH
 
235
#define UNIX_PATH 0
 
236
#endif
 
237
 
 
238
 
 
239
 
 
240
#if HAVE_STDARG_H
 
241
#include <stdarg.h>
 
242
#else
 
243
#include <varargs.h>
 
244
#endif
 
245
 
 
246
#if HAVE_STDLIB_H
 
247
#include <stdlib.h>
 
248
#endif
 
249
 
 
250
#if !HAVE_STD_PROTOTYPES
 
251
#include "stdlib0.h"
 
252
#endif
 
253
 
 
254
#if HAVE_STDDEF_H
 
255
#include <stddef.h>
 
256
#endif
 
257
 
 
258
#if HAVE_LIMITS_H
 
259
#include <limits.h> 
 
260
#else
 
261
#if HAVE_VALUES_H
 
262
#define INT_MAX MAXINT
 
263
#define LONG_MAX MAXLONG
 
264
#else
 
265
#define INT_MAX 0x7FFF
 
266
#define LONG_MAX INT_MAX
 
267
#endif
 
268
 
 
269
#define INT_MIN (~(INT_MAX))
 
270
#define LONG_MIN (~(LONG_MAX))
 
271
#define ULONG_MAX (MAXLONG | (~(MAXLONG)))
 
272
 
 
273
#endif
 
274
 
 
275
#if HAVE_FLOAT_H
 
276
#include <float.h>
 
277
#else
 
278
#ifndef DBL_DIG
 
279
#define DBL_DIG 10
 
280
#endif
 
281
#endif
 
282
 
 
283
#if !NON_ANSI_CALLOC
 
284
#define CALLOC calloc
 
285
#define REALLOC(old_ptr, new_size, old_size) realloc(old_ptr, new_size)
 
286
#define FREE free
 
287
#endif 
 
288
 
 
289
 
 
290
 
 
291
 
 
292
 
 
293
#define UL(num) ((unsigned long)(num))
 
294
 
 
295
#include <stdio.h> 
 
296
#include <errno.h>
 
297
 
 
298
 
 
299
#define FWRITE(buf,len,fp) fwrite((CONST void *)(buf),(size_t)(len),\
 
300
    (size_t)(1),fp)
 
301
 
 
302
#define WRITE1(buf,len) \
 
303
 {\
 
304
 int _k;\
 
305
 outer_char *_p;\
 
306
 for(_p= buf,_k= (int)(len); _k>0; _k--)\
 
307
   {\
 
308
   PUTC(*_p);\
 
309
   _p++;\
 
310
   }\
 
311
 }
 
312
 
 
313
 
 
314
#if STDC_HEADERS || HAVE_STRING_H
 
315
#include <string.h> 
 
316
 
 
317
#if !STDC_HEADERS && HAVE_MEMORY_H
 
318
#include <memory.h>
 
319
#endif
 
320
#else
 
321
#include <strings.h>
 
322
#endif
 
323
 
 
324
#include <ctype.h> 
 
325
 
 
326
 
 
327
 
 
328
 
 
329
 
 
330
#if !ANSI_CTYPE_H
 
331
#undef isalpha
 
332
#undef isupper
 
333
#undef islower
 
334
 
 
335
#define isupper(c) ('A' <= (unsigned)(c) && (unsigned)(c) <= 'Z')
 
336
#define islower(c) ('a' <= (unsigned)(c) && (unsigned)(c) <= 'z')
 
337
#define isalpha(c) (isupper(c) || islower(c))
 
338
#endif
 
339
 
 
340
#include <setjmp.h> 
 
341
 
 
342
 
 
343
 
 
344
 
 
345
 
 
346
 
 
347
 
 
348
 
 
349
 
 
350
#ifndef TIMING_WIDTH
 
351
#define TIMING_WIDTH 1 
 
352
#endif 
 
353
 
 
354
#include <time.h> 
 
355
 
 
356
 
 
357
#if TIMING
 
358
 
 
359
 
 
360
 
 
361
 
 
362
#if HAVE_GETTIMEOFDAY
 
363
 
 
364
#include <sys/time.h>
 
365
#undef NEW_DIFFTIME
 
366
#define NEW_DIFFTIME 1
 
367
#define TIME_T struct timeval
 
368
#ifdef _COMMON_h
 
369
struct timezone tz_dummy;
 
370
#endif
 
371
int gettimeofday PROTO((struct timeval*tp,struct timezone*tzp));
 
372
#define TIME(p) gettimeofday(p, &tz_dummy)
 
373
#else
 
374
#if HAVE_SYS_TIMEB_H
 
375
 
 
376
#include <sys/timeb.h>
 
377
#undef NEW_DIFFTIME
 
378
#define NEW_DIFFTIME 1
 
379
#define TIME_T struct timeb
 
380
#define TIME(p) ftime(p)
 
381
#else 
 
382
#define TIME_T time_t
 
383
#define TIME(p) time(p)
 
384
#endif 
 
385
#endif 
 
386
 
 
387
#if NEW_DIFFTIME
 
388
#define DIFFTIME diff_time 
 
389
 
 
390
 
 
391
 
 
392
#else
 
393
#define DIFFTIME difftime 
 
394
#endif 
 
395
 
 
396
clock_t clock PROTO((VOID));
 
397
 
 
398
#ifndef CLOCKS_PER_SEC
 
399
#ifdef CLK_TCK
 
400
#define CLOCKS_PER_SEC CLK_TCK 
 
401
#else
 
402
#define CLOCKS_PER_SEC 1000000 
 
403
 
 
404
#endif 
 
405
#endif 
 
406
 
 
407
#endif 
 
408
 
 
409
 
 
410
 
 
411
#ifndef THE_SYSTEM
 
412
#define THE_SYSTEM "UNKNOWN"
 
413
#endif
 
414
 
 
415
#ifndef LOCAL_BANNER
 
416
#define LOCAL_BANNER ""
 
417
#endif
 
418
 
 
419
#ifndef NULL_FILE_NAME
 
420
#define NULL_FILE_NAME "null"
 
421
#endif
 
422
 
 
423
#ifndef C_EXT
 
424
#define C_EXT "c"
 
425
#endif
 
426
 
 
427
#ifndef M_EXT
 
428
#define M_EXT "mk"
 
429
#endif
 
430
 
 
431
#ifndef X_EXT
 
432
#define X_EXT "sty"
 
433
#endif
 
434
 
 
435
#ifndef Cpp_EXT
 
436
#define Cpp_EXT "c++"
 
437
#endif
 
438
 
 
439
#ifndef R_EXT
 
440
#define R_EXT "r"
 
441
#endif
 
442
 
 
443
#ifndef R90_EXT
 
444
#define R90_EXT "r90"
 
445
#endif
 
446
 
 
447
#ifndef N_EXT
 
448
#define N_EXT "f"
 
449
#endif
 
450
 
 
451
#ifndef N90_EXT
 
452
#define N90_EXT "f90"
 
453
#endif
 
454
 
 
455
#ifndef VARIABLE_ARGUMENTS
 
456
#define VARIABLE_ARGUMENTS 0
 
457
#endif
 
458
 
 
459
#if VARIABLE_ARGUMENTS
 
460
#ifndef NUM_VA_ARGS
 
461
#define NUM_VA_ARGS 2
 
462
#endif
 
463
#endif
 
464
 
 
465
#ifndef PREFIX_END_CHAR
 
466
#define PREFIX_END_CHAR '/'
 
467
#endif
 
468
 
 
469
 
 
470
 
 
471
 
 
472
#ifndef _strmac_
 
473
#include "strmac.h" 
 
474
#endif 
 
475
 
 
476
 
 
477
 
 
478
#define UNUSED(var) var
 
479
 
 
480
 
 
481
 
 
482
#define HUGE_FCN_PTR
 
483
 
 
484
#ifndef _POSIX_SOURCE
 
485
#define _POSIX_SOURCE 
 
486
#endif
 
487
 
 
488
#include <math.h> 
 
489
#ifdef HUGE
 
490
#undef HUGE 
 
491
#endif
 
492
 
 
493
#if HUGE_POINTERS 
 
494
#define HUGE huge 
 
495
#else
 
496
#define HUGE 
 
497
#endif 
 
498
 
 
499
 
 
500
 
 
501
#define PLUS
 
502
 
 
503
 
 
504
 
 
505
#define CAST(type,var) var
 
506
#define _Xx(fmt) fmt
 
507
 
 
508
 
 
509
 
 
510
 
 
511
#define beep Fbeep
 
512
 
 
513
 
 
514
 
 
515
 
 
516
 
 
517
 
 
518
#endif 
 
519
 
 
520
 
 
521
 
 
522
 
 
523