From d0b9848c54e6f85ab713f059dcd1ddef7e57caa6 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Tue, 25 Oct 2022 20:30:28 +0100 Subject: a bunch of compiler stuff --- includes/compiler/objc.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 includes/compiler/objc.h (limited to 'includes/compiler/objc.h') diff --git a/includes/compiler/objc.h b/includes/compiler/objc.h new file mode 100644 index 0000000..ce3ebe4 --- /dev/null +++ b/includes/compiler/objc.h @@ -0,0 +1,80 @@ +#ifndef COMPILER_OBJC_H +#define COMPILER_OBJC_H + +#include "compiler/common.h" + +#ifdef __MWERKS__ +#pragma options align=mac68k +#endif + +typedef struct ObjCMethodArg { // bigger in v7 (0x20 vs 0x14) + struct ObjCMethodArg *next; + HashNameNode *selector; + HashNameNode *name; + Type *type; + UInt32 qual; + UInt32 unk14; + UInt32 unk18; + UInt32 unk1C; +} ObjCMethodArg; + +typedef struct ObjCMethodList { // verified via CPrec + struct ObjCMethodList *next; + struct ObjCMethod *method; +} ObjCMethodList; + +typedef struct ObjCSelector { // verified via CPrec + struct ObjCSelector *next; + Object *selobject; + HashNameNode *name; + struct ObjCMethodList *methods; +} ObjCSelector; + +typedef struct ObjCMethod { // verified via CPrec + struct ObjCMethod *next; + Object *object; + TypeFunc *functype; + ObjCSelector *selector; + Type *return_type; + UInt32 return_qual; + ObjCMethodArg *selector_args; + Boolean has_valist; + Boolean is_class_method; + Boolean is_defined; +} ObjCMethod; + +typedef struct ObjCProtocol { // verified via CPrec + struct ObjCProtocol *next; + HashNameNode *name; + struct ObjCProtocolList *protocols; + ObjCMethod *methods; + Object *object; +} ObjCProtocol; + +typedef struct ObjCProtocolList { // verified via CPrec + struct ObjCProtocolList *next; + ObjCProtocol *protocol; +} ObjCProtocolList; + +typedef struct ObjCCategory { // verified via CPrec + struct ObjCCategory *next; + HashNameNode *name; + ObjCProtocolList *protocols; + ObjCMethod *methods; +} ObjCCategory; + +struct ObjCInfo { // verified via CPrec + Object *classobject; + Object *metaobject; + Object *classrefobj; + ObjCMethod *methods; + ObjCProtocolList *protocols; + ObjCCategory *categories; + Boolean is_implemented; +}; + +#ifdef __MWERKS__ +#pragma options align=reset +#endif + +#endif -- cgit v1.2.3