[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: listening for input with CLX

Your message:


    does someone know how to perform the equivalent of a listen on the
    file descriptor associated with the input stream for a given display?

    i noticed that the r4 CLX code has support for this, but i can find neither
    neither the equivalent R3 CLX functions, nor the base functions which the R
    code used.

    the salient function appears to be:

    (defun fd-char-avail-p (fd)
      (multiple-value-bind (available-p errcode)
          (comp::.primcall-sargs 'sys::filesys excl::fs-char-avail fd)
        (if* errcode
           then t
           else available-p)))

    i am using allegro cl: "3.1.beta.28 [DEC 3100] (8/3;8/7/89)"

    james anderson.


I didn't realize when I answered your question yesterday that you have code
built on R3 CLX and so cannot switch to R4 CLX.

Here is an implementation for the R3 CLX you are using.  You will also need
to have the scheduler running.  (mp:start-scheduler) will do this.

(require :process)

(defun buffer-listen (display)
  (mp:process-wait :no-input #'xlib::listen-fd
                   (xlib::display-input-stream display)))

	-- John Irwin