/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/unxutl/Attic/ymkfile,v 1.42 1991/03/14 04:23:26 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/unxutl/Attic/ymkfile,v 1.43 1991/03/14 23:03:12 cph Exp $
Copyright (c) 1989-91 Massachusetts Institute of Technology
unexec.c unexhp9k800.c getpagesize.h
x11base.o x11graph.o x11term.o starbasex.o : scheme.touch prims.h x11.h
-x11base.o : ux.h osio.h uxselect.h
+x11base.o : ux.h uxselect.h
starbase.o : scheme.touch prims.h
Sgraph.o Sgraph_xt.o SgX.o : scheme.touch prims.h Sgraph.h
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxio.c,v 1.11 1991/03/14 04:22:59 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxio.c,v 1.12 1991/03/14 23:02:46 cph Exp $
Copyright (c) 1990-91 Massachusetts Institute of Technology
}
}
\f
+#ifdef HAVE_SELECT
+CONST int UX_have_select_p = 1;
+#else
+CONST int UX_have_select_p = 0;
+#endif
+
enum select_input
DEFUN (UX_select_input, (fd, blockp), int fd AND int blockp)
{
size_t nbytes)
{
#ifdef HAVE_SELECT
- if (OS_channels_registered > ((CHANNEL_REGISTERED (channel)) ? 1 : 0))
- switch (UX_select_input ((CHANNEL_DESCRIPTOR (channel)),
- (! (CHANNEL_NONBLOCKING (channel)))))
- {
- case select_input_none:
- return (-1);
- case select_input_other:
- case select_input_process_status:
- return (-2);
- }
+ switch (UX_select_input ((CHANNEL_DESCRIPTOR (channel)),
+ (! (CHANNEL_NONBLOCKING (channel)))))
+ {
+ case select_input_none:
+ return (-1);
+ case select_input_other:
+ case select_input_process_status:
+ return (-2);
+ }
#endif
return (OS_channel_read (channel, buffer, nbytes));
}
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11base.c,v 1.17 1991/03/14 04:23:20 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11base.c,v 1.18 1991/03/14 23:03:03 cph Exp $
Copyright (c) 1989-91 Massachusetts Institute of Technology
#include "scheme.h"
#include "prims.h"
#include "ux.h"
-#include "osio.h"
#include "uxselect.h"
#include "x11.h"
entry that reads events -- or else that all other event readers
cooperate with this strategy. */
-/* The time_limit argument is currently ignored, because Edwin doesn't
- use it. */
-
static SCHEME_OBJECT
-DEFUN (xd_process_events, (xd, time_limit_p, time_limit),
+DEFUN (xd_process_events, (xd, non_block_p),
struct xdisplay * xd AND
- int time_limit_p AND
- unsigned long time_limit)
+ int non_block_p)
{
Display * display = (XD_DISPLAY (xd));
- int do_select = (OS_channels_registered > 0);
unsigned int events_queued;
if (XD_CACHED_EVENT_P (xd))
{
goto restart;
}
events_queued =
- (do_select ? (XEventsQueued (display, QueuedAlready))
- : time_limit_p ? (XEventsQueued (display, QueuedAfterReading))
+ (UX_have_select_p ? (XEventsQueued (display, QueuedAlready))
+ : non_block_p ? (XEventsQueued (display, QueuedAfterReading))
: 0);
while (1)
{
XEvent event;
if (events_queued > 0)
events_queued -= 1;
- else if (do_select)
+ else if (UX_have_select_p)
switch (UX_select_input ((ConnectionNumber (display)),
- (!time_limit_p)))
+ (!non_block_p)))
{
case select_input_none:
return (SHARP_F);
events_queued = (XEventsQueued (display, QueuedAfterReading));
continue;
}
- else if (time_limit_p)
+ else if (non_block_p)
return (SHARP_F);
XNextEvent (display, (&event));
if ((event . type) == KeymapNotify)
DEFINE_PRIMITIVE ("X-DISPLAY-PROCESS-EVENTS", Prim_x_display_process_events, 2, 2, 0)
{
PRIMITIVE_HEADER (2);
- {
- struct xdisplay * xd = (x_display_arg (1));
- PRIMITIVE_RETURN
- (((ARG_REF (2)) == SHARP_F)
- ? (xd_process_events (xd, 0, 0))
- : (xd_process_events (xd, 1, (arg_nonnegative_integer (2)))));
- }
+ PRIMITIVE_RETURN
+ (xd_process_events ((x_display_arg (1)), (BOOLEAN_ARG (2))));
}
static void