X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/1239e395b06382bac5150314c14e733f3da5a65d..a15ecb7ec3e339b8d04d4238aecffbed989196bf:/glib/glib.lisp diff --git a/glib/glib.lisp b/glib/glib.lisp index 05df2b0..d82d522 100644 --- a/glib/glib.lisp +++ b/glib/glib.lisp @@ -15,7 +15,7 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -;; $Id: glib.lisp,v 1.26 2005/02/10 00:12:04 espen Exp $ +;; $Id: glib.lisp,v 1.28 2005/04/17 21:44:27 espen Exp $ (in-package "GLIB") @@ -38,9 +38,8 @@ (defbinding (deallocate-memory "g_free") () nil ;; (declare (ignore address))) (defun copy-memory (from length &optional (to (allocate-memory length))) - (;#+cmu kernel:system-area-copy - ;#+sbcl sb-impl::system-area-copy - system-area-copy from 0 to 0 (* 8 length)) + #+cmu(system-area-copy from 0 to 0 (* 8 length)) + #+sbcl(system-area-ub8-copy from 0 to 0 length) to) @@ -548,17 +547,17 @@ (defun destroy-0-vector (location element-type) (deallocate-memory location)) -(defmethod alien-type ((type (eql 'vector-null)) &rest args) +(defmethod alien-type ((type (eql 'null-terminated-vector)) &rest args) (declare (ignore type args)) (alien-type 'pointer)) -(defmethod size-of ((type (eql 'vector-null)) &rest args) +(defmethod size-of ((type (eql 'null-terminated-vector)) &rest args) (declare (ignore type args)) (alien-type 'pointer)) -(defmethod writer-function ((type (eql 'vector-null)) &rest args) +(defmethod writer-function ((type (eql 'null-terminated-vector)) &rest args) (declare (ignore type)) - (destructuring-bind (element-type &optional (length '*)) args + (destructuring-bind (element-type) args (unless (eq (alien-type element-type) (alien-type 'pointer)) (error "Elements in null-terminated vectors need to be of pointer types")) #'(lambda (vector location &optional (offset 0)) @@ -566,9 +565,9 @@ (defmethod writer-function ((type (eql 'vector-null)) &rest args) (sap-ref-sap location offset) (make-0-vector element-type vector))))) -(defmethod reader-function ((type (eql 'vector-null)) &rest args) +(defmethod reader-function ((type (eql 'null-terminated-vector)) &rest args) (declare (ignore type)) - (destructuring-bind (element-type &optional (length '*)) args + (destructuring-bind (element-type) args (unless (eq (alien-type element-type) (alien-type 'pointer)) (error "Elements in null-terminated vectors need to be of pointer types")) #'(lambda (location &optional (offset 0)) @@ -576,17 +575,17 @@ (defmethod reader-function ((type (eql 'vector-null)) &rest args) (map-0-vector 'vector #'identity (sap-ref-sap location offset) element-type))))) -(defmethod destroy-function ((type (eql 'vector-null)) &rest args) +(defmethod destroy-function ((type (eql 'null-terminated-vector)) &rest args) (declare (ignore type)) - (destructuring-bind (element-type &optional (length '*)) args + (destructuring-bind (element-type) args (unless (eq (alien-type element-type) (alien-type 'pointer)) (error "Elements in null-terminated vectors need to be of pointer types")) #'(lambda (location &optional (offset 0)) (unless (null-pointer-p (sap-ref-sap location offset)) - (destroy-c-vector + (destroy-0-vector (sap-ref-sap location offset) element-type) (setf (sap-ref-sap location offset) (make-pointer 0)))))) -(defmethod unbound-value ((type (eql 'vector-null)) &rest args) - (declare (ignore args)) +(defmethod unbound-value ((type (eql 'null-terminated-vector)) &rest args) + (declare (ignore type args)) (values t nil))