10 |
|
#include "copyright.h" |
11 |
|
|
12 |
|
#include <sys/types.h> |
13 |
< |
#include <sys/wait.h> /* XXX platform specific */ |
13 |
> |
#if !defined(_WIN32) && !defined(_WIN64) |
14 |
> |
#include <sys/wait.h> |
15 |
> |
#endif |
16 |
|
|
17 |
+ |
#include "paths.h" |
18 |
|
#include "platform.h" |
19 |
|
#include "standard.h" |
20 |
|
#include "driver.h" |
28 |
|
|
29 |
|
static struct driver * final_connect(void); |
30 |
|
static void mygets(char *s, FILE *fp); |
31 |
< |
static void myputs(char *s, FILE *fp); |
31 |
> |
static void myputs(const char *s, FILE *fp); |
32 |
|
static void reply_error(char *routine); |
33 |
|
static void getstate(void); |
34 |
|
|
57 |
|
getstate(); |
58 |
|
/* set error vectors */ |
59 |
|
erract[COMMAND].pf = comm_comout; |
60 |
+ |
/* doesn't work with raypcalls.c |
61 |
|
if (erract[WARNING].pf != NULL) |
62 |
|
erract[WARNING].pf = comm_comout; |
63 |
+ |
*/ |
64 |
|
return(&comm_driver); |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
< |
extern struct driver * |
68 |
> |
struct driver * |
69 |
|
slave_init( /* run rview in slave mode */ |
70 |
|
char *dname, |
71 |
|
char *id |
78 |
|
} |
79 |
|
|
80 |
|
|
81 |
< |
extern struct driver * |
81 |
> |
struct driver * |
82 |
|
comm_init( /* set up and execute driver */ |
83 |
|
char *dname, |
84 |
|
char *id |
147 |
|
fclose(devin); |
148 |
|
if (devchild < 0) |
149 |
|
return; |
150 |
+ |
#if !defined(_WIN32) && !defined(_WIN64) |
151 |
|
while ((pid = wait(0)) != -1 && pid != devchild) |
152 |
|
; |
153 |
+ |
#endif |
154 |
|
} |
155 |
|
|
156 |
|
|
177 |
|
) |
178 |
|
{ |
179 |
|
putc(COM_PAINTR, devout); |
180 |
< |
fwrite((char *)col, sizeof(COLOR), 1, devout); |
180 |
> |
putbinary(col, sizeof(COLOR), 1, devout); |
181 |
|
putw(xmin, devout); |
182 |
|
putw(ymin, devout); |
183 |
|
putw(xmax, devout); |
217 |
|
|
218 |
|
static void |
219 |
|
comm_comout( /* print string to command line */ |
220 |
< |
char *str |
220 |
> |
const char *str |
221 |
|
) |
222 |
|
{ |
223 |
|
putc(COM_COMOUT, devout); |
250 |
|
|
251 |
|
static void |
252 |
|
mygets( /* get string from file (with nul) */ |
253 |
< |
register char *s, |
254 |
< |
register FILE *fp |
253 |
> |
char *s, |
254 |
> |
FILE *fp |
255 |
|
) |
256 |
|
{ |
257 |
< |
register int c; |
257 |
> |
int c; |
258 |
|
|
259 |
|
while ((c = getc(fp)) != EOF) |
260 |
|
if ((*s++ = c) == '\0') |
265 |
|
|
266 |
|
static void |
267 |
|
myputs( /* put string to file (with nul) */ |
268 |
< |
register char *s, |
269 |
< |
register FILE *fp |
268 |
> |
const char *s, |
269 |
> |
FILE *fp |
270 |
|
) |
271 |
|
{ |
272 |
|
do |
289 |
|
static void |
290 |
|
getstate(void) /* get driver state variables */ |
291 |
|
{ |
292 |
< |
fread((char *)&comm_driver.pixaspect, |
292 |
> |
getbinary((char *)&comm_driver.pixaspect, |
293 |
|
sizeof(comm_driver.pixaspect), 1, devin); |
294 |
|
comm_driver.xsiz = getw(devin); |
295 |
|
comm_driver.ysiz = getw(devin); |