Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Perl will always provide the null. -- Larry Wall in <199801151818.KAA14538@wall.org>


devel / comp.lang.lisp / SBCL and OS interface

SubjectAuthor
o SBCL and OS interfacesteve

1
SBCL and OS interface

<84sg0k1i6l.fsf@gmail.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16641&group=comp.lang.lisp#16641

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 11 Jul 2021 19:37:06 -0500
From: sgonedes1977@gmail.com (steve)
Newsgroups: comp.lang.lisp
Subject: SBCL and OS interface
Date: Sun, 11 Jul 2021 20:37:06 -0400
Message-ID: <84sg0k1i6l.fsf@gmail.com>
Organization: Loft - a Gnu/Linux system
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:eFpPqbyBboNzLi2Uf37jHYnSNa0=
MIME-Version: 1.0
Content-Type: text/plain
Lines: 57
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-wiWkkVxuSUMb0ifiXfgE+wCoy1SS7I0Mr44L6jvBjvgk/wKdYIoNLdy23lh1uoTS11MnK68x03AJmln!PqLpYuDXqGKlWBgHDmJvd2v9bKd65wuHtKIxyzd3kc5P7GND+w==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2896
 by: steve - Mon, 12 Jul 2021 00:37 UTC

The following partial functions work with sbcl using the SB-POSIX
interface. I still cannot understand how the ffi works; thank you SBCL people...

(defun tty-open-device (tty &key (debugging-p t))
(tty-close)
(let ((stdscr (or *current-screen* (setq *current-screen* (make-screen)))))
(setq tty (namestring tty))
(let* ((ofd (sb-posix:open tty sb-posix:o-wronly (logior sb-posix:o-noctty sb-posix:o-nonblock)))
(ifd (sb-posix:open tty sb-posix:o-rdonly (logior sb-posix:o-noctty sb-posix:o-nonblock)))
;; this needs to be fixed for input
(output (sb-sys:make-fd-stream ofd :buffering :none :output t :input nil :external-format :ascii))
(input (sb-sys:make-fd-stream ofd :buffering :none :output nil :input t :external-format :ascii))
)

[ ... ]

#|

;; Old Flags New Flags
;; ------------------------
;; I_flags; 25862 => 25606
;; O_flags; 5 => 5
;; C_flags; 1215 => 1215
;; L_flags; 35387 => 35377

|#
(defconstant ECHOCTL #o0001000)

(defun tty-set ()
(let ((termios (screen-termios-new (current-screen))))

;; set cannon mode/no echo
(setf (sb-posix:termios-lflag termios)
(logand (sb-posix:termios-lflag termios)
(lognot (logior sb-posix:icanon sb-posix:echo sb-posix:noflsh
ECHOCTL))))
;; set ignore nl/cr
(setf (sb-posix:termios-iflag termios)
(logand (sb-posix:termios-iflag termios) (lognot sb-posix:ICRNL)))

(setf (aref (sb-posix:termios-cc termios) sb-posix:vmin) 18)
(setf (aref (sb-posix:termios-cc termios) sb-posix:vtime) 1)
(sb-posix:tcsetattr (screen-ifd (current-screen)) sb-posix:tcsaflush termios)
(force-output (screen-output (current-screen)))
(current-screen)))

[ ... ]

I have been waiting for years to dump some of that c code! Thank you!!!
again!!!


devel / comp.lang.lisp / SBCL and OS interface

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor