16 #ifndef OBJFWRT_OBJFWRT_H
17 #define OBJFWRT_OBJFWRT_H
19 #ifndef __STDC_LIMIT_MACROS
20 # define __STDC_LIMIT_MACROS
22 #ifndef __STDC_CONSTANT_MACROS
23 # define __STDC_CONSTANT_MACROS
33 # define __has_feature(x) 0
36 #ifndef __has_attribute
37 # define __has_attribute(x) 0
40 #if !__has_feature(nullability)
47 # ifndef _Null_unspecified
48 # define _Null_unspecified
52 #if !__has_feature(objc_arc) && !defined(__unsafe_unretained)
53 # define __unsafe_unretained
59 #define Nil (Class _Null_unspecified)0
64 #define nil (id _Null_unspecified)0
85 typedef struct objc_class *
Class;
90 typedef struct objc_object *
id;
98 typedef const struct objc_selector *
SEL;
105 typedef const struct objc_method *
Method;
110 #if defined(__OBJC__) && !defined(DOXYGEN)
119 typedef const struct objc_ivar *
Ivar;
126 #if !defined(__wii__) && !defined(__amigaos__)
142 typedef id _Nullable (*
IMP)(
id _Nonnull object,
SEL _Nonnull selector, ...);
165 id __unsafe_unretained _Nullable
self;
170 Class _Nonnull class_;
206 extern bool sel_isEqual(
SEL _Nonnull selector1,
SEL _Nonnull selector2);
217 const char *_Nonnull name,
size_t extraBytes);
249 unsigned int *_Nullable length);
292 SEL _Nonnull selector);
318 SEL _Nonnull selector);
333 SEL _Nonnull selector);
343 SEL _Nonnull selector);
355 IMP _Nonnull implementation,
const char *_Nullable typeEncoding);
368 SEL _Nonnull selector,
IMP _Nonnull implementation,
369 const char *_Nullable typeEncoding);
389 Class _Nonnull class_);
437 unsigned int *_Nullable outCount);
465 unsigned int *_Nullable outCount);
501 Class _Nullable class_,
unsigned int *_Nullable outCount);
549 IMP _Nullable stretForward);
569 void *_Nullable bytes);
656 extern void __objc_exec_class(
struct objc_module *_Nonnull module);
657 extern IMP _Nonnull objc_msg_lookup(
id _Nullable
object,
SEL _Nonnull selector);
658 extern IMP _Nonnull objc_msg_lookup_stret(
id _Nullable
object,
659 SEL _Nonnull selector);
660 extern IMP _Nonnull objc_msg_lookup_super(
struct objc_super *_Nonnull super,
661 SEL _Nonnull selector);
662 extern IMP _Nonnull objc_msg_lookup_super_stret(
663 struct objc_super *_Nonnull super,
SEL _Nonnull selector);
664 extern Class _Nullable objc_lookUpClass(
const char *_Nonnull name);
665 extern Class _Nullable objc_getClass(
const char *_Nonnull name);
666 extern Class _Nonnull objc_getRequiredClass(
const char *_Nonnull name);
667 extern Class _Nullable objc_lookup_class(
const char *_Nonnull name);
668 extern Class _Nonnull objc_get_class(
const char *_Nonnull name);
669 extern void objc_exception_throw(
id _Nullable
object);
670 extern int objc_sync_enter(
id _Nullable
object);
671 extern int objc_sync_exit(
id _Nullable
object);
672 extern id _Nullable objc_getProperty(
id _Nonnull
self,
SEL _Nonnull _cmd,
673 ptrdiff_t offset,
bool atomic);
674 extern void objc_setProperty(
id _Nonnull
self,
SEL _Nonnull _cmd,
675 ptrdiff_t offset,
id _Nullable value,
bool atomic,
signed char copy);
676 extern void objc_getPropertyStruct(
void *_Nonnull dest,
677 const void *_Nonnull src, ptrdiff_t size,
bool atomic,
bool strong);
678 extern void objc_setPropertyStruct(
void *_Nonnull dest,
679 const void *_Nonnull src, ptrdiff_t size,
bool atomic,
bool strong);
680 extern void objc_enumerationMutation(
id _Nonnull
object);
681 #ifndef OBJC_NO_PERSONALITY_DECLARATION
686 extern int __gnu_objc_personality_v0(
int version,
int actions,
687 uint64_t exClass,
void *_Nonnull ex,
void *_Nonnull ctx);
688 extern int __gnu_objc_personality_sj0(
int version,
int actions,
689 uint64_t exClass,
void *_Nonnull ex,
void *_Nonnull ctx);
691 extern id _Nullable objc_retain(
id _Nullable
object);
692 extern id _Nullable objc_retainBlock(
id _Nullable block);
693 extern id _Nullable objc_retainAutorelease(
id _Nullable
object);
694 extern void objc_release(
id _Nullable
object);
695 extern id _Nullable objc_autorelease(
id _Nullable
object);
696 extern id _Nullable objc_autoreleaseReturnValue(
id _Nullable
object);
697 extern id _Nullable objc_retainAutoreleaseReturnValue(
id _Nullable
object);
698 extern id _Nullable objc_retainAutoreleasedReturnValue(
id _Nullable
object);
699 extern id _Nullable objc_storeStrong(
id _Nullable *_Nonnull
object,
701 extern id _Nullable objc_storeWeak(
id _Nullable *_Nonnull
object,
703 extern id _Nullable objc_loadWeakRetained(
id _Nullable *_Nonnull
object);
704 extern _Nullable
id objc_initWeak(
id _Nullable *_Nonnull
object,
706 extern void objc_destroyWeak(
id _Nullable *_Nonnull
object);
707 extern id _Nullable objc_loadWeak(
id _Nullable *_Nonnull
object);
708 extern void objc_copyWeak(
id _Nullable *_Nonnull dest,
709 id _Nullable *_Nonnull src);
710 extern void objc_moveWeak(
id _Nullable *_Nonnull dest,
711 id _Nullable *_Nonnull src);
struct objc_object * id
A pointer to any object.
Definition: ObjFWRT.h:90
const char *_Nullable object_getClassName(id _Nullable object)
Returns the object's class name.
void objc_setEnumerationMutationHandler(objc_enumeration_mutation_handler_t _Nullable handler)
Sets the handler for mutations during enumeration.
bool class_respondsToSelector(Class _Nullable class_, SEL _Nonnull selector)
Returns whether the specified class responds to the specified selector.
const struct objc_property * objc_property_t
A property.
Definition: ObjFWRT.h:124
Class _Nonnull objc_allocateClassPair(Class _Nullable superclass, const char *_Nonnull name, size_t extraBytes)
Allocates a new class and its metaclass.
ptrdiff_t ivar_getOffset(Ivar _Nonnull ivar)
Returns the offset of the specified instance variable.
SEL _Nonnull method_getName(Method _Nonnull method)
Returns the name of the specified method.
id _Nullable(* IMP)(id _Nonnull object, SEL _Nonnull selector,...)
A method implemenation.
Definition: ObjFWRT.h:142
void(* objc_enumeration_mutation_handler_t)(id _Nonnull object)
A handler for mutation during enumeration.
Definition: ObjFWRT.h:156
id _Nullable objc_constructInstance(Class _Nullable class_, void *_Nullable bytes)
Constructs an instance of the specified class in the specified array of bytes.
void *_Null_unspecified objc_autoreleasePoolPush(void)
Creates a new autorelease pool and puts it on top of the stack of autorelease pools.
Definition: autorelease.m:61
bool class_isMetaClass(Class _Nullable class_)
Returns whether the specified class is a metaclass.
int objc_registerTaggedPointerClass(Class _Nonnull class)
Registers a class for tagged pointers.
_Nullable objc_uncaught_exception_handler_t objc_setUncaughtExceptionHandler(objc_uncaught_exception_handler_t _Nullable handler)
Sets the handler for uncaught exceptions.
bool object_isTaggedPointer(id _Nullable object)
Returns whether the specified object is a tagged pointer.
Method _Nullable class_getInstanceMethod(Class _Nullable class_, SEL _Nonnull selector)
Returns the class's instance method for the specified selector.
objc_property_t _Nullable *_Nullable class_copyPropertyList(Class _Nullable class_, unsigned int *_Nullable outCount)
Copies the property list of the specified class.
bool protocol_conformsToProtocol(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2)
Returns whether the first protocol conforms to the second protocol.
void objc_setTaggedPointerSecret(uintptr_t secret)
Sets the tagged pointer secret.
Definition: tagged-pointer.m:28
const struct objc_ivar * Ivar
An instance variable.
Definition: ObjFWRT.h:119
unsigned int objc_getClassList(Class _Nonnull *_Nullable buffer, unsigned int count)
Gets the list of all classes known to the runtime.
void(* objc_uncaught_exception_handler_t)(id _Nullable exception)
A handler for uncaught exceptions.
Definition: ObjFWRT.h:149
Class _Nullable object_setClass(id _Nullable object, Class _Nonnull class_)
Sets the object's class.
uintptr_t object_getTaggedPointerValue(id _Nonnull object)
Returns the value of the specified tagged pointer.
struct objc_class * Class
A pointer to a class.
Definition: ObjFWRT.h:85
IMP _Nullable class_getMethodImplementation_stret(Class _Nullable class_, SEL _Nonnull selector)
Returns the class's method implementation for the specified selector.
Class _Nullable object_getClass(id _Nullable object)
Returns the object's class.
const char *_Nullable method_getTypeEncoding(Method _Nonnull method)
Returns the type encoding of the specified method.
IMP _Nullable class_getMethodImplementation(Class _Nullable class_, SEL _Nonnull selector)
Returns the class's method implementation for the specified selector.
void *_Nullable objc_destructInstance(id _Nullable object)
Destructs the specified object.
id _Nullable _objc_rootAutorelease(id _Nullable object)
Adds the specified object to the topmost autorelease pool.
id _Nullable objc_createTaggedPointer(int class, uintptr_t value)
Creates a new tagged pointer.
Definition: tagged-pointer.m:86
bool sel_isEqual(SEL _Nonnull selector1, SEL _Nonnull selector2)
Checks two selectors for equality.
IMP _Nullable class_replaceMethod(Class _Nonnull class_, SEL _Nonnull selector, IMP _Nonnull implementation, const char *_Nullable typeEncoding)
Replaces or adds the specified method of the class.
bool class_conformsToProtocol(Class _Nullable class_, Protocol *_Nonnull protocol)
Returns whether the specified class conforms to the specified protocol.
bool class_addMethod(Class _Nonnull class_, SEL _Nonnull selector, IMP _Nonnull implementation, const char *_Nullable typeEncoding)
Adds the specified method to the class.
char *_Nullable property_copyAttributeValue(objc_property_t _Nonnull property, const char *_Nonnull name)
Copies the specified attribute value.
bool BOOL
An Objective-C boolean. Either YES or NO.
Definition: ObjFWRT.h:133
void objc_registerClassPair(Class _Nonnull class_)
Registers an already allocated class pair.
const char *_Nonnull protocol_getName(Protocol *_Nonnull protocol)
Returns the name of the specified protocol.
const struct objc_method * Method
A method.
Definition: ObjFWRT.h:105
SEL _Nonnull sel_registerName(const char *_Nonnull name)
Registers a selector with the specified name with the runtime.
void objc_exit(void)
Exits the Objective-C runtime.
Definition: init.m:35
void objc_autoreleasePoolPop(void *_Null_unspecified pool)
Drains the specified autorelease pool and all pools on top of it and removes it from the stack of aut...
const struct objc_selector * SEL
A selector.
Definition: ObjFWRT.h:98
unsigned long class_getInstanceSize(Class _Nullable class_)
Returns the instance size of the specified class.
const char *_Nullable class_getName(Class _Nullable class_)
Returns the name of the specified class.
bool protocol_isEqual(Protocol *_Nonnull protocol1, Protocol *_Nonnull protocol2)
Returns whether two protocols are equal.
Class _Nullable class_getSuperclass(Class _Nullable class_)
Returns the superclass of the specified class.
Class _Nonnull *_Nonnull objc_copyClassList(unsigned int *_Nullable length)
Copies the list of all classes known to the runtime.
Method _Nullable *_Nullable class_copyMethodList(Class _Nullable class_, unsigned int *_Nullable outCount)
Copies the method list of the specified class.
const struct objc_protocol * Protocol
A protocol.
Definition: ObjFWRT.h:113
const char *_Nonnull ivar_getName(Ivar _Nonnull ivar)
Returns the name of the specified instance variable.
const char *_Nonnull property_getName(objc_property_t _Nonnull property)
Returns the name of the specified property.
const char *_Nonnull ivar_getTypeEncoding(Ivar _Nonnull ivar)
Returns the type encoding of the specified instance variable.
Ivar _Nullable *_Nullable class_copyIvarList(Class _Nullable class_, unsigned int *_Nullable outCount)
Copies the instance variable list of the specified class.
void objc_setForwardHandler(IMP _Nullable forward, IMP _Nullable stretForward)
Sets the forwarding handler for unimplemented methods.
const char *_Nonnull sel_getName(SEL _Nonnull selector)
Returns the name of the specified selector.
A struct representing a call to super.
Definition: ObjFWRT.h:161