move a few functions from header to source file

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29725 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2010-02-25 05:07:34 +00:00
parent 4497ba7bdd
commit 8da37b5bf9
2 changed files with 84 additions and 69 deletions

View file

@ -204,8 +204,6 @@ GSObjCSetVal(NSObject *self, const char *key, id val, SEL sel,
* where applicable.
*/
#define GS_STATIC_INLINE static inline
/**
* Fills a nil terminated array of Class objects referenced by buffer
* with max number of classes registered with the objc runtime.
@ -274,22 +272,10 @@ GS_EXPORT const char *GSClassNameFromObject(id obj);
GS_EXPORT const char *GSNameFromSelector(SEL sel);
/**
* Return a selector matching the specified name, or nil if no name is
* supplied. The returned selector could be any one with the name.<br />
* If no selector exists, returns nil.
* GSSelectorFromName() is deprecated ... use sel_getUid()
*/
GS_STATIC_INLINE SEL
GSSelectorFromName(const char *name)
{
if (name == 0)
{
return 0;
}
else
{
return sel_get_uid(name);
}
}
GS_EXPORT SEL
GSSelectorFromName(const char *name);
/**
* Return the selector for the specified name and types. Returns a nul
@ -297,53 +283,16 @@ GSSelectorFromName(const char *name)
* argument is nul. <br />
* Creates a new selector if necessary.
*/
GS_STATIC_INLINE SEL
GSSelectorFromNameAndTypes(const char *name, const char *types)
{
if (name == 0)
{
return 0;
}
else
{
SEL s;
if (types == 0)
{
s = sel_get_any_typed_uid(name);
}
else
{
s = sel_get_typed_uid(name, types);
}
if (s == 0)
{
if (types == 0)
{
s = sel_register_name(name);
}
else
{
s = sel_register_typed_name(name, types);
}
}
return s;
}
}
GS_EXPORT SEL
GSSelectorFromNameAndTypes(const char *name, const char *types);
/**
* Return the type information from the specified selector.
* May return a nul pointer if the selector was a nul pointer or if it
* was not typed.
*/
GS_STATIC_INLINE const char *
GSTypesFromSelector(SEL sel)
{
if (sel == 0)
return 0;
return sel_get_type(sel);
}
GS_EXPORT const char *
GSTypesFromSelector(SEL sel);
/**
* Compare only the type information ignoring qualifiers, the frame layout
@ -409,12 +358,8 @@ GSGetMethod(Class cls, SEL sel,
* Please follow potential changes (Name, parameters, ...) closely until
* it stabilizes.
*/
GS_STATIC_INLINE void
GSFlushMethodCacheForClass (Class cls)
{
extern void __objc_update_dispatch_table_for_class (Class);
__objc_update_dispatch_table_for_class (cls);
}
GS_EXPORT void
GSFlushMethodCacheForClass (Class cls);
/**
* Returns the pointer to the instance variable structure

View file

@ -129,6 +129,76 @@ GSNameFromSelector(SEL sel)
{
return sel_getName(sel);
}
SEL
GSSelectorFromName(const char *name)
{
if (name == 0)
{
return 0;
}
else
{
return sel_getUid(name);
}
}
SEL
GSSelectorFromNameAndTypes(const char *name, const char *types)
{
if (name == 0)
{
return 0;
}
else
{
#if NeXT_RUNTIME
return sel_getUid(name);
#else
SEL s;
if (types == 0)
{
s = sel_get_any_typed_uid(name);
}
else
{
s = sel_get_typed_uid(name, types);
}
if (s == 0)
{
if (types == 0)
{
s = sel_register_name(name);
}
else
{
s = sel_register_typed_name(name, types);
}
}
return s;
#endif
}
}
const char *
GSTypesFromSelector(SEL sel)
{
#if NeXT_RUNTIME
return 0;
#else
if (sel == 0)
return 0;
return sel_get_type(sel);
#endif
}
void
GSFlushMethodCacheForClass (Class cls)
{
#if NeXT_RUNTIME
#else
extern void __objc_update_dispatch_table_for_class (Class);
__objc_update_dispatch_table_for_class (cls);
#endif
return;
}
int
GSObjCVersion(Class cls)
{
@ -1026,7 +1096,7 @@ GSAddMethodList(Class cls,
class_add_method_list(cls, list);
}
GS_STATIC_INLINE void
static inline void
gs_revert_selector_names_in_list(GSMethodList list)
{
int i;
@ -1100,7 +1170,7 @@ GSRemoveMethodList(Class cls,
}
GS_STATIC_INLINE const char *
static inline const char *
gs_skip_type_qualifier_and_layout_info (const char *types)
{
while (*types == '+'
@ -1191,7 +1261,7 @@ GSObjCGetInstanceVariableDefinition(Class cls, NSString *name)
}
GS_STATIC_INLINE unsigned int
static inline unsigned int
gs_string_hash(const char *s)
{
unsigned int val = 0;
@ -1202,7 +1272,7 @@ gs_string_hash(const char *s)
return val;
}
GS_STATIC_INLINE Protocol *
static inline Protocol *
gs_find_protocol_named_in_protocol_list(const char *name,
struct objc_protocol_list *pcllist)
{
@ -1224,7 +1294,7 @@ gs_find_protocol_named_in_protocol_list(const char *name,
return NULL;
}
GS_STATIC_INLINE Protocol *
static inline Protocol *
gs_find_protocol_named(const char *name)
{
Protocol *p = NULL;