aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/postscript/common/gen.h
blob: 1553c2c46d2fc8b093dbad339f9c96d7f6725e65 (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
/*
 *
 * A few definitions that shouldn't have to change. Used by most programs in
 * this package.
 *
 */

#define PROGRAMVERSION	"3.3.2"

/* XXX: replace tempnam with something safer, but leaky */
extern	char*	safe_tempnam(char*, char*);
#define	tempnam	safe_tempnam

#define NON_FATAL	0
#define FATAL		1
#define USER_FATAL	2

#define OFF		0
#define ON		1

#define FALSE		0
#define TRUE		1

#define BYTE		8
#define BMASK		0377

#define POINTS		72.3

#ifndef PI
#define PI		3.141592654
#endif

#define ONEBYTE		0
#define UTFENCODING	1

#define READING		ONEBYTE
#define WRITING		ONEBYTE

/*
 *
 * DOROUND controls whether some translators include file ROUNDPAGE (path.h)
 * after the prologue. Used to round page dimensions obtained from the clippath
 * to know paper sizes. Enabled by setting DOROUND to TRUE (or 1).
 *
 */

#define DOROUND	TRUE

/*
 *
 * Default resolution and the height and width of a page (in case we need to get
 * to upper left corner) - only used in BoundingBox calculations!!
 *
 */

#define DEFAULT_RES	72
#define PAGEHEIGHT	11.0 * DEFAULT_RES
#define PAGEWIDTH	8.5 * DEFAULT_RES

/*
 *
 * Simple macros.
 *
 */

#define ABS(A)		((A) >= 0 ? (A) : -(A))
#define MIN(A, B)	((A) < (B) ? (A) : (B))
#define MAX(A, B)	((A) > (B) ? (A) : (B))