diff options
Diffstat (limited to 'libobjc/objc')
-rw-r--r-- | libobjc/objc/runtime.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/libobjc/objc/runtime.h b/libobjc/objc/runtime.h index 9380331..bb241ac 100644 --- a/libobjc/objc/runtime.h +++ b/libobjc/objc/runtime.h @@ -545,7 +545,26 @@ objc_EXPORT void method_getReturnType (Method method, char *returnValue, objc_EXPORT void method_getArgumentType (Method method, unsigned int argumentNumber, char *returnValue, size_t returnValueSize); - +/* Change the implementation of the method. It also searches all + classes for any class implementing the method, and replaces the + existing implementation with the new one. For that to work, + 'method' must be a method returned by class_getInstanceMethod() or + class_getClassMethod() as the matching is done by comparing the + pointers; in that case, only the implementation in the class is + modified. Return the previous implementation that has been + replaced. If method or implementation is NULL, do nothing and + return NULL. */ +objc_EXPORT IMP +method_setImplementation (Method method, IMP implementation); + +/* Swap the implementation of two methods in a single, atomic + operation. This is equivalent to getting the implementation of + each method and then calling method_setImplementation() on the + other one. For this to work, the two methods must have been + returned by class_getInstanceMethod() or class_getClassMethod(). + If 'method_a' or 'method_b' is NULL, do nothing. */ +objc_EXPORT void +method_exchangeImplementations (Method method_a, Method method_b); /** Implementation: the following functions are in protocols.c. */ |