1 #import "objc_protocol.h"
4 const char *protocol_getName(Protocol
*protocol
) {
5 return protocol
->nameCString
;
8 objc_property_t
protocol_getProperty(Protocol
*protocol
, const char *name
, BOOL isRequired
, BOOL isInstance
) {
13 objc_property_t
*protocol_copyPropertyList(Protocol
*protocol
, unsigned int *countp
) {
18 Protocol
**protocol_copyProtocolList(Protocol
*protocol
, unsigned int *countp
) {
23 struct objc_method_description
*protocol_copyMethodDescriptionList(Protocol
*protocol
, BOOL isRequired
, BOOL isInstance
, unsigned int *countp
) {
28 struct objc_method_description
protocol_getMethodDescription(Protocol
*protocol
, SEL selector
, BOOL isRequired
, BOOL isInstance
) {
29 struct objc_method_description result
= {0, 0};
34 BOOL
protocol_conformsToProtocol(Protocol
*protocol
, Protocol
*other
) {
39 if(strcmp(other
->nameCString
, protocol
->nameCString
) == 0)
41 else if(protocol
->childProtocols
== NULL
)
46 for(i
= 0; i
< protocol
->childProtocols
->count
; i
++) {
47 Protocol
*proto
= protocol
->childProtocols
->list
[i
];
49 if(strcmp(other
->nameCString
, proto
->nameCString
) == 0)
52 if(protocol_conformsToProtocol(proto
, other
))
59 BOOL
protocol_isEqual(Protocol
*protocol
, Protocol
*other
) {