1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ SGI"; |
93 |
|
if (inp & DFL(DC_PAUSE)) |
94 |
|
pause = 1; |
95 |
|
if (inp & DFL(DC_REDRAW)) |
96 |
< |
imm_mode = beam_sync() > 0; |
96 |
> |
imm_mode = beam_sync(1) > 0; |
97 |
|
if (inp & DFL(DC_KILL)) { |
98 |
|
serv_request(DR_KILL, 0, NULL); |
99 |
|
pause = 0; |
159 |
|
n = odev.ifd+1; |
160 |
|
if (sstdin != NULL) { |
161 |
|
FD_SET(fileno(sstdin), &readset); |
162 |
+ |
FD_SET(fileno(sstdin), &errset); |
163 |
|
if (fileno(sstdin) >= n) |
164 |
|
n = fileno(sstdin) + 1; |
165 |
|
} |
174 |
|
flgs |= RDY_SRV; |
175 |
|
if (FD_ISSET(odev.ifd, &readset) || FD_ISSET(odev.ifd, &errset)) |
176 |
|
flgs |= RDY_DEV; |
177 |
< |
if (sstdin != NULL && FD_ISSET(fileno(sstdin), &readset)) |
177 |
> |
if (sstdin != NULL && (FD_ISSET(fileno(sstdin), &readset) || |
178 |
> |
FD_ISSET(fileno(sstdin), &errset))) |
179 |
|
flgs |= RDY_SIN; |
180 |
|
return(flgs); |
181 |
|
} |
247 |
|
{ |
248 |
|
static VIEW viewhist[VIEWHISTLEN]; |
249 |
|
static unsigned nhist; |
250 |
+ |
VIEW *dv; |
251 |
+ |
int i, res[2]; |
252 |
|
char *err; |
253 |
|
/* restore previous view? */ |
254 |
|
if (v == NULL) { |
268 |
|
error(COMMAND, "cannot handle parallel views"); |
269 |
|
return; |
270 |
|
} |
271 |
< |
if (!dev_view(v)) /* update display driver */ |
271 |
> |
if (!dev_view(v)) /* notify display driver */ |
272 |
|
goto again; |
273 |
|
dev_flush(); /* update screen */ |
274 |
< |
if (!beam_view(v)) /* update beam list */ |
275 |
< |
goto again; |
274 |
> |
beam_init(); /* compute new beam set */ |
275 |
> |
for (i = 0; (dv = dev_auxview(i, res)) != NULL; i++) |
276 |
> |
if (!beam_view(dv, res[0], res[1])) { |
277 |
> |
if (!nhist) { |
278 |
> |
error(COMMAND, "invalid starting view"); |
279 |
> |
return; |
280 |
> |
} |
281 |
> |
copystruct(v, viewhist + ((nhist-1)%VIEWHISTLEN)); |
282 |
> |
goto again; |
283 |
> |
} |
284 |
> |
beam_sync(0); /* update server */ |
285 |
|
/* record new view */ |
286 |
|
if (v < viewhist || v >= viewhist+VIEWHISTLEN) { |
287 |
|
copystruct(viewhist + (nhist%VIEWHISTLEN), v); |
294 |
|
usr_input() /* get user input and process it */ |
295 |
|
{ |
296 |
|
VIEW vparams; |
297 |
< |
char cmd[128]; |
297 |
> |
char cmd[256]; |
298 |
|
register char *args; |
299 |
|
register int i; |
300 |
|
|
301 |
< |
if (fgets(cmd, sizeof(cmd), sstdin) == NULL) |
302 |
< |
return(DC_QUIT); |
301 |
> |
if (fgets(cmd, sizeof(cmd), sstdin) == NULL) { |
302 |
> |
fclose(sstdin); |
303 |
> |
sstdin = NULL; |
304 |
> |
return(0); |
305 |
> |
} |
306 |
|
for (args = cmd; *args && !isspace(*args); args++) |
307 |
|
; |
308 |
|
while (isspace(*args)) |
338 |
|
/* handled in main() */ |
339 |
|
break; |
340 |
|
case DC_REDRAW: /* redraw from server */ |
341 |
< |
imm_mode = beam_sync() > 0; |
341 |
> |
imm_mode = beam_sync(1) > 0; |
342 |
|
dev_clear(); |
343 |
|
break; |
344 |
|
case DC_KILL: /* kill rtrace process(es) */ |