--- ray/src/rt/devcomm.c 1990/03/06 17:44:37 1.15 +++ ray/src/rt/devcomm.c 1990/03/21 09:46:55 1.17 @@ -30,9 +30,7 @@ static char SCCSid[] = "$SunId$ LBL"; extern char *getpath(), *getenv(); -int onsigio(); - -int comm_close(), comm_clear(), comm_paintr(), comm_errout(), +static int comm_close(), comm_clear(), comm_paintr(), comm_errout(), comm_getcur(), comm_comout(), comm_comin(), comm_flush(); struct driver comm_driver = { @@ -84,7 +82,7 @@ char *dname, *id; if (getw(devin) != COM_RECVM) return(NULL); /* get driver parameters */ - comm_flush(); + getstate(); /* set error vectors */ cmdvec = comm_comout; if (wrnvec != NULL) @@ -143,11 +141,7 @@ comm_flush() /* flush output to driver */ fflush(devout); if (getc(devin) != COM_FLUSH) reply_error("flush"); - fread((char *)&comm_driver.pixaspect, - sizeof(comm_driver.pixaspect), 1, devin); - comm_driver.xsiz = getw(devin); - comm_driver.ysiz = getw(devin); - comm_driver.inpready = getw(devin); + getstate(); } @@ -193,7 +187,7 @@ char *prompt; if (getc(devin) != COM_COMIN) reply_error("comin"); mygets(buf, devin); - comm_driver.inpready = getw(devin); + getstate(); } @@ -238,4 +232,15 @@ char *routine; stderr_v(routine); stderr_v(": driver reply error\n"); quit(1); +} + + +static +getstate() /* get driver state variables */ +{ + fread((char *)&comm_driver.pixaspect, + sizeof(comm_driver.pixaspect), 1, devin); + comm_driver.xsiz = getw(devin); + comm_driver.ysiz = getw(devin); + comm_driver.inpready = getw(devin); }