In libobjc/: 2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>

In libobjc/:
2010-12-19  Nicola Pero  <nicola.pero@meta-innovation.com>

	* init.c: Updated comments.
	* objc/objc-api.h: Updated comments.
	* objc/runtime.h (_objc_load_callback): Declare.

From-SVN: r168044
This commit is contained in:
Nicola Pero 2010-12-19 02:12:42 +00:00 committed by Nicola Pero
parent c34fc9884e
commit 120d5f8ea4
4 changed files with 37 additions and 18 deletions

View File

@ -1,3 +1,9 @@
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
* init.c: Updated comments.
* objc/objc-api.h: Updated comments.
* objc/runtime.h (_objc_load_callback): Declare.
2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com> 2010-12-19 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/Object.h: Include deprecated/typedstream.h and * objc/Object.h: Include deprecated/typedstream.h and

View File

@ -83,11 +83,7 @@ static void __objc_init_protocol (struct objc_protocol *protocol);
/* 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 /* Load callback hook. */
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. */
/* TODO: This needs to be declared in a public file with the new API. */
void (*_objc_load_callback) (Class class, struct objc_category *category); /* !T:SAFE */ void (*_objc_load_callback) (Class class, struct objc_category *category); /* !T:SAFE */
/* Are all categories/classes resolved? */ /* Are all categories/classes resolved? */
@ -724,6 +720,10 @@ __objc_exec_class (struct objc_module *module)
objc_send_load (); objc_send_load ();
objc_mutex_unlock (__objc_runtime_mutex); objc_mutex_unlock (__objc_runtime_mutex);
/* TODO: Do we need to add a call to __objc_resolve_class_links()
here ? gnustep-base does it manually after it loads a module.
Shouldn't we do it automatically ? */
} }
static void static void

View File

@ -26,25 +26,28 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifndef __objc_api_INCLUDE_GNU #ifndef __objc_api_INCLUDE_GNU
#define __objc_api_INCLUDE_GNU #define __objc_api_INCLUDE_GNU
/* /* This file declares the "traditional" GNU Objective-C Runtime API.
This file declares the "traditional" GNU Objective-C Runtime API. It is the API supported by older versions of the GNU Objective-C
It is the API supported by older versions of the GNU Objective-C Runtime. Include this file to use it.
Runtime. Include this file to use it.
This API is being replaced by the "modern" GNU Objective-C Runtime This API is being replaced by the "modern" GNU Objective-C Runtime
API, which is declared in objc/runtime.h. The "modern" API is very API, which is declared in objc/runtime.h. The "modern" API is very
similar to the API used by the modern Apple/NeXT runtime. similar to the API used by the modern Apple/NeXT runtime.
Because the two APIs have some conflicting definitions (in The last version of GCC supporting the traditional API is GCC 4.6.
particular, Method and Category are defined differently) you should This file will not exist in later versions of GCC.
include either objc/objc-api.h (to use the traditional GNU
Objective-C Runtime API) or objc/runtime.h (to use the modern GNU Because the two APIs have some conflicting definitions (in
Objective-C Runtime API), but not both. particular, Method and Category are defined differently) you should
*/ include either objc/objc-api.h (to use the traditional GNU
Objective-C Runtime API) or objc/runtime.h (to use the modern GNU
Objective-C Runtime API), but not both. */
#ifdef __objc_runtime_INCLUDE_GNU #ifdef __objc_runtime_INCLUDE_GNU
# error You can not include both objc/objc-api.h and objc/runtime.h. Include objc/objc-api.h for the traditional GNU Objective-C Runtime API and objc/runtime.h for the modern one. # error You can not include both objc/objc-api.h and objc/runtime.h. Include objc/objc-api.h for the traditional GNU Objective-C Runtime API and objc/runtime.h for the modern one.
#endif #endif
/* TODO: A deprecation warning any time the file is included ? */
#include "objc.h" #include "objc.h"
#ifndef GNU_LIBOBJC_COMPILING_LIBOBJC_ITSELF #ifndef GNU_LIBOBJC_COMPILING_LIBOBJC_ITSELF
# include "deprecated/hash.h" # include "deprecated/hash.h"
@ -182,6 +185,8 @@ typedef struct objc_category Category, *Category_t;
** objc_get_class if the runtime is not able to find the class. ** objc_get_class if the runtime is not able to find the class.
** This may e.g. try to load in the class using dynamic loading. ** This may e.g. try to load in the class using dynamic loading.
** The function is guaranteed to be passed a non-NULL name string. ** The function is guaranteed to be passed a non-NULL name string.
** In the Modern API, this is replaced by
** objc_setGetUnknownClassHandler ().
*/ */
objc_EXPORT Class (*_objc_lookup_class)(const char *name); objc_EXPORT Class (*_objc_lookup_class)(const char *name);

View File

@ -876,6 +876,14 @@ objc_EXPORT Protocol **protocol_copyProtocolList (Protocol *protocol, unsigned i
/* TODO: Add all the other functions in the API. */ /* TODO: Add all the other functions in the API. */
/** Implementation: the following hook is in init.c. */
/* 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. */
objc_EXPORT void (*_objc_load_callback)(Class _class, struct objc_category *category);
/** Implementation: the following functions are in objc-foreach.c. */ /** Implementation: the following functions are in objc-foreach.c. */