X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/8755b1a5d37f2f4b853c01f0d8b121ab9ee4093a..6bb2385148c2ff5f4f5daa87b508ae6c985b451b:/glib/glib.lisp diff --git a/glib/glib.lisp b/glib/glib.lisp index 5429846..ae3cda8 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.17 2004-11-07 01:23:38 espen Exp $ +;; $Id: glib.lisp,v 1.19 2004-11-12 13:27:41 espen Exp $ (in-package "GLIB") @@ -71,17 +71,6 @@ (funcall (cdr user-data) (car user-data)))) (remhash id *user-data*)) -(defmacro def-callback-marshal (name (return-type &rest args)) - (let ((names (loop - for arg in args - collect (if (atom arg) (gensym) (first arg)))) - (types (loop - for arg in args - collect (if (atom arg) arg (second arg))))) - `(defcallback ,name (,return-type ,@(mapcar #'list names types) - (callback-id unsigned-int)) - (invoke-callback callback-id ',return-type ,@names)))) - ;;;; Quarks @@ -324,11 +313,19 @@ (let* ((size-of-type (size-of type)) (location (or location (allocate-memory (* size-of-type length)))) (writer (writer-function type))) - (loop - for element across content - for i from 0 below length - as offset = 0 then (+ offset size-of-type) - do (funcall writer element location offset)) + (etypecase content + (vector + (loop + for element across content + for i from 0 below length + as offset = 0 then (+ offset size-of-type) + do (funcall writer element location offset))) + (list + (loop + for element in content + for i from 0 below length + as offset = 0 then (+ offset size-of-type) + do (funcall writer element location offset)))) location))