26 |
|
#define vfork fork |
27 |
|
#endif |
28 |
|
|
29 |
– |
#ifndef WFLUSH |
30 |
– |
#define WFLUSH 30 /* flush after this many rays */ |
31 |
– |
#endif |
32 |
– |
|
29 |
|
extern char *getpath(), *getenv(); |
30 |
|
|
31 |
|
int onsigio(); |
32 |
|
|
33 |
|
int comm_close(), comm_clear(), comm_paintr(), comm_errout(), |
34 |
< |
comm_getcur(), comm_comout(), comm_comin(); |
34 |
> |
comm_getcur(), comm_comout(), comm_comin(), comm_flush(); |
35 |
|
|
36 |
< |
struct driver comm_driver, comm_default = { |
36 |
> |
struct driver comm_driver = { |
37 |
|
comm_close, comm_clear, comm_paintr, comm_getcur, |
38 |
< |
comm_comout, comm_comin |
38 |
> |
comm_comout, comm_comin, comm_flush |
39 |
|
}; |
40 |
|
|
41 |
|
FILE *devin, *devout; |
76 |
|
goto syserr; |
77 |
|
if ((devin = fdopen(p2[0], "r")) == NULL) |
78 |
|
goto syserr; |
83 |
– |
copystruct(&comm_driver, &comm_default); |
79 |
|
/* verify & get resolution */ |
80 |
|
putw(COM_SENDM, devout); |
81 |
|
fflush(devout); |
130 |
|
COLOR col; |
131 |
|
int xmin, ymin, xmax, ymax; |
132 |
|
{ |
138 |
– |
extern long nrays; /* number of rays traced */ |
139 |
– |
static long lastflush = 0; /* ray count at last flush */ |
140 |
– |
|
133 |
|
putc(COM_PAINTR, devout); |
134 |
|
fwrite((char *)col, sizeof(COLOR), 1, devout); |
135 |
|
putw(xmin, devout); |
136 |
|
putw(ymin, devout); |
137 |
|
putw(xmax, devout); |
138 |
|
putw(ymax, devout); |
139 |
< |
if (nrays - lastflush >= WFLUSH) { |
140 |
< |
fflush(devout); |
141 |
< |
lastflush = nrays; |
142 |
< |
} |
139 |
> |
} |
140 |
> |
|
141 |
> |
|
142 |
> |
static |
143 |
> |
comm_flush() /* flush output to driver */ |
144 |
> |
{ |
145 |
> |
putc(COM_FLUSH, devout); |
146 |
> |
fflush(devout); |
147 |
|
} |
148 |
|
|
149 |
|
|