+struct old_class_ext {
+ uint32_t size;
+ const uint8_t *weak_ivar_layout;
+ struct old_property_list **propertyLists;
+};
+
+struct old_category {
+ char *category_name;
+ char *class_name;
+ struct old_method_list *instance_methods;
+ struct old_method_list *class_methods;
+ struct old_protocol_list *protocols;
+ // Fields below this point are in version 7 or later only.
+ uint32_t size;
+ struct old_property_list *instance_properties;
+ // Check size for fields below this point.
+ struct old_property_list *class_properties;
+
+ bool hasClassPropertiesField() const {
+ return size >= offsetof(old_category, class_properties) + sizeof(class_properties);
+ }
+};
+
+struct old_ivar {
+ char *ivar_name;
+ char *ivar_type;
+ int ivar_offset;
+#ifdef __LP64__
+ int space;
+#endif
+};
+
+struct old_ivar_list {
+ int ivar_count;
+#ifdef __LP64__
+ int space;
+#endif
+ /* variable length structure */
+ struct old_ivar ivar_list[1];
+};
+
+
+struct old_method {
+ SEL method_name;
+ char *method_types;
+ IMP method_imp;
+};
+
+struct old_method_list {
+ void *obsolete;
+
+ int method_count;
+#ifdef __LP64__
+ int space;
+#endif
+ /* variable length structure */
+ struct old_method method_list[1];
+};
+
+struct old_protocol {
+ Class isa;
+ const char *protocol_name;
+ struct old_protocol_list *protocol_list;
+ struct objc_method_description_list *instance_methods;
+ struct objc_method_description_list *class_methods;
+};
+
+struct old_protocol_list {
+ struct old_protocol_list *next;
+ long count;
+ struct old_protocol *list[1];
+};
+
+struct old_protocol_ext {
+ uint32_t size;
+ struct objc_method_description_list *optional_instance_methods;
+ struct objc_method_description_list *optional_class_methods;
+ struct old_property_list *instance_properties;
+ const char **extendedMethodTypes;
+ struct old_property_list *class_properties;
+
+ bool hasClassPropertiesField() const {
+ return size >= offsetof(old_protocol_ext, class_properties) + sizeof(class_properties);
+ }
+};
+
+
+struct old_property {
+ const char *name;
+ const char *attributes;
+};
+
+struct old_property_list {
+ uint32_t entsize;
+ uint32_t count;
+ struct old_property first;
+};
+
+