ObjFW  Diff

Differences From Artifact [eb0edb48c5]:

To Artifact [bd61ad8aad]:


35
36
37
38
39
40
41





42
43
44
45
46
47

48
49
50
51
52
53
54
#endif

#if __has_attribute(objc_root_class)
# define OBJC_ROOT_CLASS __attribute__((objc_root_class))
#else
# define OBJC_ROOT_CLASS
#endif






typedef struct objc_class* Class;
typedef struct objc_object* id;
typedef const struct objc_selector* SEL;
typedef signed char BOOL;
typedef id (*IMP)(id, SEL, ...);


struct objc_class {
	Class isa;
	Class superclass;
	const char *name;
	unsigned long version;
	unsigned long info;







>
>
>
>
>






>







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#endif

#if __has_attribute(objc_root_class)
# define OBJC_ROOT_CLASS __attribute__((objc_root_class))
#else
# define OBJC_ROOT_CLASS
#endif

#define Nil (Class)0
#define nil (id)0
#define YES (BOOL)1
#define NO  (BOOL)0

typedef struct objc_class* Class;
typedef struct objc_object* id;
typedef const struct objc_selector* SEL;
typedef signed char BOOL;
typedef id (*IMP)(id, SEL, ...);
typedef void (*objc_uncaught_exception_handler)(id);

struct objc_class {
	Class isa;
	Class superclass;
	const char *name;
	unsigned long version;
	unsigned long info;
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

122
123
124
125
126
127
128
129

130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
	struct objc_method_list *class_methods;
	struct objc_protocol_list *protocols;
};

struct objc_ivar {
	const char *name;
	const char *type;
	unsigned offset;
};

struct objc_ivar_list {
	unsigned count;
	struct objc_ivar ivars[1];
};


#define OBJC_PROPERTY_READONLY	0x01
#define OBJC_PROPERTY_GETTER	0x02
#define OBJC_PROPERTY_ASSIGN	0x04
#define OBJC_PROPERTY_READWRITE	0x08
#define OBJC_PROPERTY_RETAIN	0x10
#define OBJC_PROPERTY_COPY	0x20
#define OBJC_PROPERTY_NONATOMIC	0x40
#define OBJC_PROPERTY_SETTER	0x80


struct objc_property {
	const char *name;
	unsigned char attributes;
	BOOL synthesized;
	struct {
		const char *name;
		const char *type;
	} getter, setter;
};

struct objc_property_list {
	unsigned count;
	struct objc_property_list *next;
	struct objc_property properties[1];
};

#ifdef __OBJC__
OBJC_ROOT_CLASS
@interface Protocol







|



|



>
|
|
|
|
|
|
|
|
>












|







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
	struct objc_method_list *class_methods;
	struct objc_protocol_list *protocols;
};

struct objc_ivar {
	const char *name;
	const char *type;
	unsigned int offset;
};

struct objc_ivar_list {
	unsigned int count;
	struct objc_ivar ivars[1];
};

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
};

struct objc_property {
	const char *name;
	unsigned char attributes;
	BOOL synthesized;
	struct {
		const char *name;
		const char *type;
	} getter, setter;
};

struct objc_property_list {
	unsigned int count;
	struct objc_property_list *next;
	struct objc_property properties[1];
};

#ifdef __OBJC__
OBJC_ROOT_CLASS
@interface Protocol
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219





220
221
222
223
224
225
226
227

struct objc_protocol_list {
	struct objc_protocol_list *next;
	long count;
	OBJC_UNSAFE_UNRETAINED Protocol *list[1];
};

#define Nil (Class)0
#define nil (id)0
#define YES (BOOL)1
#define NO  (BOOL)0

typedef void (*objc_uncaught_exception_handler)(id);

