blob: 7d0d99f476e4f7c0b28f5211ec68f8a5fc441d61 (
plain)
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
|
/****************************************************************************/
/* STDINC.H: standard include file for C programs. */
/* */
/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */
/* It's free because it's yours. */
/****************************************************************************/
/*
* If not already loaded, include stdio.h.
*/
#ifndef FILE
# include <stdio.h>
#endif
/*
* STREAM: a tasteful replacement for FILE *.
*/
typedef FILE *stream;
/*
* NULL: denotes a pointer to nothing.
*/
#ifndef NULL
# define NULL 0
#endif
/*
* GLOBAL: make something global when declared at file level; a workaround
* for the Strict-Ref/Def-initialization model in ANSI C. Predefine with
* something innocuous (like a comment) to actually allocate the data.
*/
#ifndef global
# define global extern
#endif
/*
* LOCAL: make something local when declared at file level.
*/
#define local static
/*
* PERMANENT: make data declared within a function static.
*/
#define permanent static
/*
* BOOL, TRUE and FALSE: standard names for logical values.
*/
#ifndef TRUE
typedef short int bool;
# define FALSE 0
# define TRUE 1
#endif
/*
* STRING: for null-terminated character strings.
*/
typedef char *string;
// sm: this isn't a performance change, it's a boxing crankiness change
#define NULLCHR 0
/*
* PROC, IPROC: pointers to procedures and integer-valued functions.
*/
typedef void (*proc)();
typedef int (*iproc)();
/*
* PI, etc. -- mathematical constants
*/
#define PI 3.14159265358979323846
#define TWO_PI 6.28318530717958647693
#define FOUR_PI 12.56637061435917295385
#define HALF_PI 1.57079632679489661923
#define FRTHRD_PI 4.18879020478639098462
/*
* ABS: returns the absolute value of its argument
* MAX: returns the argument with the highest value
* MIN: returns the argument with the lowest value
*/
#define ABS(x) (((x) < 0) ? -(x) : (x))
#define MAX(x,y) (((x) > (y)) ? (x) : (y))
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
|