Lisp interface to TTYVAR system call FEB 20,1978 Send all bugs to GSB@ML. Source from which fasl file generated will be kept in AR1:GSB;TTYVAR LIBLSP, on ML. This file will only work in recent lisps, that have the internal entries %CONS, %NCONS, and %XCONS. In the following, a may be either a file object (or T) or a small fixnum which is the tty number. The open mode on the file object need not include TTY, but if the channel is not open to a tty or tty-like device, a WRONG TYPE DEVICE error will result. A is the name of the tty variable. It may be either a fixnum (the sixbit itself) or a symbol, which will be turned into sixbit. Once the spec is in sixbit, if the high order 9. bits are all ones, a WRNG-TYPE-ARG error results, since the system call would then interpret this as an aobjn pointer. This error occurs whether or not the function being called would give an error for an illegal variable name. Functions include READ-TTY-VARIABLE (,) Always returns a fixnum result. Will give a WRNG-TYPE-ARG error if an illegal variable is specified. Any other error from the TTYVAR call generate an IO-LOSSAGE error. WRITE-TTY-VARIABLE (,,) Return NIL. Errors like READ-TTY-VARIABLE. OR-INTO-TTY-VARIABLE (,,) is similar, as is CLEAR-TTY-VARIABLE-BITS (,,). INCREMENT-TTY-VARIABLE and DECREMENT-TTY-VARIABLE take 2 or 3 arguments; , , and amount, defaulted to 1. Thus, to find the number of character positions on your terminal, (READ-TTY-VARIABLE T 'HEIGHT) To simulate a ":tctype refuse", (CLEAR-TTY-VARIABLE-BITS T 'TTYCOM 1_29.) ;; Clear %TCQRY, the 'query' bit, just in case (OR-INTO-TTY-VARIABLE T 'TTYCOM 1_30.) ;; Set %TCRFS, the 'refuse' bit. There are counterparts of these functions for people/programs that wish to take a more active interest in the errors supplied: READ-TTY-VARIABLE? (,,) If an error occurs, then if is NIL, return the error code; if a fixnum, return that; else call it as a function, with arguments of , , and the error code. NCALLable. WRITE-TTY-VARIABLE? (,,,), OR-INTO-TTY-VARIABLE? (,,,), CLEAR-TTY-VARIABLE-BITS? (,,,) INCREMENT-TTY-VARIABLE? (, , &optional (amount 1), ) (note that is always the last argument) DECREMENT-TTY-VARIABLE? (, , &optional (amount 1), ) all are similar, except they normally return NIL. The function may return anything it likes in this case, however.