mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
* Source/ObjectiveC2/runtime.h:
* Source/ObjectiveC2/runtime.m: Implement protocol_copyMethodDescriptionList, protocol_copyProtocolList, protocol_getMethodDescription, as well as a dummy version of objc_copyProtocolList. * Headers/Additions/GNUstepBase/GSObjCRuntime.h: * Source/Additions/GSObjCRuntime.m: Implement a convenience method, GSProtocolGetMethodDescriptionRecursive git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31254 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f9d2cebe57
commit
c4159475b4
5 changed files with 161 additions and 7 deletions
|
@ -777,6 +777,34 @@ GSProtocolFromName(const char *name)
|
|||
return p;
|
||||
}
|
||||
|
||||
struct objc_method_description
|
||||
GSProtocolGetMethodDescriptionRecursive(Protocol *aProtocol, SEL aSel, BOOL isRequired, BOOL isInstance)
|
||||
{
|
||||
struct objc_method_description desc;
|
||||
|
||||
desc = protocol_getMethodDescription(aProtocol, aSel, isRequired, isInstance);
|
||||
if (desc.name == NULL && desc.types == NULL)
|
||||
{
|
||||
Protocol **list;
|
||||
unsigned int count;
|
||||
list = protocol_copyProtocolList(aProtocol, &count);
|
||||
if (list != NULL)
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
desc = GSProtocolGetMethodDescriptionRecursive(list[i], aSel, isRequired, isInstance);
|
||||
if (desc.name != NULL || desc.types != NULL)
|
||||
{
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
free(list);
|
||||
}
|
||||
}
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
||||
void
|
||||
GSObjCAddClassBehavior(Class receiver, Class behavior)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue