<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>makeclx.cl</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,9 @@
+Wed Oct 01 17:56:10 1997  Tom McClure  &lt;tomj@falcon&gt;
+
+	* new file makeclx.cl to build on NT
+	* new instructions in README for building on NT
+
+*******************************************************************************
 Wed May 14 21:56:57 1997  Kevin Layer  &lt;layer@ultra&gt;
 
 	* Makefile: fixes for ACL 5</diff>
      <filename>ChangeLog</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
      This file contains instructions on how to make CLX work with Franz
 Allegro Common Lisp.  CLX should work on any machine that supports
-ACL version 3.1.10 or greater.
+ACL version 3.1.10 or greater.  For running on Windows NT with X display
+software such as Hummingbird's Exceed or StarNet's XWin32, skip to the
+bottom.
 
  ******************************************************************************
  NOTE:  Normally you will not need to follow the instructions in this file.
@@ -66,3 +68,17 @@ Please report Franz specific CLX bugs to:
 	 bugs@Franz.COM
 	       or
 	ucbvax!franz!bugs
+
+
+
+Building and running on Windows NT
+
+(1) With ACL 4.3.2 or later, :cd to the directory containing the clx
+sources.
+
+(2) :ld makeclx.cl - this should create winclx.fasl in that
+directory.  Feel free to move winclx.fasl to a convenient location.
+
+(3) In a fresh lisp, :ld winclx.fasl.  You should now be able to
+open your display, assuming your X display software is running and
+tcp/ip is installed, with: (xlib:open-display &quot;localhost&quot;)
\ No newline at end of file</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1290,7 +1290,17 @@
 	stream
       (error &quot;Cannot connect to server: ~A:~D&quot; host display))))
 
-#+excl
+#+(and excl mswindows)
+(defun open-x-stream (host display protocol)
+  (declare (ignore protocol)) ;; assume TCP
+  (let ((stream (socket:make-socket :remote-host (string host)
+				    :remote-port (+ *x-tcp-port* display)
+				    :format :binary)))
+    (if (streamp stream)
+	stream
+      (error &quot;Cannot connect to server: ~A:~D&quot; host display))))
+
+#+(and excl (not mswindows))
 ;;
 ;; Note that since we don't use the CL i/o facilities to do i/o, the display
 ;; input and output &quot;stream&quot; is really a file descriptor (fixnum).
