Change callers of `UX_select_input' to call it when the operating
authorChris Hanson <org/chris-hanson/cph>
Thu, 14 Mar 1991 23:03:12 +0000 (23:03 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 14 Mar 1991 23:03:12 +0000 (23:03 +0000)
system makes it available.  Previously they attempted to predict when
it would be needed, which sometimes failed and is in general
unmodular.

v7/src/microcode/unxutl/ymkfile
v7/src/microcode/uxio.c
v7/src/microcode/version.h
v7/src/microcode/x11base.c
v8/src/microcode/version.h

index 9b693771801749ab3e35d8d43b133205e5cf35ab..e9746b76eee45cdd88b2cd2b2acaa284f89c657f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-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
 
@@ -626,7 +626,7 @@ dmpwrld.o : scheme.touch prims.h ux.h osfs.h \
        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
index 4adf38fd9bac8e464b145056cfe7bfb61c5b6b09..b40a8eb78bbc560cdd520bcff690acd6638ce10a 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-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
 
@@ -359,6 +359,12 @@ DEFUN (OS_channel_unregister, (channel), Tchannel channel)
     }
 }
 \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)
 {
@@ -405,16 +411,15 @@ DEFUN (OS_channel_select_then_read, (channel, buffer, nbytes),
        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));
 }
index 7c556fa6790ad8ae33e6eede0d73236b06804291..60051c560f55b46dd645fdf466a962f480ba203c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.68 1991/03/14 04:23:15 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.69 1991/03/14 23:02:55 cph Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -46,5 +46,5 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     68
+#define SUBVERSION     69
 #endif
index 88bb21935efb40fcd1b0630ff4ac37431ec28d04..fd706b4187727c9297ae9e37e608b409c11bbd8a 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-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
 
@@ -37,7 +37,6 @@ MIT in each case. */
 #include "scheme.h"
 #include "prims.h"
 #include "ux.h"
-#include "osio.h"
 #include "uxselect.h"
 #include "x11.h"
 
@@ -701,17 +700,12 @@ DEFUN (x_event_to_object, (event), XEvent * event)
    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))
     {
@@ -719,17 +713,17 @@ DEFUN (xd_process_events, (xd, time_limit_p, time_limit),
       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);
@@ -740,7 +734,7 @@ DEFUN (xd_process_events, (xd, time_limit_p, time_limit),
            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)
@@ -831,13 +825,8 @@ DEFINE_PRIMITIVE ("X-CLOSE-WINDOW", Prim_x_close_window, 1, 1, 0)
 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
index 5f8a8e1341490662090afab248a73455804e46c9..cefc08edb3c181a40c3e784392c90e476bab1fd6 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.68 1991/03/14 04:23:15 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.69 1991/03/14 23:02:55 cph Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -46,5 +46,5 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     68
+#define SUBVERSION     69
 #endif