summaryrefslogtreecommitdiff
path: root/Lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-03 14:12:24 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-03 14:12:24 +0100
commit3f7b0e5500bb23581e3a5bc94feb9ecd624ae130 (patch)
tree93360aebe2206c97f24a1689d4ef0b01a431d684 /Lisp
parent36215d830f5762278f16d6c97e1ac7068653f366 (diff)
Objective-C layer: Add objcl_class_superclass.
darcs-hash:31c261f7b04e09756c407599560a5ef5c3bc5856
Diffstat (limited to 'Lisp')
-rw-r--r--Lisp/libobjcl.lisp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lisp/libobjcl.lisp b/Lisp/libobjcl.lisp
index 16a300f..19f5a29 100644
--- a/Lisp/libobjcl.lisp
+++ b/Lisp/libobjcl.lisp
@@ -52,6 +52,9 @@
(defcfun ("objcl_class_name" %objcl-class-name) :string
(class :pointer))
+(defcfun ("objcl_class_superclass" %objcl-class-superclass) :pointer
+ (obj :pointer))
+
(defcfun ("objcl_find_selector" %objcl-find-selector) :pointer
(selector-name :string))
@@ -577,6 +580,12 @@ separating parts by hyphens works nicely in all of the `:INVERT`,
(find-objc-meta-class-by-name
(%objcl-class-name (%objcl-object-get-class (pointer-to obj)))))
+(defun objcl-class-superclass (class)
+ (let ((superclass-ptr (%objcl-class-superclass (pointer-to class))))
+ (if superclass-ptr
+ (make-pointer-wrapper t :pointer superclass-ptr)
+ nil)))
+
(defun objc-class-of (obj)
(cond ((object-is-meta-class-p obj)
(error "Tried to get the class of meta class ~S." obj))