1 /* pic.h	(Berkeley)	1.2	83/08/09	*/
2 #define	dprintf	if(dbg)printf
3 
4 #define	HEAD1	1
5 #define	HEAD2	2
6 #define	HEAD12	(HEAD1+HEAD2)
7 #define	INVIS	4
8 #define	CW_ARC	8	/* clockwise arc */
9 #define	PI	3.141592654
10 #define	PI2	PI/2
11 #define	SCALE	1.0	/* default scale: units/inch */
12 #define	WID	0.75	/* default width for boxes and ellipses */
13 #define	WID2	0.375
14 #define	HT	0.5	/* default height and line length */
15 #define	HT2	0.25	/* because no floating init exprs! */
16 #define	HT5	0.1
17 #define	HT10	0.05
18 
19 #define	MAXOBJ	1200
20 #define	MAXTEXT	1200
21 #define	SYMTAB	200
22 
23 /* these have to be like so, so that we can write */
24 /* things like R & V, etc. */
25 #define	H	0
26 #define	V	1
27 #define	R_DIR	0
28 #define	U_DIR	1
29 #define	L_DIR	2
30 #define	D_DIR	3
31 #define	ishor(n)	(((n) & V) == 0)
32 #define	isvert(n)	(((n) & V) != 0)
33 #define	isright(n)	((n) == R_DIR)
34 #define	isleft(n)	((n) == L_DIR)
35 #define	isdown(n)	((n) == D_DIR)
36 #define	isup(n)		((n) == U_DIR)
37 
38 typedef union {		/* the yacc stack type */
39 	int	i;
40 	char	*p;
41 	struct obj *o;
42 	float	f;
43 } YYSTYPE;
44 
45 extern	YYSTYPE	yylval, yyval;
46 
47 struct attr {	/* attribute of an object */
48 	int	a_type;
49 	YYSTYPE	a_val;
50 };
51 
52 struct obj {	/* stores various things in variable length */
53 	int	o_type;
54 	int	o_count;	/* number of things */
55 	int	o_nobj;		/* index in objlist */
56 	int	o_mode;		/* hor or vert */
57 	float	o_x;	/* coord of "center" */
58 	float	o_y;
59 	int	o_nt1;	/* 1st index in text[] for this object */
60 	int	o_nt2;	/* 2nd; difference is #text strings */
61 	int	o_attr;	/* various attributes of interest */
62 	int	o_dotdash;	/* kludge in a dot/dash mode */
63 	float	o_ddval;	/* value of dot/dash expression */
64 	float	o_val[1];	/* actually this will be > 1 in general */
65 				/* type is not always FLOAT!!!! */
66 };
67 
68 struct symtab {
69 	char	*s_name;
70 	int	s_type;
71 	YYSTYPE	s_val;
72 	struct symtab *s_next;
73 };
74 
75 struct text {
76 	int	t_type;
77 	char	*t_val;
78 };
79 
80 extern	int	dbg;
81 extern	struct	obj	*objlist[];
82 extern	int	nobj;
83 extern	struct	attr	attr[];
84 extern	int	nattr;
85 extern	struct	text	text[];
86 extern	int	ntext;
87 extern	int	ntext1;
88 extern	float	curx, cury;
89 extern	int	hvmode;
90 extern	int	codegen;
91 extern	char	*malloc(), *tostring();
92 extern	float	getfval(), getcomp();
93 extern	YYSTYPE	getvar();
94 extern	struct symtab *lookup(), *makevar();
95 
96 extern	float	deltx, delty;
97 extern	int	lineno;
98 extern	int	synerr;
99 extern	int	crop;
100 extern	int	res, DX, DY;
101 
102 extern	float	sxmin, sxmax, symin, symax;
103 extern	float	xmin, ymin, xmax, ymax;
104 extern	struct obj *leftthing(), *boxgen(), *circgen(), *arcgen();
105 extern	struct obj *linegen(), *splinegen(), *movegen(), *textgen();
106 extern	struct obj *troffgen(), *rightthing(), *blockgen();
107 extern	struct	obj *makenode(), *makepos(), *fixpos(), *makebetween();
108 extern	struct	obj *getpos(), *gethere(), *getfirst(), *getlast(), *getblock();
109 
110 struct pushstack {
111 	float	p_x;
112 	float	p_y;
113 	int	p_hvmode;
114 	float	p_xmin;
115 	float	p_ymin;
116 	float	p_xmax;
117 	float	p_ymax;
118 	struct symtab *p_symtab;
119 };
120 extern	struct pushstack stack[];
121 extern	int	nstack;
122 extern int cw;
123 
124 extern float atof();
125