Home | History | Annotate | Download | only in libobjc

Lines Matching refs:protocol

1 /* GNU Objective C Runtime protocol related functions.
35 /* This is a table that maps a name to a Protocol instance with that
36 name. Because there may be multiple Protocol instances with the
50 /* The keys in the table are strings, and the values are Protocol
56 /* Add a protocol to the hashtable. */
62 /* If we find a protocol with the same name already in the
77 Protocol *
80 Protocol *protocol;
86 protocol = (Protocol *)(objc_hash_value_for_key (__protocols_hashtable, name));
89 return protocol;
92 Protocol **
96 Protocol **returnValue = NULL;
114 returnValue = (Protocol **)(malloc (sizeof (Protocol *) * (count + 1)));
136 class_addProtocol (Class class_, Protocol *protocol)
140 if (class_ == Nil || protocol == NULL)
143 if (class_conformsToProtocol (class_, protocol))
146 /* Check that it is a Protocol object before casting it to (struct
148 if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
156 protocols->list[0] = (struct objc_protocol *)protocol;
168 class_conformsToProtocol (Class class_, Protocol *protocol)
172 if (class_ == Nil || protocol == NULL)
175 /* Check that it is a Protocol object before casting it to (struct
177 if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
192 if (proto_list->list[i] == (struct objc_protocol *)protocol
193 || protocol_conformsToProtocol ((Protocol *)proto_list->list[i],
194 protocol))
207 Protocol **
211 Protocol **returnValue = NULL;
239 returnValue = (Protocol **)(malloc (sizeof (Protocol *) * (count + 1)));
249 returnValue[i] = (Protocol *)proto_list->list[j];
266 protocol_conformsToProtocol (Protocol *protocol, Protocol *anotherProtocol)
270 if (protocol == NULL || anotherProtocol == NULL)
273 if (protocol == anotherProtocol)
276 /* Check that the objects are Protocol objects before casting them
278 if (protocol->class_pointer != anotherProtocol->class_pointer)
281 if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
284 if (strcmp (((struct objc_protocol *)protocol)->protocol_name,
289 immutable. We can freely iterate over a protocol structure. */
290 proto_list = ((struct objc_protocol *)protocol)->protocol_list;
297 if (protocol_conformsToProtocol ((Protocol *)proto_list->list[i], anotherProtocol))
307 protocol_isEqual (Protocol *protocol, Protocol *anotherProtocol)
309 if (protocol == anotherProtocol)
312 if (protocol == NULL || anotherProtocol == NULL)
315 /* Check that the objects are Protocol objects before casting them
317 if (protocol->class_pointer != anotherProtocol->class_pointer)
320 if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
329 checking the names is equivalent to checking that Protocol A
330 conforms to Protocol B and Protocol B conforms to Protocol A,
337 if (strcmp (((struct objc_protocol *)protocol)->protocol_name,
345 protocol_getName (Protocol *protocol)
347 /* Check that it is a Protocol object before casting it to (struct
349 if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
352 return ((struct objc_protocol *)protocol)->protocol_name;
355 struct objc_method_description protocol_getMethodDescription (Protocol *protocol,
365 /* The current ABI does not have any information on optional protocol methods. */
369 /* Check that it is a Protocol object before casting it to (struct
371 if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
375 methods = ((struct objc_protocol *)protocol)->instance_methods;
377 methods = ((struct objc_protocol *)protocol)->class_methods;
395 struct objc_method_description *protocol_copyMethodDescriptionList (Protocol *protocol,
405 /* The current ABI does not have any information on optional protocol methods. */
414 /* Check that it is a Protocol object before casting it to (struct
416 if (protocol == NULL || protocol->class_pointer != objc_lookUpClass ("Protocol"))
425 immutable. We can freely iterate over a protocol structure. */
428 methods = ((struct objc_protocol *)protocol)->instance_methods;
430 methods = ((struct objc_protocol *)protocol)->class_methods;
456 Property protocol_getProperty (Protocol *protocol, const char *propertyName,
459 if (protocol == NULL || propertyName == NULL)
465 /* Check that it is a Protocol object before casting it to (struct
467 if (protocol->class_pointer != objc_lookUpClass ("Protocol"))
471 /* The current ABI does not have any information on protocol properties. */
475 Property *protocol_copyPropertyList (Protocol *protocol, unsigned int *numberOfReturnedProperties)
480 /* Check that it is a Protocol object before casting it to (struct
482 if (protocol == NULL || protocol->class_pointer != objc_lookUpClass ("Protocol"))
491 immutable. We can freely iterate over a protocol structure. */
494 /* The current ABI does not have any information on protocol properties. */
501 Protocol **protocol_copyProtocolList (Protocol *protocol, unsigned int *numberOfReturnedProtocols)
504 Protocol **returnValue = NULL;
507 /* Check that it is a Protocol object before casting it to (struct
509 if (protocol == NULL || protocol->class_pointer != objc_lookUpClass ("Protocol"))
518 immutable. We can freely iterate over a protocol structure. */
521 proto_list = ((struct objc_protocol *)protocol)->protocol_list;
534 returnValue = (Protocol **)(malloc (sizeof (Protocol *) * (count + 1)));
537 proto_list = ((struct objc_protocol *)protocol)->protocol_list;
544 returnValue[i] = (Protocol *)proto_list->list[j];