summaryrefslogtreecommitdiff
path: root/Lisp
diff options
context:
space:
mode:
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))