32 |
|
|
33 |
|
char *progname; /* driver name */ |
34 |
|
|
35 |
< |
int r_clear(), r_paintr(), r_getcur(), r_comout(), r_comin(), r_mycomin(); |
35 |
> |
int r_clear(), r_paintr(), r_getcur(), r_comout(), r_comin(); |
36 |
|
|
37 |
|
int (*dev_func[NREQUESTS])() = { /* request handlers */ |
38 |
|
r_clear, r_paintr, |
62 |
|
if ((dev = dinit(argv[0], argv[3])) == NULL) |
63 |
|
quit(1); |
64 |
|
putw(COM_RECVM, devout); /* verify initialization */ |
65 |
+ |
fwrite((char *)&dev->pixaspect, sizeof(dev->pixaspect), 1, devout); |
66 |
|
putw(dev->xsiz, devout); |
67 |
|
putw(dev->ysiz, devout); |
67 |
– |
fwrite(dev->pixaspect, sizeof(dev->pixaspect), 1, devout); |
68 |
|
fflush(devout); |
69 |
|
/* loop on requests */ |
70 |
|
while ((com = getc(devin)) != EOF) { |
103 |
|
int xmin, ymin, xmax, ymax; |
104 |
|
|
105 |
|
nrays += 5; /* pretend */ |
106 |
< |
fread(col, sizeof(COLOR), 1, devin); |
106 |
> |
fread((char *)col, sizeof(COLOR), 1, devin); |
107 |
|
xmin = getw(devin); ymin = getw(devin); |
108 |
|
xmax = getw(devin); ymax = getw(devin); |
109 |
|
(*dev->paintr)(col, xmin, ymin, xmax, ymax); |
145 |
|
|
146 |
|
r_comin() /* read string from command line */ |
147 |
|
{ |
148 |
< |
char buf[256]; |
148 |
> |
char buf[256], *prompt; |
149 |
> |
/* get prompt */ |
150 |
> |
if (getc(devin)) { |
151 |
> |
mygets(buf, devin); |
152 |
> |
prompt = buf; |
153 |
> |
} else |
154 |
> |
prompt = NULL; |
155 |
|
/* get string */ |
156 |
< |
(*dev->comin)(buf); |
156 |
> |
(*dev->comin)(buf, prompt); |
157 |
|
/* reply */ |
158 |
|
putc(COM_COMIN, devout); |
159 |
|
myputs(buf, devout); |