1 (in-package :sb-posix-internal)
2 (defmacro define-designator (name result &body conversions)
3 (let ((type `(quote (or ,@(mapcar #'car conversions))))
4 (typename (intern (format nil "~A-~A"
6 (symbol-name :designator))
9 (eval-when (:compile-toplevel :load-toplevel :execute)
10 (deftype ,typename () ,type)
11 (setf (get ',name 'designator-type) ',result))
12 (defun ,(intern (symbol-name name) :sb-posix) (,name)
13 (declare (type ,typename ,name))
17 (define-designator filename c-string
18 (pathname (namestring (translate-logical-pathname filename)))
21 (define-designator file-descriptor (integer 32)
22 (sb-impl::file-stream (sb-impl::fd-stream-fd file-descriptor))
23 (fixnum file-descriptor))
25 (define-designator sap-or-nil sb-sys:system-area-pointer
26 (null (sb-sys:int-sap 0))
27 (sb-sys:system-area-pointer sap-or-nil))