28 |
|
static char *cap; |
29 |
|
|
30 |
|
|
31 |
< |
mendpage() /* end of page */ |
31 |
> |
static int let_dir( register int c); |
32 |
> |
static void closepoly(void); |
33 |
> |
static void polyval( register int x, register int y); |
34 |
> |
static void decival( register int v); |
35 |
> |
|
36 |
> |
|
37 |
> |
void |
38 |
> |
mendpage(void) /* end of page */ |
39 |
|
{ |
40 |
|
pflush(); |
41 |
|
pglob(PEOP, 0200, NULL); |
42 |
|
} |
43 |
|
|
44 |
< |
|
45 |
< |
mdone() /* end of graphics metafile */ |
44 |
> |
void |
45 |
> |
mdone(void) /* end of graphics metafile */ |
46 |
|
{ |
47 |
|
pflush(); |
48 |
|
pglob(PEOF, 0200, NULL); |
49 |
|
} |
50 |
|
|
51 |
< |
|
52 |
< |
minclude(fname) /* include a file */ |
53 |
< |
char *fname; |
51 |
> |
void |
52 |
> |
minclude( /* include a file */ |
53 |
> |
char *fname |
54 |
> |
) |
55 |
|
{ |
56 |
|
pflush(); |
57 |
|
pglob(PINCL, 1, fname); |
58 |
|
} |
59 |
|
|
60 |
< |
|
61 |
< |
msetpat(pn, pat) /* set a pattern */ |
62 |
< |
int pn; |
63 |
< |
char *pat; |
60 |
> |
void |
61 |
> |
msetpat( /* set a pattern */ |
62 |
> |
int pn, |
63 |
> |
char *pat |
64 |
> |
) |
65 |
|
{ |
66 |
|
pflush(); |
67 |
|
pglob(PSET, pn+4, pat); |
68 |
|
} |
69 |
|
|
70 |
|
|
71 |
< |
mopenseg(sname) /* open a segment */ |
72 |
< |
char *sname; |
71 |
> |
void |
72 |
> |
mopenseg( /* open a segment */ |
73 |
> |
char *sname |
74 |
> |
) |
75 |
|
{ |
76 |
|
pflush(); |
77 |
|
pglob(POPEN, 0, sname); |
78 |
|
} |
79 |
|
|
80 |
|
|
81 |
< |
mcloseseg() /* close current segment */ |
81 |
> |
void |
82 |
> |
mcloseseg(void) /* close current segment */ |
83 |
|
{ |
84 |
|
pflush(); |
85 |
|
pglob(PCLOSE, 0200, NULL); |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
< |
mline(x, y, type, thick, color) /* start a line */ |
90 |
< |
int x, y; |
91 |
< |
int type, thick, color; |
89 |
> |
void |
90 |
> |
mline( /* start a line */ |
91 |
> |
int x, int y, |
92 |
> |
int type, int thick, int color |
93 |
> |
) |
94 |
|
{ |
95 |
|
pflush(); |
96 |
|
cura0 = (type<<4 & 060) | (thick<<2 & 014) | (color & 03); |
99 |
|
} |
100 |
|
|
101 |
|
|
102 |
< |
mrectangle(xmin, ymin, xmax, ymax, pat, color) /* fill a rectangle */ |
103 |
< |
int xmin, ymin, xmax, ymax; |
104 |
< |
int pat, color; |
102 |
> |
void |
103 |
> |
mrectangle( /* fill a rectangle */ |
104 |
> |
int xmin, int ymin, int xmax, int ymax, |
105 |
> |
int pat, int color |
106 |
> |
) |
107 |
|
{ |
108 |
|
pflush(); |
109 |
|
cura0 = (pat<<2 & 014) | (color & 03); |
111 |
|
} |
112 |
|
|
113 |
|
|
114 |
< |
mtriangle(xmin, ymin, xmax, ymax, d, pat, color) /* fill a triangle */ |
115 |
< |
int xmin, ymin, xmax, ymax; |
116 |
< |
int d, pat, color; |
114 |
> |
void |
115 |
> |
mtriangle( /* fill a triangle */ |
116 |
> |
int xmin, int ymin, int xmax, int ymax, |
117 |
> |
int d, int pat, int color |
118 |
> |
) |
119 |
|
{ |
120 |
|
pflush(); |
121 |
|
cura0 = (let_dir(d)<<4 & 060) | (pat<<2 & 014) | (color & 03); |
123 |
|
} |
124 |
|
|
125 |
|
|
126 |
< |
mpoly(x, y, border, pat, color) /* start a polygon */ |
127 |
< |
int x, y; |
128 |
< |
int border, pat, color; |
126 |
> |
void |
127 |
> |
mpoly( /* start a polygon */ |
128 |
> |
int x, int y, |
129 |
> |
int border, int pat, int color |
130 |
> |
) |
131 |
|
{ |
132 |
|
pflush(); |
133 |
|
cura0 = (border<<6 & 0100) | (pat<<2 & 014) | (color & 03); |
139 |
|
} |
140 |
|
|
141 |
|
|
142 |
< |
mtext(x, y, s, cpi, color) /* matrix string */ |
143 |
< |
int x, y; |
144 |
< |
char *s; |
145 |
< |
int cpi; |
146 |
< |
int color; |
142 |
> |
void |
143 |
> |
mtext( /* matrix string */ |
144 |
> |
int x, int y, |
145 |
> |
char *s, |
146 |
> |
int cpi, |
147 |
> |
int color |
148 |
> |
) |
149 |
|
{ |
150 |
|
pflush(); |
151 |
|
cura0 = (color & 03); |
163 |
|
} |
164 |
|
|
165 |
|
|
166 |
< |
mvstr(xmin, ymin, xmax, ymax, s, d, thick, color) /* vector string */ |
167 |
< |
int xmin, ymin, xmax, ymax; |
168 |
< |
char *s; |
169 |
< |
int d, thick, color; |
166 |
> |
void |
167 |
> |
mvstr( /* vector string */ |
168 |
> |
int xmin, int ymin, int xmax, int ymax, |
169 |
> |
char *s, |
170 |
> |
int d, int thick, int color |
171 |
> |
) |
172 |
|
{ |
173 |
|
pflush(); |
174 |
|
cura0 = (let_dir(d)<<4 & 060) | (thick<<2 & 014) | (color & 03); |
176 |
|
} |
177 |
|
|
178 |
|
|
179 |
< |
msegment(xmin, ymin, xmax, ymax, sname, d, thick, color) /* segment */ |
180 |
< |
int xmin, ymin, xmax, ymax; |
181 |
< |
char *sname; |
182 |
< |
int d, thick, color; |
179 |
> |
void |
180 |
> |
msegment( /* segment */ |
181 |
> |
int xmin, int ymin, int xmax, int ymax, |
182 |
> |
char *sname, |
183 |
> |
int d, int thick, int color |
184 |
> |
) |
185 |
|
{ |
186 |
|
pflush(); |
187 |
|
cura0 = (let_dir(d)<<4 & 060) | (thick<<2 & 014) | (color & 03); |
189 |
|
} |
190 |
|
|
191 |
|
|
192 |
< |
mdraw(x, y) /* draw to next point */ |
193 |
< |
int x, y; |
192 |
> |
void |
193 |
> |
mdraw( /* draw to next point */ |
194 |
> |
int x, int y |
195 |
> |
) |
196 |
|
{ |
197 |
|
if (inpoly) { |
198 |
|
polyval(x, y); |
204 |
|
} |
205 |
|
|
206 |
|
|
207 |
< |
static |
208 |
< |
decival(v) /* add value to polygon */ |
209 |
< |
register int v; |
207 |
> |
static void |
208 |
> |
decival( /* add value to polygon */ |
209 |
> |
register int v |
210 |
> |
) |
211 |
|
{ |
212 |
|
if (!v) |
213 |
|
return; |
216 |
|
} |
217 |
|
|
218 |
|
|
219 |
< |
static |
220 |
< |
polyval(x, y) /* add vertex to a polygon */ |
221 |
< |
register int x, y; |
219 |
> |
static void |
220 |
> |
polyval( /* add vertex to a polygon */ |
221 |
> |
register int x, |
222 |
> |
register int y |
223 |
> |
) |
224 |
|
{ |
225 |
|
*cap++ = ' '; |
226 |
|
putdec(x); |
229 |
|
} |
230 |
|
|
231 |
|
|
232 |
< |
static |
233 |
< |
closepoly() /* close current polygon */ |
232 |
> |
static void |
233 |
> |
closepoly(void) /* close current polygon */ |
234 |
|
{ |
235 |
|
*cap = '\0'; |
236 |
|
pprim(PPFILL, cura0, 0, 0, XYSIZE-1, XYSIZE-1, curargs); |
239 |
|
|
240 |
|
|
241 |
|
static int |
242 |
< |
let_dir(c) /* convert letter to corresponding direction */ |
243 |
< |
register int c; |
242 |
> |
let_dir( /* convert letter to corresponding direction */ |
243 |
> |
register int c |
244 |
> |
) |
245 |
|
{ |
246 |
|
switch (c) { |
247 |
|
case 'R': |