blob: 0298b0f80f46c00d8fc48ceba1dd4eb49fbd1a26 (
plain) (
blame)
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
|
include "../lib/polyphot.h"
# AP_YCOORDS -- Procedure to fetch the next center coordinates for the polygon.
int procedure ap_ycoords (cl, delim, xshift, yshift, stdin)
int cl # coordinates file descriptor
int delim # delimiter character
real xshift # new x coordinate
real yshift # new y coordinate
int stdin # is cl STDIN?
char marker
int stat
int fscan(), nscan()
begin
if (stdin == YES) {
call printf ("Type object x and y coordinates (^D or^Z to end): ")
call flush (STDOUT)
}
stat = fscan (cl)
while (stat != EOF) {
call gargr (xshift)
call gargr (yshift)
if (nscan() != 2) {
call reset_scan()
call gargc (marker)
if (int (marker) == delim)
return (NEXT_POLYGON)
#else
#return (NEXT_OBJECT)
} else
return (THIS_OBJECT)
stat = fscan (cl)
}
return (stat)
end
|