[slime-cvs] CVS update: slime/swank-sbcl.lisp
Helmut Eller
heller at common-lisp.net
Sat Feb 21 16:42:52 UTC 2004
Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv9961
Modified Files:
swank-sbcl.lisp
Log Message:
(add-sigio-handler, remove-sigio-handlers): Renamed.
(add-fd-handler, remove-fd-handlers): Implement interface.
Date: Sat Feb 21 11:42:52 2004
Author: heller
Index: slime/swank-sbcl.lisp
diff -u slime/swank-sbcl.lisp:1.66 slime/swank-sbcl.lisp:1.67
--- slime/swank-sbcl.lisp:1.66 Mon Feb 16 16:45:22 2004
+++ slime/swank-sbcl.lisp Sat Feb 21 11:42:52 2004
@@ -131,7 +131,7 @@
(sb-alien:alien-funcall fcntl fd +f_setown+
(sb-unix:unix-getpid))))))
-(defimplementation add-input-handler (socket fn)
+(defimplementation add-sigio-handler (socket fn)
(set-sigio-handler)
(let ((fd (socket-fd socket)))
(format *debug-io* "Adding sigio handler: ~S ~%" fd)
@@ -139,7 +139,7 @@
(push (cons fd fn) *sigio-handlers*)))
#+(or)
-(defimplementation add-input-handler (socket fn)
+(defimplementation add-sigio-handler (socket fn)
(set-sigio-handler)
(let ((fd (socket-fd socket)))
(format *debug-io* "Adding sigio handler: ~S ~%" fd)
@@ -147,11 +147,22 @@
(sb-posix:fcntl fd sb-posix::f-setown (sb-unix:unix-getpid))
(push (cons fd fn) *sigio-handlers*)))
-(defimplementation remove-input-handlers (socket)
+(defimplementation remove-sigio-handlers (socket)
(let ((fd (socket-fd socket)))
(setf *sigio-handlers* (delete fd *sigio-handlers* :key #'car))
(sb-sys:invalidate-descriptor fd))
(close socket))
+
+(defimplementation add-fd-handler (socket fn)
+ (declare (type function fn))
+ (let ((fd (socket-fd socket)))
+ (format *debug-io* "; Adding fd handler: ~S ~%" fd)
+ (sb-sys:add-fd-handler fd :input (lambda (_)
+ _
+ (funcall fn)))))
+
+(defimplementation remove-fd-handlers (socket)
+ (sb-sys:invalidate-descriptor (socket-fd socket)))
(defun socket-fd (socket)
(etypecase socket
More information about the slime-cvs
mailing list