@@ -1346,7 +1356,7 @@
   (let* ((howmany (- end start))
 	 (fd (display-input-stream display)))
     (declare (type array-index howmany)
-	     (fixnum fd))
+	     #-mswindows (fixnum fd))
 	  
     (or (cond ((fd-char-avail-p fd) nil)
 	      ((eql timeout 0) :timeout)
@@ -1457,6 +1467,11 @@
 	   (type display display)
 	   (type array-index start end))
   #.(declare-buffun)
+  #+mswindows
+  (let ((stream (display-output-stream display)))
+    (unless (null stream) 
+      (stream:stream-write-sequence stream vector start end)))
+  #-mswindows
   (excl::filesys-write-bytes (display-output-stream display) vector start
 			     (- end start)
 			     display))
@@ -1519,12 +1534,12 @@
 
 ;;; buffer-force-output-default - force output to the X stream
 
-#+excl
+#+(and excl (not mswindows))
 (defun buffer-force-output-default (display)
   ;; buffer-write-default does the actual writing.
   (declare (ignore display)))
 
-#-excl
+#-(and excl (not mswindows))
 (defun buffer-force-output-default (display)
   ;; The default buffer force-output function for use with common-lisp streams
   (declare (type display display))
@@ -1535,7 +1550,7 @@
 
 ;;; BUFFER-CLOSE-DEFAULT - close the X stream
 
-#+excl
+#+(and excl (not mswindows))
 (defun buffer-close-default (display &amp;key abort)
   ;; The default buffer close function for use with common-lisp streams
   (declare (type display display)
@@ -1543,7 +1558,7 @@
   #.(declare-buffun)
   (excl::filesys-checking-close (display-output-stream display)))
 
-#-excl
+#-(and excl (not mswindows))
 (defun buffer-close-default (display &amp;key abort)
   ;; The default buffer close function for use with common-lisp streams
   (declare (type display display))
@@ -1643,8 +1658,9 @@
 	   (type (or null number) timeout))
   (declare (values timeout))
   (let ((fd (display-input-stream display)))
-    (declare (fixnum fd))
-    (when (&gt;= fd 0)
+    #-mswindows (declare (fixnum fd))
+    (when #-mswindows (&gt;= fd 0)
+	  #+mswindows (streamp fd)
       (cond ((fd-char-avail-p fd)
 	     nil)
 	    
@@ -1669,6 +1685,9 @@
 	    ;; to block until input is available.  Note we don't really handle
 	    ;; the interaction of interrupts and (numberp timeout) here.  XX
 	    (t
+	     #+mswindows
+	     (error &quot;scheduler must be running to use CLX on MS Windows&quot;)
+	     #-mswindows
 	     (let ((res 0))
 	       (declare (fixnum res))
 	       (with-interrupt-checking-on
@@ -1711,7 +1730,7 @@
 ;;; buffer. This should never block, so it can be called from the scheduler.
 
 ;;; The default implementation is to just use listen.
-#-excl
+#-(and excl (not mswindows))
 (defun buffer-listen-default (display)
   (declare (type display display))
   (let ((stream (display-input-stream display)))
@@ -1720,7 +1739,7 @@
 	t
       (listen stream))))
 
-#+excl 
+#+(and excl (not mswindows))
 (defun buffer-listen-default (display)
   (declare (type display display))
   (let ((fd (display-input-stream display)))
@@ -2537,7 +2556,8 @@
 #+excl
 (defmacro with-underlying-simple-vector
 	  ((variable element-type pixarray) &amp;body body)
-  `(let ((,variable (cdr (excl::ah_data ,pixarray))))
+  `(let ((,variable (cdr (#+mswindows excl::ah-data
+			  #-mswindows excl::ah_data ,pixarray))))
      (declare (type (simple-array ,element-type (*)) ,variable))
      ,@body))
 </diff>
      <filename>dependent.cl</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@
 (in-package :xlib)
 
 (eval-when (compile load eval)
-  (require :foreign)
+  #-mswindows (require :foreign)
   (require :process)			; Needed even if scheduler is not
 					; running.  (Must be able to make
 					; a process-lock.)
@@ -55,7 +55,7 @@
 
 ;; Return t if there is a character available for reading or on error,
 ;; otherwise return nil.
-#-(version&gt;= 4 2)
+#-(or (version&gt;= 4 2) mswindows)
 (defun fd-char-avail-p (fd)
   (multiple-value-bind (available-p errcode)
       (comp::.primcall-sargs 'sys::filesys #.excl::fs-char-avail fd)
@@ -63,10 +63,14 @@
        then t
        else available-p)))
 
-#+(version&gt;= 4 2)
+#+(and (version&gt;= 4 2) (not mswindows))
 (defun fd-char-avail-p (fd)
   (excl::filesys-character-available-p fd))
 
+#+mswindows
+(defun fd-char-avail-p (socket-stream)
+  (listen socket-stream))
+
 (defmacro with-interrupt-checking-on (&amp;body body)
   `(locally (declare (optimize (safety 1)))
      ,@body))
@@ -75,7 +79,7 @@
 ;; Start storing at index 'start-index' and read exactly 'length' bytes.
 ;; Return t if an error or eof occurred, nil otherwise.
 (defun fd-read-bytes (fd vector start-index length)
-  (declare (fixnum fd start-index length)
+  (declare (fixnum #-mswindows fd start-index length)
 	   (type (simple-array (unsigned-byte 8) (*)) vector))
   (with-interrupt-checking-on
    (do ((rest length))
@@ -86,7 +90,9 @@
 	 (comp::.primcall-sargs 'sys::filesys #.excl::fs-read-bytes fd vector
 				start-index rest)
 	 #+(version&gt;= 4 2)
-	 (excl::fill-read-buffer fd vector start-index rest)
+	 (excl::fill-read-buffer #-mswindows fd
+				 #+mswindows (excl::stream-input-fn fd)
+				 vector start-index rest)
        (declare (fixnum numread))
        (excl:if* errcode
 	  then (if (not (eq errcode
@@ -97,18 +103,21 @@
 	  else (decf rest numread)
 	       (incf start-index numread))))))
 
+#-mswindows
 (unless (ff:get-entry-point (ff:convert-to-lang &quot;fd_wait_for_input&quot;))
   (ff:remove-entry-point (ff:convert-to-lang &quot;fd_wait_for_input&quot;))
   #+dlfcn (load &quot;clx:excldep.so&quot;)
   #+dlhp  (load &quot;clx:excldep.sl&quot;)
   #-dynload (load &quot;clx:excldep.o&quot;))
 
+#-mswindows
 (unless (ff:get-entry-point (ff:convert-to-lang &quot;connect_to_server&quot;))
   (ff:remove-entry-point (ff:convert-to-lang &quot;connect_to_server&quot; :language :c))
   #+dlfcn (load &quot;clx:socket.so&quot;)
   #+dlhp (load &quot;clx:socket.sl&quot;)
   #-dynload (load &quot;clx:socket.o&quot;))
 
+#-mswindows
 (ff:defforeign-list `((connect-to-server
 		       :entry-point
 		       ,(ff:convert-to-lang &quot;connect_to_server&quot;)</diff>
      <filename>excldep.cl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3a11e3ac44e79788621dd78d4096853460ef8416</id>
    </parent>
  </parents>
  <author>
    <name>tomj</name>
    <email>tomj</email>
  </author>
  <url>http://github.com/franzinc/clx/commit/27931a09bd67dcdfdc5bc5543bac955b9809465f</url>
  <id>27931a09bd67dcdfdc5bc5543bac955b9809465f</id>
  <committed-date>1997-10-01T17:59:26-07:00</committed-date>
  <authored-date>1997-10-01T17:59:26-07:00</authored-date>
  <message>see ChangeLog for Wed Oct 01 17:56:10 1997  Tom McClure  &lt;tomj@falcon&gt;</message>
  <tree>715329f203ab8f3b1d3326d317d026f2ea2e55be</tree>
  <committer>
    <name>tomj</name>
    <email>tomj</email>
  </committer>
</commit>
