@@ -61,10 +61,11 @@ typedef struct objc_class *Class; typedef struct objc_object *id; typedef const struct objc_selector *SEL; typedef const struct objc_method *Method; typedef const struct objc_ivar *Ivar; +typedef const struct objc_property *objc_property_t; #if !defined(__wii__) && !defined(__amigaos__) typedef bool BOOL; #endif typedef id _Nullable (*IMP)(id _Nonnull, SEL _Nonnull, ...); typedef void (*objc_uncaught_exception_handler_t)(id _Nullable); @@ -84,11 +85,11 @@ void *_Nullable siblingClass; struct objc_protocol_list *_Nullable protocols; void *_Nullable GCObjectType; unsigned long ABIVersion; int32_t *_Nonnull *_Nullable ivarOffsets; - struct objc_property_list *_Nullable properties; + struct objc_property_list *_Nullable propertyList; }; enum objc_class_info { OBJC_CLASS_INFO_CLASS = 0x001, OBJC_CLASS_INFO_METACLASS = 0x002, @@ -106,46 +107,10 @@ #else Class _Nonnull class; #endif }; -enum objc_property_attributes { - OBJC_PROPERTY_READONLY = 0x01, - OBJC_PROPERTY_GETTER = 0x02, - OBJC_PROPERTY_ASSIGN = 0x04, - OBJC_PROPERTY_READWRITE = 0x08, - OBJC_PROPERTY_RETAIN = 0x10, - OBJC_PROPERTY_COPY = 0x20, - OBJC_PROPERTY_NONATOMIC = 0x40, - OBJC_PROPERTY_SETTER = 0x80 -}; - -enum objc_property_extended_attributes { - OBJC_PROPERTY_SYNTHESIZE = 0x1, - OBJC_PROPERTY_DYNAMIC = 0x2, - OBJC_PROPERTY_PROTOCOL = 0x3, - OBJC_PROPERTY_ATOMIC = 0x4, - OBJC_PROPERTY_WEAK = 0x8, - OBJC_PROPERTY_STRONG = 0x10, - OBJC_PROPERTY_UNSAFE_UNRETAINED = 0x20 -}; - -struct objc_property { - const char *_Nonnull name; - unsigned char attributes, extendedAttributes; - struct { - const char *_Nullable name; - const char *_Nullable typeEncoding; - } getter, setter; -}; - -struct objc_property_list { - unsigned int count; - struct objc_property_list *_Nullable next; - struct objc_property properties[1]; -}; - struct objc_method_description { const char *_Nonnull name; const char *_Nonnull typeEncoding; }; @@ -230,10 +195,15 @@ extern Ivar _Nullable *_Nullable class_copyIvarList(Class _Nullable class_, unsigned int *_Nullable outCount); extern const char *_Nonnull ivar_getName(Ivar _Nonnull ivar); extern const char *_Nonnull ivar_getTypeEncoding(Ivar _Nonnull ivar); extern ptrdiff_t ivar_getOffset(Ivar _Nonnull ivar); +extern objc_property_t _Nullable *_Nullable class_copyPropertyList( + Class _Nullable class_, unsigned int *_Nullable outCount); +extern const char *_Nonnull property_getName(objc_property_t _Nonnull property); +extern char *_Nullable property_copyAttributeValue( + objc_property_t _Nonnull property, const char *_Nonnull name); extern void objc_exit(void); extern _Nullable objc_uncaught_exception_handler_t objc_setUncaughtExceptionHandler( objc_uncaught_exception_handler_t _Nullable handler); extern void objc_setForwardHandler(IMP _Nullable forward,