Commit d8a55d09 by Richard Kenner

(_objc_load_callback): Add declaration.

(__objc_exec_class): Call _objc_load_callback after every Class or Category
is added.

From-SVN: r9592
parent 1125706f
...@@ -48,6 +48,12 @@ static void __objc_init_protocols (struct objc_protocol_list* protos); ...@@ -48,6 +48,12 @@ static void __objc_init_protocols (struct objc_protocol_list* protos);
/* Add protocol to class */ /* Add protocol to class */
static void __objc_class_add_protocols (Class, struct objc_protocol_list*); static void __objc_class_add_protocols (Class, struct objc_protocol_list*);
/* This is a hook which is called by __objc_exec_class every time a class
or a category is loaded into the runtime. This may e.g. help a
dynamic loader determine the classes that have been loaded when
an object file is dynamically linked in */
void (*_objc_load_callback)(Class class, Category* category) = 0;
/* Is all categories/classes resolved? */ /* Is all categories/classes resolved? */
BOOL __objc_dangling_categories = NO; BOOL __objc_dangling_categories = NO;
...@@ -190,6 +196,9 @@ __objc_exec_class (Module_t module) ...@@ -190,6 +196,9 @@ __objc_exec_class (Module_t module)
if (class->protocols) if (class->protocols)
__objc_init_protocols (class->protocols); __objc_init_protocols (class->protocols);
if (_objc_load_callback)
_objc_load_callback(class, 0);
} }
/* Process category information from the module. */ /* Process category information from the module. */
...@@ -221,6 +230,8 @@ __objc_exec_class (Module_t module) ...@@ -221,6 +230,8 @@ __objc_exec_class (Module_t module)
__objc_class_add_protocols (class, category->protocols); __objc_class_add_protocols (class, category->protocols);
} }
if (_objc_load_callback)
_objc_load_callback(class, category);
} }
else else
{ {
...@@ -264,6 +275,8 @@ __objc_exec_class (Module_t module) ...@@ -264,6 +275,8 @@ __objc_exec_class (Module_t module)
__objc_class_add_protocols (class, category->protocols); __objc_class_add_protocols (class, category->protocols);
} }
if (_objc_load_callback)
_objc_load_callback(class, category);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment