[gtk-cffi-cvs] CVS gtk-cffi/g-lib
CVS User rklochkov
rklochkov at common-lisp.net
Mon Dec 31 13:33:38 UTC 2012
Update of /project/gtk-cffi/cvsroot/gtk-cffi/g-lib
In directory tiger.common-lisp.net:/tmp/cvs-serv30885/g-lib
Modified Files:
error.lisp variant.lisp
Log Message:
Backed to CFFI 10.7 (was version from git)
--- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/error.lisp 2012/10/07 12:02:11 1.7
+++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/error.lisp 2012/12/31 13:33:38 1.8
@@ -20,18 +20,20 @@
(defmethod free :before ((g-error g-error))
(g-clear-error g-error))
-(defcstruct g-error
+(defcstruct* g-error-struct
"GError struct"
(domain g-quark)
(errno :int)
(message :string))
(defun get-error (g-error)
- (let ((p (mem-ref (pointer g-error) :pointer)))
- (unless (null-pointer-p p)
- (with-foreign-slots
- ((domain errno message) p (:struct g-error))
- `(:domain ,domain :errno ,errno :message ,message)))))
+ (let ((p (make-instance 'g-error-struct
+ :pointer (mem-ref (pointer g-error) :pointer)
+ :free-after nil)))
+ (when p
+ (list :domain (domain p)
+ :errno (errno p)
+ :message (message p)))))
;(defmethod print-object ((g-error g-error) stream)
; (let ((err (get-error g-error)))
--- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/variant.lisp 2012/08/24 19:27:54 1.5
+++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/variant.lisp 2012/12/31 13:33:38 1.6
@@ -37,7 +37,7 @@
(defcfun g-variant-parse :pointer
(type variant-type) (text :pointer) (limit :pointer) (end :pointer)
- (g-error (:pointer (:struct g-error))))
+ (g-error object))
(defcfun g-variant-print (:string :free-from-foreign t)
(variant :pointer) (annotate :boolean))
More information about the gtk-cffi-cvs
mailing list