summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-16 21:58:13 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-16 21:58:13 +0100
commit23aeccec01d4e888885cca03c6557f2f0542ab0c (patch)
tree982f175316a470252f07d7ff6a7bdf5338972cdf
parent5799411300f74f5c029c4c024cd6dfc50de168f6 (diff)
Objective-C layer: Add functions for determining whether a class is managed by Lisp.
darcs-hash:2be32db4b0358556b007ad6737f689e04de1e7b3
-rw-r--r--Lisp/libobjcl.lisp17
-rw-r--r--Objective-C/libobjcl.h6
-rw-r--r--Objective-C/libobjcl.m14
3 files changed, 37 insertions, 0 deletions
diff --git a/Lisp/libobjcl.lisp b/Lisp/libobjcl.lisp
index 1a7e21a..8cb490b 100644
--- a/Lisp/libobjcl.lisp
+++ b/Lisp/libobjcl.lisp
@@ -156,6 +156,17 @@
(defcfun ("objcl_finalise_class" %objcl-finalise-class) :void
(class :pointer))
+(defcfun ("objcl_class_backed_by_lisp_class_p"
+ %objcl-class-backed-by-lisp-class-p)
+ :int
+ (class :pointer))
+
+(defcfun ("objcl_class_set_backed_by_lisp_class"
+ %objcl-class-set-backed-by-lisp-class)
+ :void
+ (class :pointer)
+ (backed-p :int))
+
(defcvar *objcl-current-exception-lock* :pointer)
(defcvar *objcl-current-exception* :pointer)
@@ -867,3 +878,9 @@ separating parts by hyphens works nicely in all of the `:INVERT`,
then (inc-pointer current-slot element-size)
collecting (mem-ref current-slot :pointer))
(foreign-free array-pointer))))))
+
+(defun objcl-class-backed-by-lisp-class-p/pointer (class-ptr)
+ (not (zerop (%objcl-class-backed-by-lisp-class-p class-ptr))))
+
+(defun objcl-class-set-backed-by-lisp-class/pointer (class-ptr backed-p)
+ (%objcl-class-set-backed-by-lisp-class class-ptr (if backed-p 1 0)))
diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h
index c8c6766..26dca23 100644
--- a/Objective-C/libobjcl.h
+++ b/Objective-C/libobjcl.h
@@ -187,3 +187,9 @@ objcl_add_method (Class class,
void
objcl_finalise_class (Class class);
+
+int
+objcl_class_backed_by_lisp_class_p (Class class);
+
+void
+objcl_class_set_backed_by_lisp_class (Class class, int backed_p);
diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m
index e7d8148..141c069 100644
--- a/Objective-C/libobjcl.m
+++ b/Objective-C/libobjcl.m
@@ -783,3 +783,17 @@ objcl_finalise_class (Class class)
[method_list_lengths removeObjectForKey: class_name];
#endif
}
+
+
+int
+objcl_class_backed_by_lisp_class_p (Class class)
+{
+ return [class __objcl_isBackedByLispClass];
+}
+
+
+void
+objcl_class_set_backed_by_lisp_class (Class class, int backed_p)
+{
+ [class __objcl_setBackedByLispClass: backed_p];
+}