chiark / gitweb /
Changes necessary to allow saving of core images with clg.
[clg] / glib / gboxed.lisp
index ceae18fcb21d9883198d94731bb8d082a543244c..1bb152b599ccea6657cb6eb43929d07ddbaae393 100644 (file)
@@ -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
 
 ;; 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: gboxed.lisp,v 1.16 2005-02-14 00:44:26 espen Exp $
+;; $Id: gboxed.lisp,v 1.17 2005-03-06 17:26:23 espen Exp $
 
 (in-package "GLIB")
 
 
 (in-package "GLIB")
 
@@ -42,17 +42,13 @@   (defmethod validate-superclass ((class boxed-class) (super standard-class))
     (subtypep (class-name super) 'boxed)))
 
 
     (subtypep (class-name super) 'boxed)))
 
 
-(defmethod shared-initialize ((class boxed-class) names
-                             &rest initargs &key name alien-name)
-  (declare (ignore initargs names))
+(defmethod shared-initialize ((class boxed-class) names &key name gtype)
+  (declare (ignore names))
   (call-next-method)
   (call-next-method)
-  
-  (let* ((class-name (or name (class-name class)))
-        (type-number
-         (find-type-number
-          (or (first alien-name) (default-alien-type-name class-name)))))
-    (register-type class-name type-number)))
-
+  (let ((class-name (or name (class-name class))))
+    (unless (find-type-number class-name)
+      (register-type class-name 
+       (or (first gtype) (default-type-init-name class-name))))))
 
 (defbinding %boxed-copy () pointer
   (type-number type-number)
 
 (defbinding %boxed-copy () pointer
   (type-number type-number)
@@ -76,7 +72,7 @@ (defun expand-boxed-type (type-number forward-p slots)
      ,(unless forward-p
        slots)
      (:metaclass boxed-class)
      ,(unless forward-p
        slots)
      (:metaclass boxed-class)
-     (:alien-name ,(find-type-name type-number))))
+     (:gtype ,(find-type-init-function type-number))))
 
 (register-derivable-type 'boxed "GBoxed" 'expand-boxed-type)
 
 
 (register-derivable-type 'boxed "GBoxed" 'expand-boxed-type)
 
@@ -115,4 +111,4 @@ (register-derivable-type 'boxed "GBoxed" 'expand-boxed-type)
 ;;;; NULL terminated vector of strings
 
 (deftype strings () '(null-terminated-vector string))
 ;;;; NULL terminated vector of strings
 
 (deftype strings () '(null-terminated-vector string))
-(register-type 'strings "GStrv")
+(register-type 'strings '|g_strv_get_type|)