76 |
|
|
77 |
|
static int inpcheck; /* whence to check input */ |
78 |
|
|
79 |
< |
extern char *malloc(), *getcombuf(); |
79 |
> |
extern char *malloc(); |
80 |
|
|
81 |
|
static int x11_close(), x11_clear(), x11_paintr(), x11_errout(), |
82 |
|
x11_getcur(), x11_comout(), x11_comin(), x11_flush(); |
298 |
|
n = XPending(ourdisplay); /* from X server */ |
299 |
|
while (n-- > 0) |
300 |
|
getevent(); |
301 |
+ |
#ifdef FNDELAY |
302 |
|
if (inpcheck == IC_IOCTL) { /* from stdin */ |
303 |
+ |
#ifdef FIONREAD |
304 |
|
if (ioctl(fileno(stdin), FIONREAD, &n) < 0) { |
305 |
+ |
#else |
306 |
+ |
if (1) { |
307 |
+ |
#endif |
308 |
|
if (fcntl(fileno(stdin), F_SETFL, FNDELAY) < 0) { |
309 |
|
stderr_v("Cannot change input mode\n"); |
310 |
|
quit(1); |
317 |
|
n = read(fileno(stdin), buf, sizeof(buf)-1); |
318 |
|
if (n > 0) { |
319 |
|
buf[n] = '\0'; |
320 |
< |
strcpy(getcombuf(&x11_driver), buf); |
320 |
> |
tocombuf(buf, &x11_driver); |
321 |
|
} |
322 |
|
} |
323 |
+ |
#endif |
324 |
|
} |
325 |
|
|
326 |
|
|
582 |
|
fixwindow(eexp) /* repair damage to window */ |
583 |
|
register XExposeEvent *eexp; |
584 |
|
{ |
585 |
+ |
char buf[80]; |
586 |
+ |
|
587 |
|
if (eexp->window == gwind) { |
588 |
< |
sprintf(getcombuf(&x11_driver), "repaint %d %d %d %d\n", |
588 |
> |
sprintf(buf, "repaint %d %d %d %d\n", |
589 |
|
eexp->x, gheight - eexp->y - eexp->height, |
590 |
|
eexp->x + eexp->width, gheight - eexp->y); |
591 |
+ |
tocombuf(buf, &x11_driver); |
592 |
|
} else if (eexp->window == comline->w) { |
593 |
|
if (eexp->count == 0) |
594 |
|
xt_redraw(comline); |
608 |
|
x11_driver.xsiz = gwidth < MINWIDTH ? MINWIDTH : gwidth; |
609 |
|
x11_driver.ysiz = gheight < MINHEIGHT ? MINHEIGHT : gheight; |
610 |
|
|
611 |
< |
strcpy(getcombuf(&x11_driver), "new\n"); |
611 |
> |
tocombuf("new\n", &x11_driver); |
612 |
|
} |