23 |
|
#endif |
24 |
|
|
25 |
|
static int inp_flags; |
26 |
< |
static SUBPROC dpd; |
26 |
> |
static SUBPROC dpd = SP_INACTIVE; |
27 |
|
static FILE *dpout; |
28 |
|
|
29 |
|
static void disp_flush(void); |
30 |
|
static void disp_result(int type, int nbytes, char *p); |
31 |
|
|
32 |
|
|
33 |
< |
extern void |
33 |
> |
void |
34 |
|
disp_open( /* open the named display driver */ |
35 |
|
char *dname |
36 |
|
) |
41 |
|
if (!strcmp(dname, SLAVENAME)) { |
42 |
|
dpd.r = 0; /* read from stdin */ |
43 |
|
dpout = stdout; /* write to stdout */ |
44 |
< |
dpd.running = 0; /* we're the slave procees */ |
44 |
> |
dpd.flags = 0; /* we're the slave procees */ |
45 |
|
} else { |
46 |
|
/* get full display program name */ |
47 |
|
#ifdef DEVPATH |
98 |
|
} |
99 |
|
|
100 |
|
|
101 |
< |
extern void |
101 |
> |
void |
102 |
|
disp_packet( /* display a packet */ |
103 |
< |
register PACKHEAD *p |
103 |
> |
PACKHEAD *p |
104 |
|
) |
105 |
|
{ |
106 |
|
disp_result(DS_BUNDLE, packsiz(p->nr), (char *)p); |
107 |
|
} |
108 |
|
|
109 |
|
|
110 |
< |
extern int |
110 |
> |
int |
111 |
|
disp_check( /* check display process */ |
112 |
|
int block |
113 |
|
) |
251 |
|
} |
252 |
|
|
253 |
|
|
254 |
< |
extern int |
254 |
> |
int |
255 |
|
disp_close(void) /* close our display process */ |
256 |
|
{ |
257 |
|
if (dpout == NULL) |
260 |
|
disp_result(DS_SHUTDOWN, 0, NULL); |
261 |
|
fclose(dpout); |
262 |
|
dpout = NULL; |
263 |
< |
return(dpd.running ? close_process(&dpd) : 0); |
263 |
> |
return(dpd.flags&PF_RUNNING ? close_process(&dpd) : 0); |
264 |
|
|
265 |
|
} |
266 |
|
|