ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/devcomm.c
(Generate patch)

Comparing ray/src/rt/devcomm.c (file contents):
Revision 1.16 by greg, Mon Mar 12 11:08:44 1990 UTC vs.
Revision 1.18 by greg, Thu May 3 13:17:41 1990 UTC

# Line 82 | Line 82 | char   *dname, *id;
82          if (getw(devin) != COM_RECVM)
83                  return(NULL);
84                                                  /* get driver parameters */
85 <        comm_flush();
85 >        getstate();
86                                                  /* set error vectors */
87          cmdvec = comm_comout;
88          if (wrnvec != NULL)
# Line 141 | Line 141 | comm_flush()                           /* flush output to driver */
141          fflush(devout);
142          if (getc(devin) != COM_FLUSH)
143                  reply_error("flush");
144 <        fread((char *)&comm_driver.pixaspect,
145 <                        sizeof(comm_driver.pixaspect), 1, devin);
146 <        comm_driver.xsiz = getw(devin);
147 <        comm_driver.ysiz = getw(devin);
148 <        comm_driver.inpready = getw(devin);
144 >        getstate();
145   }
146  
147  
# Line 172 | Line 168 | char   *str;
168   {
169          putc(COM_COMOUT, devout);
170          myputs(str, devout);
171 +        if (str[strlen(str)-1] == '\n')
172 +                fflush(devout);
173   }
174  
175  
# Line 191 | Line 189 | char   *prompt;
189          if (getc(devin) != COM_COMIN)
190                  reply_error("comin");
191          mygets(buf, devin);
192 <        comm_driver.inpready = getw(devin);
192 >        getstate();
193   }
194  
195  
# Line 236 | Line 234 | char   *routine;
234          stderr_v(routine);
235          stderr_v(": driver reply error\n");
236          quit(1);
237 + }
238 +
239 +
240 + static
241 + getstate()                              /* get driver state variables */
242 + {
243 +        fread((char *)&comm_driver.pixaspect,
244 +                        sizeof(comm_driver.pixaspect), 1, devin);
245 +        comm_driver.xsiz = getw(devin);
246 +        comm_driver.ysiz = getw(devin);
247 +        comm_driver.inpready = getw(devin);
248   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines