mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
* Headers/gnustep/base/GSObjCRuntime.h
* Source/Additions/GSObjCRuntime.m : White space patch to better conform with GNU coding standards and improve readability. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16878 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d228cba99b
commit
68aaf34eb1
3 changed files with 73 additions and 44 deletions
|
@ -1,4 +1,10 @@
|
|||
2003-06-06 David Ayers <d.ayers@inode.at>
|
||||
2003-06-07 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* Headers/gnustep/base/GSObjCRuntime.h
|
||||
* Source/Additions/GSObjCRuntime.m : White space patch to better
|
||||
conform with GNU coding standards and improve readability.
|
||||
|
||||
2003-06-06 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* Source/GSArray.m: Change syntax of include <> to "" for
|
||||
local headers. Change base/ to gnustep/base/ in includes.
|
||||
|
|
|
@ -73,44 +73,64 @@
|
|||
* Get the type encoding for a named ivar,
|
||||
* and copy a value into an ivar.
|
||||
*/
|
||||
GS_EXPORT BOOL GSObjCFindVariable(id obj, const char *name,
|
||||
const char **type, unsigned int *size, int *offset);
|
||||
GS_EXPORT void GSObjCGetVariable(id obj, int offset, unsigned int size,
|
||||
void *data);
|
||||
GS_EXPORT void GSObjCSetVariable(id obj, int offset, unsigned int size,
|
||||
const void *data);
|
||||
GS_EXPORT NSArray* GSObjCMethodNames(id obj);
|
||||
GS_EXPORT NSArray* GSObjCVariableNames(id obj);
|
||||
GS_EXPORT BOOL
|
||||
GSObjCFindVariable(id obj, const char *name,
|
||||
const char **type, unsigned int *size, int *offset);
|
||||
|
||||
GS_EXPORT void GSObjCAddClassBehavior(Class receiver, Class behavior);
|
||||
GS_EXPORT void
|
||||
GSObjCGetVariable(id obj, int offset, unsigned int size, void *data);
|
||||
|
||||
GS_EXPORT NSValue*
|
||||
GS_EXPORT void
|
||||
GSObjCSetVariable(id obj, int offset, unsigned int size, const void *data);
|
||||
|
||||
GS_EXPORT NSArray *
|
||||
GSObjCMethodNames(id obj);
|
||||
|
||||
GS_EXPORT NSArray *
|
||||
GSObjCVariableNames(id obj);
|
||||
|
||||
GS_EXPORT void
|
||||
GSObjCAddClassBehavior(Class receiver, Class behavior);
|
||||
|
||||
GS_EXPORT NSValue *
|
||||
GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars);
|
||||
GS_EXPORT void GSObjCAddClasses(NSArray *classes);
|
||||
|
||||
GS_EXPORT void
|
||||
GSObjCAddClasses(NSArray *classes);
|
||||
|
||||
/*
|
||||
* Functions for key-value encoding ... they access values in an object
|
||||
* either by selector or directly, but do so using NSNumber for the
|
||||
* scalar types of data.
|
||||
*/
|
||||
GS_EXPORT id GSObjCGetValue(NSObject *self, NSString *key, SEL sel,
|
||||
const char *type, unsigned size, int offset);
|
||||
GS_EXPORT void GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
||||
const char *type, unsigned size, int offset);
|
||||
GS_EXPORT id
|
||||
GSObjCGetValue(NSObject *self, NSString *key, SEL sel,
|
||||
const char *type, unsigned size, int offset);
|
||||
|
||||
GS_EXPORT void
|
||||
GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
||||
const char *type, unsigned size, int offset);
|
||||
|
||||
/*
|
||||
* The next five are old (deprecated) names for the same thing.
|
||||
*/
|
||||
GS_EXPORT BOOL GSFindInstanceVariable(id obj, const char *name,
|
||||
const char **type, unsigned int *size, int *offset);
|
||||
GS_EXPORT void GSGetVariable(id obj, int offset, unsigned int size,
|
||||
void *data);
|
||||
GS_EXPORT void GSSetVariable(id obj, int offset, unsigned int size,
|
||||
const void *data);
|
||||
GS_EXPORT id GSGetValue(NSObject *self, NSString *key, SEL sel,
|
||||
const char *type, unsigned size, int offset);
|
||||
GS_EXPORT void GSSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
||||
const char *type, unsigned size, int offset);
|
||||
GS_EXPORT BOOL
|
||||
GSFindInstanceVariable(id obj, const char *name,
|
||||
const char **type, unsigned int *size, int *offset);
|
||||
|
||||
GS_EXPORT void
|
||||
GSGetVariable(id obj, int offset, unsigned int size, void *data);
|
||||
|
||||
GS_EXPORT void
|
||||
GSSetVariable(id obj, int offset, unsigned int size, const void *data);
|
||||
|
||||
GS_EXPORT id
|
||||
GSGetValue(NSObject *self, NSString *key, SEL sel,
|
||||
const char *type, unsigned size, int offset);
|
||||
|
||||
GS_EXPORT void
|
||||
GSSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
||||
const char *type, unsigned size, int offset);
|
||||
|
||||
#include <gnustep/base/objc-gnu2next.h>
|
||||
|
||||
|
@ -197,7 +217,7 @@ GSClassFromName(const char *name)
|
|||
* Return the name of the supplied class, or a nul pointer if no class
|
||||
* was supplied.
|
||||
*/
|
||||
GS_STATIC_INLINE const char*
|
||||
GS_STATIC_INLINE const char *
|
||||
GSNameFromClass(Class this)
|
||||
{
|
||||
if (this == 0)
|
||||
|
@ -209,7 +229,7 @@ GSNameFromClass(Class this)
|
|||
* Return the name of the supplied selector, or a nul pointer if no selector
|
||||
* was supplied.
|
||||
*/
|
||||
GS_STATIC_INLINE const char*
|
||||
GS_STATIC_INLINE const char *
|
||||
GSNameFromSelector(SEL this)
|
||||
{
|
||||
if (this == 0)
|
||||
|
@ -250,7 +270,7 @@ GSSelectorFromNameAndTypes(const char *name, const char *types)
|
|||
}
|
||||
else
|
||||
{
|
||||
SEL s;
|
||||
SEL s;
|
||||
|
||||
if (types == 0)
|
||||
{
|
||||
|
@ -281,7 +301,7 @@ GSSelectorFromNameAndTypes(const char *name, const char *types)
|
|||
* May return a nul pointer if the selector was a nul pointer or if it
|
||||
* was not typed.
|
||||
*/
|
||||
GS_STATIC_INLINE const char*
|
||||
GS_STATIC_INLINE const char *
|
||||
GSTypesFromSelector(SEL this)
|
||||
{
|
||||
if (this == 0)
|
||||
|
@ -311,15 +331,18 @@ GSObjCVersion(Class this)
|
|||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
GS_EXPORT NSZone *GSObjCZone(NSObject *obj);
|
||||
GS_EXPORT NSZone *
|
||||
GSObjCZone(NSObject *obj);
|
||||
|
||||
/**
|
||||
* Quickly return autoreleased data storage area.
|
||||
*/
|
||||
GS_EXPORT void *GSAutoreleasedBuffer(unsigned size);
|
||||
GS_EXPORT void *
|
||||
GSAutoreleasedBuffer(unsigned size);
|
||||
|
||||
/* Getting a system error message on a variety of systems */
|
||||
GS_EXPORT const char *GSLastErrorStr(long error_id);
|
||||
GS_EXPORT const char *
|
||||
GSLastErrorStr(long error_id);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
/** Deprecated ... use GSObjCFindVariable() */
|
||||
BOOL
|
||||
GSFindInstanceVariable(id obj, const char *name,
|
||||
const char **type, unsigned int *size, int *offset)
|
||||
const char **type, unsigned int *size, int *offset)
|
||||
{
|
||||
return GSObjCFindVariable(obj, name, type, size, offset);
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ GSFindInstanceVariable(id obj, const char *name,
|
|||
*/
|
||||
BOOL
|
||||
GSObjCFindVariable(id obj, const char *name,
|
||||
const char **type, unsigned int *size, int *offset)
|
||||
const char **type, unsigned int *size, int *offset)
|
||||
{
|
||||
Class class;
|
||||
struct objc_ivar_list *ivars;
|
||||
|
@ -114,7 +114,7 @@ GSObjCFindVariable(id obj, const char *name,
|
|||
* If obj is a class, this returns the class methods.<br />
|
||||
* Returns nil if obj is nil.
|
||||
*/
|
||||
NSArray*
|
||||
NSArray *
|
||||
GSObjCMethodNames(id obj)
|
||||
{
|
||||
NSMutableSet *set;
|
||||
|
@ -190,7 +190,7 @@ GSObjCMethodNames(id obj)
|
|||
* belong to the class of obj or one of its superclasses.<br />
|
||||
* Returns nil if obj is nil.
|
||||
*/
|
||||
NSArray*
|
||||
NSArray *
|
||||
GSObjCVariableNames(id obj)
|
||||
{
|
||||
NSMutableArray *array;
|
||||
|
@ -283,7 +283,7 @@ ObjcRuntimeUtilities.m by Nicola Pero
|
|||
* <p>The iVars dictionary lists the instance variable names and their types.
|
||||
* </p>
|
||||
*/
|
||||
NSValue*
|
||||
NSValue *
|
||||
GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars)
|
||||
{
|
||||
Class newClass;
|
||||
|
@ -838,7 +838,7 @@ GSObjCAddClassBehavior(Class receiver, Class behavior)
|
|||
/** Deprecated ... use GSObjCGetValue() */
|
||||
id
|
||||
GSGetValue(NSObject *self, NSString *key, SEL sel,
|
||||
const char *type, unsigned size, int offset)
|
||||
const char *type, unsigned size, int offset)
|
||||
{
|
||||
return GSObjCGetValue(self, key, sel, type, size, offset);
|
||||
}
|
||||
|
@ -854,7 +854,7 @@ GSGetValue(NSObject *self, NSString *key, SEL sel,
|
|||
*/
|
||||
id
|
||||
GSObjCGetValue(NSObject *self, NSString *key, SEL sel,
|
||||
const char *type, unsigned size, int offset)
|
||||
const char *type, unsigned size, int offset)
|
||||
{
|
||||
if (sel != 0)
|
||||
{
|
||||
|
@ -1155,7 +1155,7 @@ GSObjCGetValue(NSObject *self, NSString *key, SEL sel,
|
|||
/** Deprecated ... use GSObjCSetValue() */
|
||||
void
|
||||
GSSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
||||
const char *type, unsigned size, int offset)
|
||||
const char *type, unsigned size, int offset)
|
||||
{
|
||||
GSObjCSetValue(self, key, val, sel, type, size, offset);
|
||||
}
|
||||
|
@ -1171,7 +1171,7 @@ GSSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
|||
*/
|
||||
void
|
||||
GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
||||
const char *type, unsigned size, int offset)
|
||||
const char *type, unsigned size, int offset)
|
||||
{
|
||||
static NSNull *null = nil;
|
||||
|
||||
|
@ -1535,10 +1535,10 @@ LPTSTR GetErrorMsg(DWORD msgId)
|
|||
}
|
||||
#else
|
||||
#ifndef HAVE_STRERROR
|
||||
const char*
|
||||
const char *
|
||||
strerror(int eno)
|
||||
{
|
||||
extern char* sys_errlist[];
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
|
||||
if (eno < 0 || eno >= sys_nerr)
|
||||
|
|
Loading…
Reference in a new issue