--- ray/src/rt/devmain.c 1989/10/25 15:37:42 1.1 +++ ray/src/rt/devmain.c 1990/01/30 11:37:52 1.7 @@ -22,6 +22,8 @@ static char SCCSid[] = "$SunId$ LBL"; int (*wrnvec)(), (*errvec)(), (*cmdvec)(); /* error vectors, unused */ +long nrays = 0; /* fake it */ + struct driver *dev = NULL; /* output device */ FILE *devin, *devout; /* communications channels */ @@ -57,11 +59,10 @@ char *argv[]; quit(1); } /* open device */ - if ((dev = dinit(argv[0], argv[3])) == NULL) { - stderr_v("initialization failure\n"); + if ((dev = dinit(argv[0], argv[3])) == NULL) quit(1); - } putw(COM_RECVM, devout); /* verify initialization */ + fwrite((char *)&dev->pixaspect, sizeof(dev->pixaspect), 1, devout); putw(dev->xsiz, devout); putw(dev->ysiz, devout); fflush(devout); @@ -101,14 +102,15 @@ r_paintr() /* paint a rectangle */ COLOR col; int xmin, ymin, xmax, ymax; - fread(col, sizeof(COLOR), 1, devin); + nrays += 5; /* pretend */ + fread((char *)col, sizeof(COLOR), 1, devin); xmin = getw(devin); ymin = getw(devin); xmax = getw(devin); ymax = getw(devin); (*dev->paintr)(col, xmin, ymin, xmax, ymax); /* check for input */ - if (dev->inpready > notified) { + if (!notified && dev->inpready > 0) { + notified = 1; kill(getppid(), SIGIO); - notified = dev->inpready; } } @@ -143,9 +145,15 @@ r_comout() /* print string to command line */ r_comin() /* read string from command line */ { - char buf[256]; + char buf[256], *prompt; + /* get prompt */ + if (getc(devin)) { + mygets(buf, devin); + prompt = buf; + } else + prompt = NULL; /* get string */ - (*dev->comin)(buf); + (*dev->comin)(buf, prompt); /* reply */ putc(COM_COMIN, devout); myputs(buf, devout); @@ -175,13 +183,6 @@ register FILE *fp; do putc(*s, fp); while (*s++); -} - - -repaint(xmin, ymin, xmax, ymax) /* repaint section of display */ -int xmin, ymin, xmax, ymax; -{ - stderr_v("repaint called!\n"); /* no can do! */ }