#ifdef __cplusplus
extern "C" {
#endif
extern SEL sel_registerName(const char*);
extern const char* sel_getName(SEL);
extern bool sel_isEqual(SEL, SEL);
extern id objc_lookUpClass(const char*);
extern id objc_getClass(const char*);
extern id objc_getRequiredClass(const char*);
extern unsigned int objc_getClassList(Class*, unsigned int);
extern Class* objc_copyClassList(unsigned int*);
extern bool class_isMetaClass(Class);
extern const char* class_getName(Class);
extern Class class_getSuperclass(Class);
extern bool class_isKindOfClass(Class, Class);
extern unsigned long class_getInstanceSize(Class);
extern bool class_respondsToSelector(Class, SEL);
extern bool class_conformsToProtocol(Class, Protocol*);
extern IMP class_getMethodImplementation(Class, SEL);

extern IMP class_replaceMethod(Class, SEL, IMP, const char*);
extern const char* objc_get_type_encoding(Class, SEL);
extern Class object_getClass(id);
extern Class object_setClass(id, Class);
extern const char* object_getClassName(id);
extern IMP objc_msg_lookup(id, SEL);
extern IMP objc_msg_lookup_stret(id, SEL);
extern IMP objc_msg_lookup_super(struct objc_super*, SEL);
extern IMP objc_msg_lookup_super_stret(struct objc_super*, SEL);
extern const char* protocol_getName(Protocol*);
extern bool protocol_isEqual(Protocol*, Protocol*);
extern bool protocol_conformsToProtocol(Protocol*, Protocol*);
extern void objc_exit(void);
extern objc_uncaught_exception_handler objc_setUncaughtExceptionHandler(
    objc_uncaught_exception_handler);
extern IMP (*objc_forward_handler)(id, SEL);
extern IMP (*objc_forward_handler_stret)(id, SEL);
extern id objc_autorelease(id);
extern void* objc_autoreleasePoolPush(void);
extern void objc_autoreleasePoolPop(void*);
extern id _objc_rootAutorelease(id);





#ifdef __cplusplus
}
#endif

#undef OBJC_UNSAFE_UNRETAINED
#undef OBJC_ROOT_CLASS

#endif







<
<
<
<
<
<
<



















>

<



<
<
<
<












>
>
>
>
>








174
175
176
177
178
179
180







181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201

202
203
204




205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229

struct objc_protocol_list {
	struct objc_protocol_list *next;
	long count;
	OBJC_UNSAFE_UNRETAINED Protocol *list[1];
};








#ifdef __cplusplus
extern "C" {
#endif
extern SEL sel_registerName(const char*);
extern const char* sel_getName(SEL);
extern bool sel_isEqual(SEL, SEL);
extern id objc_lookUpClass(const char*);
extern id objc_getClass(const char*);
extern id objc_getRequiredClass(const char*);
extern unsigned int objc_getClassList(Class*, unsigned int);
extern Class* objc_copyClassList(unsigned int*);
extern bool class_isMetaClass(Class);
extern const char* class_getName(Class);
extern Class class_getSuperclass(Class);
extern bool class_isKindOfClass(Class, Class);
extern unsigned long class_getInstanceSize(Class);
extern bool class_respondsToSelector(Class, SEL);
extern bool class_conformsToProtocol(Class, Protocol*);
extern IMP class_getMethodImplementation(Class, SEL);
extern const char* class_getMethodTypeEncoding(Class, SEL);
extern IMP class_replaceMethod(Class, SEL, IMP, const char*);

extern Class object_getClass(id);
extern Class object_setClass(id, Class);
extern const char* object_getClassName(id);




extern const char* protocol_getName(Protocol*);
extern bool protocol_isEqual(Protocol*, Protocol*);
extern bool protocol_conformsToProtocol(Protocol*, Protocol*);
extern void objc_exit(void);
extern objc_uncaught_exception_handler objc_setUncaughtExceptionHandler(
    objc_uncaught_exception_handler);
extern IMP (*objc_forward_handler)(id, SEL);
extern IMP (*objc_forward_handler_stret)(id, SEL);
extern id objc_autorelease(id);
extern void* objc_autoreleasePoolPush(void);
extern void objc_autoreleasePoolPop(void*);
extern id _objc_rootAutorelease(id);
/* Used by the compiler, but can be called manually. */
extern IMP objc_msg_lookup(id, SEL);
extern IMP objc_msg_lookup_stret(id, SEL);
extern IMP objc_msg_lookup_super(struct objc_super*, SEL);
extern IMP objc_msg_lookup_super_stret(struct objc_super*, SEL);
#ifdef __cplusplus
}
#endif

#undef OBJC_UNSAFE_UNRETAINED
#undef OBJC_ROOT_CLASS

#endif