* Headers/gnustep/base/objc-gnu2next.h: Remove simple mappings for

class_get_class_method they cannot work due to different
	parameter expectations.  Added mapping from NeXT->GNU runtime.
	The other way does not work.  Added simple mapping for internal
	flush function __objc_update_dispatch_table_for_class and
	_objc_flush_caches.

	* Headers/gnustep/base/GSObjCRuntime.h/m:
	Added typedef for GSMethod.
	(GSGetInstanceMethod): New function.
	(GSGetClassMethod): Ditto.
	(GSGetInstanceMethodNotInherited): Ditto.
	(GSGetClassMethodNotInherited): Ditto.
	(GSFlushMethodCacheForClass): Ditto.
	(flush_method_cache_for_class): Removed function which is replaced
	by GSFlushMethodCacheForClass.
	(GSObjCGetMethod): Removed function which is replaced by
	GSGetInstanceMethod and GSGetClassMethod.
	(GSObjCReplaceMethod): Removed function.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16997 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ayers 2003-06-22 08:45:48 +00:00
parent 7d3c419f6c
commit 5e5ce83a86
4 changed files with 143 additions and 60 deletions

View file

@ -659,66 +659,20 @@ search_for_method_in_class (Class class, SEL op)
#endif /* NeXT runtime */
static void
flush_method_cache_for_class (Class class)
/* See header for documentation. */
GSMethod
GSGetInstanceMethodNotInherited (Class class, SEL sel)
{
#if NeXT_RUNTIME
void _objc_flush_caches (Class);
_objc_flush_caches (class);
#else
void __objc_update_dispatch_table_for_class (Class);
__objc_update_dispatch_table_for_class (class);
#endif
return search_for_method_in_class (class, sel);
}
IMP
GSObjCGetMethod (Class class, SEL sel)
/* See header for documentation. */
GSMethod
GSGetClassMethodNotInhertited (Class class, SEL sel)
{
struct objc_method *method;
IMP imp;
imp = NULL;
method = search_for_method_in_class (class, sel);
if (method != NULL)
{
imp = method->method_imp;
}
return imp;
return search_for_method_in_class (class->class_pointer, sel);
}
IMP
GSObjCReplaceMethod (Class class, SEL sel, IMP imp)
{
struct objc_method *method;
IMP oImp;
oImp = NULL;
method = search_for_method_in_class (class, sel);
if (method != NULL)
{
oImp = method->method_imp;
method->method_imp = imp;
flush_method_cache_for_class(class);
if (behavior_debug)
{
fprintf(stderr, "replaced implementation for %s in %s.\n",
sel_get_name(sel), class->name);
}
}
else
{
if (behavior_debug)
{
fprintf(stderr, "could not replaced implementation for %s in %s.\n",
sel_get_name(sel), class != NULL ? class->name : "<NULL>");
}
}
return oImp;
}
/**
* <p>A Behavior can be seen as a "Protocol with an implementation" or a