177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
unsigned long unknown;
struct objc_selector *_Nullable selectorRefs;
uint16_t classDefsCount;
uint16_t categoryDefsCount;
void *_Nonnull defs[1];
};
struct objc_module {
unsigned long version; /* 9 = non-fragile */
unsigned long size;
const char *_Nullable name;
struct objc_symtab *_Nonnull symtab;
};
struct objc_hashtable_bucket {
|
|
|
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
unsigned long unknown;
struct objc_selector *_Nullable selectorRefs;
uint16_t classDefsCount;
uint16_t categoryDefsCount;
void *_Nonnull defs[1];
};
struct _objc_module {
unsigned long version; /* 9 = non-fragile */
unsigned long size;
const char *_Nullable name;
struct objc_symtab *_Nonnull symtab;
};
struct objc_hashtable_bucket {
|
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
|
} *_Nonnull buckets[256];
#else
IMP _Nullable buckets[256];
#endif
} *_Nonnull buckets[256];
};
extern void objc_registerAllCategories(struct objc_symtab *_Nonnull);
extern struct objc_category *_Nullable *_Nullable
objc_categoriesForClass(Class _Nonnull);
extern void objc_unregisterAllCategories(void);
extern void objc_initializeClass(Class _Nonnull);
extern void objc_updateDTable(Class _Nonnull);
extern void objc_registerAllClasses(struct objc_symtab *_Nonnull);
extern Class _Nullable objc_classnameToClass(const char *_Nonnull, bool);
extern void objc_unregisterClass(Class _Nonnull);
extern void objc_unregisterAllClasses(void);
extern uint32_t objc_string_hash(const void *_Nonnull);
extern bool objc_string_equal(const void *_Nonnull, const void *_Nonnull);
extern struct objc_hashtable *_Nonnull objc_hashtable_new(
objc_hashtable_hash_func, objc_hashtable_equal_func, uint32_t);
extern struct objc_hashtable_bucket objc_deletedBucket;
extern void objc_hashtable_set(struct objc_hashtable *_Nonnull,
const void *_Nonnull, const void *_Nonnull);
extern void *_Nullable objc_hashtable_get(struct objc_hashtable *_Nonnull,
const void *_Nonnull);
extern void objc_hashtable_delete(struct objc_hashtable *_Nonnull,
const void *_Nonnull);
extern void objc_hashtable_free(struct objc_hashtable *_Nonnull);
extern void objc_registerSelector(struct objc_selector *_Nonnull);
extern void objc_registerAllSelectors(struct objc_symtab *_Nonnull);
extern void objc_unregisterAllSelectors(void);
extern struct objc_sparsearray *_Nonnull objc_sparsearray_new(uint8_t);
extern void *_Nullable objc_sparsearray_get(struct objc_sparsearray *_Nonnull,
uintptr_t);
extern void objc_sparsearray_set(struct objc_sparsearray *_Nonnull, uintptr_t,
void *_Nullable);
extern void objc_sparsearray_free(struct objc_sparsearray *_Nonnull);
extern struct objc_dtable *_Nonnull objc_dtable_new(void);
extern void objc_dtable_copy(struct objc_dtable *_Nonnull,
struct objc_dtable *_Nonnull);
extern void objc_dtable_set(struct objc_dtable *_Nonnull, uint32_t,
IMP _Nullable);
extern void objc_dtable_free(struct objc_dtable *_Nonnull);
extern void objc_dtable_cleanup(void);
extern void objc_initStaticInstances(struct objc_symtab *_Nonnull);
extern void objc_forgetPendingStaticInstances(void);
extern void objc_zeroWeakReferences(id _Nonnull);
extern Class _Nullable object_getTaggedPointerClass(id _Nonnull);
#ifdef OF_HAVE_THREADS
extern void objc_globalMutex_lock(void);
extern void objc_globalMutex_unlock(void);
extern void objc_globalMutex_free(void);
#else
# define objc_globalMutex_lock()
# define objc_globalMutex_unlock()
# define objc_globalMutex_free()
#endif
extern char *_Nullable objc_strdup(const char *_Nonnull string);
static inline IMP _Nullable
objc_dtable_get(const struct objc_dtable *_Nonnull dtable, uint32_t idx)
{
#ifdef OF_SELUID24
uint8_t i = idx >> 16;
uint8_t j = idx >> 8;
uint8_t k = idx;
return dtable->buckets[i]->buckets[j]->buckets[k];
#else
uint8_t i = idx >> 8;
uint8_t j = idx;
return dtable->buckets[i]->buckets[j];
#endif
}
extern void OF_NO_RETURN_FUNC objc_error(const char *_Nonnull title,
const char *_Nonnull format, ...);
#define OBJC_ERROR(...) \
objc_error("ObjFWRT @ " __FILE__ ":" OF_STRINGIFY(__LINE__), \
__VA_ARGS__)
#if defined(OF_ELF)
# if defined(OF_AMD64) || defined(OF_X86) || \
defined(OF_POWERPC64) || defined(OF_POWERPC) || \
|
|
>
|
|
|
|
|
>
|
>
|
|
|
|
>
|
>
|
|
|
|
|
>
|
>
|
>
|
|
>
|
|
|
>
|
|
|
|
|
|
>
|
|
|
>
|
|
|
|
>
|
|
|
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
} *_Nonnull buckets[256];
#else
IMP _Nullable buckets[256];
#endif
} *_Nonnull buckets[256];
};
extern void objc_registerAllCategories(struct objc_symtab *_Nonnull)
OF_VISIBILITY_HIDDEN;
extern struct objc_category *_Nullable *_Nullable
objc_categoriesForClass(Class _Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_unregisterAllCategories(void) OF_VISIBILITY_HIDDEN;
extern void objc_initializeClass(Class _Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_updateDTable(Class _Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_registerAllClasses(struct objc_symtab *_Nonnull)
OF_VISIBILITY_HIDDEN;
extern Class _Nullable objc_classnameToClass(const char *_Nonnull, bool)
OF_VISIBILITY_HIDDEN;
extern void objc_unregisterClass(Class _Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_unregisterAllClasses(void) OF_VISIBILITY_HIDDEN;
extern uint32_t objc_string_hash(const void *_Nonnull) OF_VISIBILITY_HIDDEN;
extern bool objc_string_equal(const void *_Nonnull, const void *_Nonnull)
OF_VISIBILITY_HIDDEN;
extern struct objc_hashtable *_Nonnull objc_hashtable_new(
objc_hashtable_hash_func, objc_hashtable_equal_func, uint32_t)
OF_VISIBILITY_HIDDEN;
extern struct objc_hashtable_bucket objc_deletedBucket OF_VISIBILITY_HIDDEN;
extern void objc_hashtable_set(struct objc_hashtable *_Nonnull,
const void *_Nonnull, const void *_Nonnull) OF_VISIBILITY_HIDDEN;
extern void *_Nullable objc_hashtable_get(struct objc_hashtable *_Nonnull,
const void *_Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_hashtable_delete(struct objc_hashtable *_Nonnull,
const void *_Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_hashtable_free(struct objc_hashtable *_Nonnull)
OF_VISIBILITY_HIDDEN;
extern void objc_registerSelector(struct objc_selector *_Nonnull)
OF_VISIBILITY_HIDDEN;
extern void objc_registerAllSelectors(struct objc_symtab *_Nonnull)
OF_VISIBILITY_HIDDEN;
extern void objc_unregisterAllSelectors(void) OF_VISIBILITY_HIDDEN;
extern struct objc_sparsearray *_Nonnull objc_sparsearray_new(uint8_t)
OF_VISIBILITY_HIDDEN;
extern void *_Nullable objc_sparsearray_get(struct objc_sparsearray *_Nonnull,
uintptr_t) OF_VISIBILITY_HIDDEN;
extern void objc_sparsearray_set(struct objc_sparsearray *_Nonnull, uintptr_t,
void *_Nullable) OF_VISIBILITY_HIDDEN;
extern void objc_sparsearray_free(struct objc_sparsearray *_Nonnull)
OF_VISIBILITY_HIDDEN;
extern struct objc_dtable *_Nonnull objc_dtable_new(void) OF_VISIBILITY_HIDDEN;
extern void objc_dtable_copy(struct objc_dtable *_Nonnull,
struct objc_dtable *_Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_dtable_set(struct objc_dtable *_Nonnull, uint32_t,
IMP _Nullable) OF_VISIBILITY_HIDDEN;
extern void objc_dtable_free(struct objc_dtable *_Nonnull) OF_VISIBILITY_HIDDEN;
extern void objc_dtable_cleanup(void) OF_VISIBILITY_HIDDEN;
extern void objc_initStaticInstances(struct objc_symtab *_Nonnull)
OF_VISIBILITY_HIDDEN;
extern void objc_forgetPendingStaticInstances(void) OF_VISIBILITY_HIDDEN;
extern void objc_zeroWeakReferences(id _Nonnull) OF_VISIBILITY_HIDDEN;
extern Class _Nullable object_getTaggedPointerClass(id _Nonnull)
OF_VISIBILITY_HIDDEN;
#ifdef OF_HAVE_THREADS
extern void objc_globalMutex_lock(void) OF_VISIBILITY_HIDDEN;
extern void objc_globalMutex_unlock(void) OF_VISIBILITY_HIDDEN;
extern void objc_globalMutex_free(void) OF_VISIBILITY_HIDDEN;
#else
# define objc_globalMutex_lock()
# define objc_globalMutex_unlock()
# define objc_globalMutex_free()
#endif
extern char *_Nullable objc_strdup(const char *_Nonnull string)
OF_VISIBILITY_HIDDEN;
static OF_INLINE IMP _Nullable
objc_dtable_get(const struct objc_dtable *_Nonnull dtable, uint32_t idx)
{
#ifdef OF_SELUID24
uint8_t i = idx >> 16;
uint8_t j = idx >> 8;
uint8_t k = idx;
return dtable->buckets[i]->buckets[j]->buckets[k];
#else
uint8_t i = idx >> 8;
uint8_t j = idx;
return dtable->buckets[i]->buckets[j];
#endif
}
extern void OF_NO_RETURN_FUNC objc_error(const char *_Nonnull title,
const char *_Nonnull format, ...) OF_VISIBILITY_HIDDEN;
#define OBJC_ERROR(...) \
objc_error("ObjFWRT @ " __FILE__ ":" OF_STRINGIFY(__LINE__), \
__VA_ARGS__)
#if defined(OF_ELF)
# if defined(OF_AMD64) || defined(OF_X86) || \
defined(OF_POWERPC64) || defined(OF_POWERPC) || \
|