mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +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
0e59d4552d
commit
2fd808651a
3 changed files with 73 additions and 44 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
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>
|
2003-06-06 David Ayers <d.ayers@inode.at>
|
||||||
|
|
||||||
* Source/GSArray.m: Change syntax of include <> to "" for
|
* Source/GSArray.m: Change syntax of include <> to "" for
|
||||||
|
|
|
@ -73,43 +73,63 @@
|
||||||
* Get the type encoding for a named ivar,
|
* Get the type encoding for a named ivar,
|
||||||
* and copy a value into an ivar.
|
* and copy a value into an ivar.
|
||||||
*/
|
*/
|
||||||
GS_EXPORT BOOL GSObjCFindVariable(id obj, const char *name,
|
GS_EXPORT BOOL
|
||||||
|
GSObjCFindVariable(id obj, const char *name,
|
||||||
const char **type, unsigned int *size, int *offset);
|
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 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);
|
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
|
* Functions for key-value encoding ... they access values in an object
|
||||||
* either by selector or directly, but do so using NSNumber for the
|
* either by selector or directly, but do so using NSNumber for the
|
||||||
* scalar types of data.
|
* scalar types of data.
|
||||||
*/
|
*/
|
||||||
GS_EXPORT id GSObjCGetValue(NSObject *self, NSString *key, SEL sel,
|
GS_EXPORT id
|
||||||
|
GSObjCGetValue(NSObject *self, NSString *key, SEL sel,
|
||||||
const char *type, unsigned size, int offset);
|
const char *type, unsigned size, int offset);
|
||||||
GS_EXPORT void GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
|
||||||
|
GS_EXPORT void
|
||||||
|
GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
||||||
const char *type, unsigned size, int offset);
|
const char *type, unsigned size, int offset);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The next five are old (deprecated) names for the same thing.
|
* The next five are old (deprecated) names for the same thing.
|
||||||
*/
|
*/
|
||||||
GS_EXPORT BOOL GSFindInstanceVariable(id obj, const char *name,
|
GS_EXPORT BOOL
|
||||||
|
GSFindInstanceVariable(id obj, const char *name,
|
||||||
const char **type, unsigned int *size, int *offset);
|
const char **type, unsigned int *size, int *offset);
|
||||||
GS_EXPORT void GSGetVariable(id obj, int offset, unsigned int size,
|
|
||||||
void *data);
|
GS_EXPORT void
|
||||||
GS_EXPORT void GSSetVariable(id obj, int offset, unsigned int size,
|
GSGetVariable(id obj, int offset, unsigned int size, void *data);
|
||||||
const void *data);
|
|
||||||
GS_EXPORT id GSGetValue(NSObject *self, NSString *key, SEL sel,
|
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);
|
const char *type, unsigned size, int offset);
|
||||||
GS_EXPORT void GSSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
|
||||||
|
GS_EXPORT void
|
||||||
|
GSSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
||||||
const char *type, unsigned size, int offset);
|
const char *type, unsigned size, int offset);
|
||||||
|
|
||||||
#include <gnustep/base/objc-gnu2next.h>
|
#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
|
* Return the name of the supplied class, or a nul pointer if no class
|
||||||
* was supplied.
|
* was supplied.
|
||||||
*/
|
*/
|
||||||
GS_STATIC_INLINE const char*
|
GS_STATIC_INLINE const char *
|
||||||
GSNameFromClass(Class this)
|
GSNameFromClass(Class this)
|
||||||
{
|
{
|
||||||
if (this == 0)
|
if (this == 0)
|
||||||
|
@ -209,7 +229,7 @@ GSNameFromClass(Class this)
|
||||||
* Return the name of the supplied selector, or a nul pointer if no selector
|
* Return the name of the supplied selector, or a nul pointer if no selector
|
||||||
* was supplied.
|
* was supplied.
|
||||||
*/
|
*/
|
||||||
GS_STATIC_INLINE const char*
|
GS_STATIC_INLINE const char *
|
||||||
GSNameFromSelector(SEL this)
|
GSNameFromSelector(SEL this)
|
||||||
{
|
{
|
||||||
if (this == 0)
|
if (this == 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
|
* May return a nul pointer if the selector was a nul pointer or if it
|
||||||
* was not typed.
|
* was not typed.
|
||||||
*/
|
*/
|
||||||
GS_STATIC_INLINE const char*
|
GS_STATIC_INLINE const char *
|
||||||
GSTypesFromSelector(SEL this)
|
GSTypesFromSelector(SEL this)
|
||||||
{
|
{
|
||||||
if (this == 0)
|
if (this == 0)
|
||||||
|
@ -311,15 +331,18 @@ GSObjCVersion(Class this)
|
||||||
#include <Foundation/Foundation.h>
|
#include <Foundation/Foundation.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GS_EXPORT NSZone *GSObjCZone(NSObject *obj);
|
GS_EXPORT NSZone *
|
||||||
|
GSObjCZone(NSObject *obj);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Quickly return autoreleased data storage area.
|
* 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 */
|
/* 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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ GSObjCFindVariable(id obj, const char *name,
|
||||||
* If obj is a class, this returns the class methods.<br />
|
* If obj is a class, this returns the class methods.<br />
|
||||||
* Returns nil if obj is nil.
|
* Returns nil if obj is nil.
|
||||||
*/
|
*/
|
||||||
NSArray*
|
NSArray *
|
||||||
GSObjCMethodNames(id obj)
|
GSObjCMethodNames(id obj)
|
||||||
{
|
{
|
||||||
NSMutableSet *set;
|
NSMutableSet *set;
|
||||||
|
@ -190,7 +190,7 @@ GSObjCMethodNames(id obj)
|
||||||
* belong to the class of obj or one of its superclasses.<br />
|
* belong to the class of obj or one of its superclasses.<br />
|
||||||
* Returns nil if obj is nil.
|
* Returns nil if obj is nil.
|
||||||
*/
|
*/
|
||||||
NSArray*
|
NSArray *
|
||||||
GSObjCVariableNames(id obj)
|
GSObjCVariableNames(id obj)
|
||||||
{
|
{
|
||||||
NSMutableArray *array;
|
NSMutableArray *array;
|
||||||
|
@ -283,7 +283,7 @@ ObjcRuntimeUtilities.m by Nicola Pero
|
||||||
* <p>The iVars dictionary lists the instance variable names and their types.
|
* <p>The iVars dictionary lists the instance variable names and their types.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
NSValue*
|
NSValue *
|
||||||
GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars)
|
GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars)
|
||||||
{
|
{
|
||||||
Class newClass;
|
Class newClass;
|
||||||
|
@ -1535,10 +1535,10 @@ LPTSTR GetErrorMsg(DWORD msgId)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifndef HAVE_STRERROR
|
#ifndef HAVE_STRERROR
|
||||||
const char*
|
const char *
|
||||||
strerror(int eno)
|
strerror(int eno)
|
||||||
{
|
{
|
||||||
extern char* sys_errlist[];
|
extern char *sys_errlist[];
|
||||||
extern int sys_nerr;
|
extern int sys_nerr;
|
||||||
|
|
||||||
if (eno < 0 || eno >= sys_nerr)
|
if (eno < 0 || eno >= sys_nerr)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue