| 26 |
|
static SUBPROC dpd; |
| 27 |
|
static FILE *dpout; |
| 28 |
|
|
| 29 |
+ |
static void disp_flush(void); |
| 30 |
+ |
static void disp_result(int type, int nbytes, char *p); |
| 31 |
|
|
| 32 |
< |
disp_open(dname) /* open the named display driver */ |
| 33 |
< |
char *dname; |
| 32 |
> |
|
| 33 |
> |
extern void |
| 34 |
> |
disp_open( /* open the named display driver */ |
| 35 |
> |
char *dname |
| 36 |
> |
) |
| 37 |
|
{ |
| 38 |
|
char buf[sizeof(HDGRID)+512], fd0[8], fd1[8], *cmd[5], *sfn; |
| 39 |
|
int i, n, len; |
| 98 |
|
} |
| 99 |
|
|
| 100 |
|
|
| 101 |
< |
disp_packet(p) /* display a packet */ |
| 102 |
< |
register PACKHEAD *p; |
| 101 |
> |
extern void |
| 102 |
> |
disp_packet( /* display a packet */ |
| 103 |
> |
register PACKHEAD *p |
| 104 |
> |
) |
| 105 |
|
{ |
| 106 |
|
disp_result(DS_BUNDLE, packsiz(p->nr), (char *)p); |
| 107 |
|
} |
| 108 |
|
|
| 109 |
|
|
| 110 |
< |
disp_check(block) /* check display process */ |
| 111 |
< |
int block; |
| 110 |
> |
extern int |
| 111 |
> |
disp_check( /* check display process */ |
| 112 |
> |
int block |
| 113 |
> |
) |
| 114 |
|
{ |
| 115 |
|
MSGHEAD msg; |
| 116 |
|
int n; |
| 133 |
|
dpout = NULL; |
| 134 |
|
error(USER, "display process died"); |
| 135 |
|
} |
| 136 |
< |
if (errno != EAGAIN & errno != EINTR) |
| 136 |
> |
if ((errno != EAGAIN) & (errno != EINTR)) |
| 137 |
|
goto readerr; |
| 138 |
|
return(2); /* acceptable failure */ |
| 139 |
|
} |
| 195 |
|
case DR_VIEWPOINT: /* set target eye position */ |
| 196 |
|
if (msg.nbytes != sizeof(VIEWPOINT)) |
| 197 |
|
error(INTERNAL, "bad DR_VIEWPOINT from display process"); |
| 198 |
< |
copystruct(&myeye, (VIEWPOINT *)buf); |
| 198 |
> |
myeye = *((VIEWPOINT *)buf); |
| 199 |
|
break; |
| 200 |
|
case DR_ATTEN: /* block for priority request */ |
| 201 |
|
if (msg.nbytes) |
| 224 |
|
case DR_CLOBBER: /* clobber holodeck */ |
| 225 |
|
if (msg.nbytes) |
| 226 |
|
error(INTERNAL, "bad DR_CLOBBER from display process"); |
| 227 |
< |
if (force <= 0 | ncprocs <= 0) |
| 227 |
> |
if ((force <= 0) | (ncprocs <= 0)) |
| 228 |
|
error(WARNING, "request to clobber holodeck denied"); |
| 229 |
|
else { |
| 230 |
|
error(WARNING, "clobbering holodeck contents"); |
| 247 |
|
error(SYSTEM, "cannot change display blocking mode"); |
| 248 |
|
readerr: |
| 249 |
|
error(SYSTEM, "error reading from display process"); |
| 250 |
+ |
return -1; /* pro forma return */ |
| 251 |
|
} |
| 252 |
|
|
| 253 |
|
|
| 254 |
< |
int |
| 255 |
< |
disp_close() /* close our display process */ |
| 254 |
> |
extern int |
| 255 |
> |
disp_close(void) /* close our display process */ |
| 256 |
|
{ |
| 247 |
– |
int rval; |
| 248 |
– |
|
| 257 |
|
if (dpout == NULL) |
| 258 |
|
return(-1); |
| 259 |
|
myeye.rng = 0; |
| 265 |
|
} |
| 266 |
|
|
| 267 |
|
|
| 268 |
< |
disp_result(type, nbytes, p) /* queue result message to display process */ |
| 269 |
< |
int type, nbytes; |
| 270 |
< |
char *p; |
| 268 |
> |
static void |
| 269 |
> |
disp_result( /* queue result message to display process */ |
| 270 |
> |
int type, |
| 271 |
> |
int nbytes, |
| 272 |
> |
char *p |
| 273 |
> |
) |
| 274 |
|
{ |
| 275 |
|
MSGHEAD msg; |
| 276 |
|
/* consistency checks */ |
| 288 |
|
} |
| 289 |
|
|
| 290 |
|
|
| 291 |
< |
disp_flush() /* flush output to display */ |
| 291 |
> |
static void |
| 292 |
> |
disp_flush(void) /* flush output to display */ |
| 293 |
|
{ |
| 294 |
|
if (fflush(dpout) < 0) |
| 295 |
|
error(SYSTEM, "error writing to the display process"); |