[gtk-cffi-cvs] CVS gtk-cffi/g-lib

CVS User rklochkov rklochkov at common-lisp.net
Sun Oct 23 08:39:53 UTC 2011


Update of /project/gtk-cffi/cvsroot/gtk-cffi/g-lib
In directory tiger.common-lisp.net:/tmp/cvs-serv3681/g-lib

Modified Files:
	error.lisp package.lisp 
Log Message:
Finished TextBuffer support



--- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/error.lisp	2011/04/25 19:16:07	1.1.1.1
+++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/error.lisp	2011/10/23 08:39:53	1.2
@@ -28,14 +28,18 @@
   (errno :int)
   (message gtk-string))
 
-(defmethod print-object ((g-error g-error) stream)
+(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 g-error)
-        (format stream "GError ~A (~A): ~A"
-                (g-quark-to-string domain) errno message)))))
+        `(:domain ,domain :errno ,errno :message ,message)))))
 
+(defmethod print-object ((g-error g-error) stream)
+  (let ((err (get-error g-error)))
+    (format stream "GError ~A (~A): ~A"
+            (g-quark-to-string (getf err :domain)) 
+            (getf err :errno) (getf err :message))))
 
 (defmacro with-g-error (g-error &body body)
   `(let ((,g-error (make-instance 'g-error)))
--- /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/package.lisp	2011/09/21 12:03:47	1.4
+++ /project/gtk-cffi/cvsroot/gtk-cffi/g-lib/package.lisp	2011/10/23 08:39:53	1.5
@@ -18,7 +18,10 @@
    #:g-list
    #:g-slist
    #:g-quark
+
    #:g-error
+   #:get-error
+
    #:garray
    #:*array-length*
 





More information about the gtk-cffi-cvs mailing list