From 9197694fe9fd4eaa6e2c11f0acc92ef60ab6110a Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Fri, 14 Sep 2007 03:26:32 +0200 Subject: New C function: objcl_get_method_implementation. darcs-hash:de2f77980605c7aec911673edb0f0f29d0467fce --- Lisp/libobjcl.lisp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'Lisp/libobjcl.lisp') diff --git a/Lisp/libobjcl.lisp b/Lisp/libobjcl.lisp index bc84a44..176423c 100644 --- a/Lisp/libobjcl.lisp +++ b/Lisp/libobjcl.lisp @@ -86,9 +86,16 @@ objects or classes, let alone send messages to them. (defcfun ("objcl_selector_name" %objcl-selector-name) :pointer (selector obj-data)) +(defcfun ("objcl_get_method_implementation" + %objcl-get-method-implementation) + :pointer + (object obj-data) + (selector obj-data)) -(declaim (ftype (function ((or string symbol)) (or null objc-class)) - find-objc-class-by-name)) + +(declaim (ftype (function ((or string symbol) &optional t) + (or null objc-class)) + find-objc-class)) (defun find-objc-class (class-name &optional errorp) "Retrieve an Objective C class by name. @@ -177,7 +184,8 @@ conventional case for namespace identifiers in Objective C." (the selector (obj-data->lisp obj-data))))) -(declaim (ftype (function (objc-class) string) objcl-class-name)) +(declaim (ftype (function ((or objc-class id exception)) string) + objcl-class-name)) (defun objcl-class-name (class) (declare (type (or objc-class id exception) class)) (with-foreign-conversion ((obj-data class)) @@ -191,6 +199,15 @@ conventional case for namespace identifiers in Objective C." (foreign-string-to-lisp/dealloc (%objcl-selector-name obj-data)))) +(declaim (ftype (function ((or id objc-class exception) selector) *) + get-method-implementation)) +(defun get-method-implementation (object selector) + (declare (type selector selector)) + (with-foreign-conversion ((sel-obj-data selector) + (obj-obj-data object)) + (%objcl-get-method-implementation obj-obj-data sel-obj-data))) + + (declaim (ftype (function ((or selector string list)) selector) selector)) (defun selector (designator) -- cgit v1.2.3