Revision: | 1.2 |
Committed: | Sat Nov 15 02:13:37 2003 UTC (20 years, 11 months ago) by schorsch |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1, rad5R3, HEAD |
Changes since 1.1: | +25 -19 lines |
Log Message: | Continued ANSIfication, and reduced other compile warnings. |
# | Content |
---|---|
1 | #ifndef lint |
2 | static const char RCSid[] = "$Id: primout.c,v 1.1 2003/02/22 02:07:26 greg Exp $"; |
3 | #endif |
4 | /* |
5 | * Routines for primitive output |
6 | * |
7 | * 1/10/85 |
8 | */ |
9 | |
10 | |
11 | #include "meta.h" |
12 | |
13 | |
14 | FILE *pout = NULL; /* the primitive output stream */ |
15 | |
16 | |
17 | void |
18 | plseg( /* plot line segment */ |
19 | int a0, |
20 | int xstart, |
21 | int ystart, |
22 | int xend, |
23 | int yend |
24 | ) |
25 | |
26 | { |
27 | PRIMITIVE p; |
28 | int reverse; |
29 | |
30 | if (xstart < xend) { |
31 | p.xy[XMN] = xstart; |
32 | p.xy[XMX] = xend; |
33 | reverse = FALSE; |
34 | } else { |
35 | p.xy[XMN] = xend; |
36 | p.xy[XMX] = xstart; |
37 | reverse = TRUE; |
38 | } |
39 | |
40 | if (ystart < yend) { |
41 | p.xy[YMN] = ystart; |
42 | p.xy[YMX] = yend; |
43 | } else { |
44 | p.xy[YMN] = yend; |
45 | p.xy[YMX] = ystart; |
46 | reverse = ystart > yend && !reverse; |
47 | } |
48 | |
49 | p.com = PLSEG; |
50 | p.arg0 = (reverse << 6) | a0; |
51 | p.args = NULL; |
52 | |
53 | writep(&p, pout); |
54 | } |
55 | |
56 | |
57 | void |
58 | pprim( /* print primitive */ |
59 | int co, |
60 | int a0, |
61 | int xmin, |
62 | int ymin, |
63 | int xmax, |
64 | int ymax, |
65 | char *s |
66 | ) |
67 | |
68 | { |
69 | PRIMITIVE p; |
70 | |
71 | p.com = co; |
72 | p.arg0 = a0; |
73 | p.xy[XMN] = xmin; |
74 | p.xy[YMN] = ymin; |
75 | p.xy[XMX] = xmax; |
76 | p.xy[YMX] = ymax; |
77 | p.args = s; |
78 | |
79 | writep(&p, pout); |
80 | |
81 | } |
82 | |
83 | |
84 | |
85 | void |
86 | pglob( /* print global */ |
87 | int co, |
88 | int a0, |
89 | char *s |
90 | ) |
91 | { |
92 | PRIMITIVE p; |
93 | |
94 | p.com = co; |
95 | p.arg0 = a0; |
96 | p.xy[XMN] = p.xy[YMN] = p.xy[XMX] = p.xy[YMX] = -1; |
97 | p.args = s; |
98 | |
99 | writep(&p, pout); |
100 | |
101 | } |