Fix for recent iolib syscalls naming scheme

Nikolay V. Razbegaev [2010-04-06 17:37]
Fix for recent iolib syscalls naming scheme
Filename
conditions.lisp
ffi-termios-functions-unix.lisp
pkgdcl.lisp
streams.lisp
diff --git a/conditions.lisp b/conditions.lisp
index 08ccc8d..49c4281 100644
--- a/conditions.lisp
+++ b/conditions.lisp
@@ -3,7 +3,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (in-package :iolib.termios)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(define-condition termios-error (iolib-error)
+(define-condition termios-error (isys:iolib-error)
   ()
   (:documentation "Foundation of all iolib.termios conditions"))
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/ffi-termios-functions-unix.lisp b/ffi-termios-functions-unix.lisp
index c544996..ccc0351 100644
--- a/ffi-termios-functions-unix.lisp
+++ b/ffi-termios-functions-unix.lisp
@@ -33,7 +33,7 @@
   (fd      :int)
   (termios :pointer)) 			; const struct termios *
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defsyscall (%tcgetsid "tcgetsid") pid-t
+(defsyscall (%tcgetsid "tcgetsid") isys:pid-t
   (fd :int))
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defsyscall (%tcsendbreak "tcsendbreak") (:int :restart t :handle fd)
diff --git a/pkgdcl.lisp b/pkgdcl.lisp
index ebcdd97..cff1fae 100644
--- a/pkgdcl.lisp
+++ b/pkgdcl.lisp
@@ -5,7 +5,8 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defpackage :iolib.termios
   (:nicknames #:itty)
-  (:use :iolib.base :iolib.syscalls :iolib.streams :cffi)
+  (:use :iolib.base :iolib.streams :cffi)
+  (:import-from :iolib.syscalls :defsyscall :defcfun*)
   (:export
    ;; Struct termios:
    #:termios
diff --git a/streams.lisp b/streams.lisp
index 99e15e8..340fc15 100644
--- a/streams.lisp
+++ b/streams.lisp
@@ -20,8 +20,8 @@
   "List of all open serial streams for restoring original serial devices
    settings via signal handlers.")
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defun open-serial-stream (path &key (flag (logior o-rdwr o-nonblock o-noctty))
-                        (mode *default-open-mode*)
+(defun open-serial-stream (path &key (flag (logior isys:o-rdwr isys:o-nonblock isys:o-noctty))
+                        (mode isys:*default-open-mode*)
 			(external-format :default))
   "Return `dual-channel-tty-gray-stream' instances associated
    with serial device and push in into the `*open-serial-streams*' list"
@@ -29,7 +29,7 @@
                      (string= (tty-path x) path))
                  *open-serial-streams*)
     (error "Serial device ~A already opened!" path))
-  (let ((fd (%sys-open path flag mode))
+  (let ((fd (isys:open path flag mode))
         (termios (foreign-alloc 'termios)))
     (%tcgetattr fd termios)
     (let ((s (make-instance 'dual-channel-tty-gray-stream
@@ -78,8 +78,10 @@
                                       ;; not an posix option
                                       #+(or bsd linux)hardware-flow-control
                                       software-flow-control
-                                      (flag (logior o-rdwr o-nonblock o-noctty))
-                                      (mode *default-open-mode*)
+                                      (flag (logior isys:o-rdwr
+                                                    isys:o-nonblock
+                                                    isys:o-noctty))
+                                      (mode isys:*default-open-mode*)
                                       (external-format :default)
                                       timeout read-timeout write-timeout)
                               &body body)
@@ -100,8 +102,9 @@
      and 300-5e1 `:speed :b300 :parity :e :byte-size 5`. 115200-8n1 is default.

    Other &key parameters is:
-   - flag & mode: passed to `isys:%sys-open',
-     (logior isys:o-rdwr isys:o-nonblock) & *default-open-mode* by default.
+   - flag & mode: passed to `isys:open',
+     (logior isys:o-rdwr isys:o-nonblock isys:o-noctty)
+     & isys:*default-open-mode* by default.
    - external-format: see babel manual.
    - stream read/write timeout values: no default values are specified.
ViewGit