--- ray/src/rt/devmain.c 1990/02/22 11:46:24 1.8 +++ ray/src/rt/devmain.c 1990/03/06 17:44:44 1.10 @@ -14,8 +14,6 @@ static char SCCSid[] = "$SunId$ LBL"; #include -#include - #include "color.h" #include "driver.h" @@ -26,8 +24,6 @@ struct driver *dev = NULL; /* output device */ FILE *devin, *devout; /* communications channels */ -int notified = 0; /* notified parent of input? */ - char *progname; /* driver name */ int r_clear(), r_paintr(), r_getcur(), r_comout(), r_comin(), r_flush(); @@ -61,9 +57,6 @@ char *argv[]; 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); /* loop on requests */ while ((com = getc(devin)) != EOF) { @@ -105,11 +98,6 @@ r_paintr() /* paint a rectangle */ xmin = getw(devin); ymin = getw(devin); xmax = getw(devin); ymax = getw(devin); (*dev->paintr)(col, xmin, ymin, xmax, ymax); - /* check for input */ - if (!notified && dev->inpready > 0) { - notified = 1; - kill(getppid(), SIGIO); - } } @@ -117,6 +105,12 @@ r_flush() /* flush output */ { if (dev->flush != NULL) (*dev->flush)(); + putc(COM_FLUSH, devout); + fwrite((char *)&dev->pixaspect, sizeof(dev->pixaspect), 1, devout); + putw(dev->xsiz, devout); + putw(dev->ysiz, devout); + putw(dev->inpready, devout); + fflush(devout); } @@ -162,9 +156,8 @@ r_comin() /* read string from command line */ /* reply */ putc(COM_COMIN, devout); myputs(buf, devout); + putw(dev->inpready, devout); fflush(devout); - /* reset notify */ - notified = 0; }