git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15165 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-11-28 09:35:36 +00:00
parent e8551b6817
commit 60d165a93c
5 changed files with 64 additions and 38 deletions

View file

@ -5,6 +5,9 @@
* Tools/AGSOutput.m: Bugfix to output ivar type information.
* Tools/AGSHtml.m: Reduce space around examples.
Bugs reported by Chris B. Vetter
* Source/Additions/GSObjCRuntime.m: Tidied function name conventions.
* Headers/gnustep/base/GSObjCRuntime.h: ditto.
* Source/NSKeyValueCoding.m: Use new function names.
2002-11-27 Manuel Guesdon <mguesdon@orange-concept.com>

View file

@ -130,7 +130,7 @@
name: (NSString*)name;
- (void) setContent: (id)newContent
type: (NSString*)type
subtype: (NSString*)subType
subtype: (NSString*)subtype
name: (NSString*)name;
- (void) setHeader: (GSMimeHeader*)info;

View file

@ -83,29 +83,30 @@ GS_EXPORT void GSObjCGetVariable(id obj, int offset, unsigned int size,
GS_EXPORT void GSObjCSetVariable(id obj, int offset, unsigned int size,
const void *data);
/*
* The next three 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 void GSObjCAddClassBehavior(Class receiver, Class behavior);
GS_EXPORT NSValue*
GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars);
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);
/*
* 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,

View file

@ -38,6 +38,7 @@
#include <mframe.h>
#include <string.h>
/** Deprecated ... use GSObjCFindInstanceVariable() */
BOOL
GSFindInstanceVariable(id obj, const char *name,
const char **type, unsigned int *size, int *offset)
@ -93,33 +94,36 @@ GSObjCFindInstanceVariable(id obj, const char *name,
return YES;
}
/**
* This function performs no checking ... you should use it only where
* you are providing information from a call to GSFindInstanceVariable()
* and you know that the data area provided is the correct size.
*/
/** Deprecated ... use GSObjCGetVariable() */
void
GSGetVariable(id obj, int offset, unsigned int size, void *data)
{
GSObjCGetVariable(obj, offset, size, data);
}
/**
* Gets the value from an instance variable in obj<br />
* This function performs no checking ... you should use it only where
* you are providing information from a call to GSFindInstanceVariable()
* and you know that the data area provided is the correct size.
*/
void
GSObjCGetVariable(id obj, int offset, unsigned int size, void *data)
{
memcpy(data, ((void*)obj) + offset, size);
}
/**
* This function performs no checking ... you should use it only where
* you are providing information from a call to GSFindInstanceVariable()
* and you know that the data area provided is the correct size.
*/
/** Deprecated ... use GSObjCSetVariable() */
void
GSSetVariable(id obj, int offset, unsigned int size, const void *data)
{
GSObjCSetVariable(obj, offset, size, data);
}
/**
* Sets the value in an instance variable in obj<br />
* This function performs no checking ... you should use it only where
* you are providing information from a call to GSFindInstanceVariable()
* and you know that the data area provided is the correct size.
*/
void
GSObjCSetVariable(id obj, int offset, unsigned int size, const void *data)
{
@ -625,6 +629,14 @@ GSObjCAddClassBehavior(Class receiver, Class behavior)
#include <Foundation/NSValue.h>
#include <Foundation/NSKeyValueCoding.h>
/** Deprecated ... use GSObjCGetValue() */
id
GSGetValue(NSObject *self, NSString *key, SEL sel,
const char *type, unsigned size, int offset)
{
return GSObjCGetValue(self, key, sel, type, size, offset);
}
/**
* This is used internally by the key-value coding methods, to get a
* value from an object either via an accessor method (if sel is
@ -636,7 +648,7 @@ GSObjCAddClassBehavior(Class receiver, Class behavior)
* to get a value.
*/
id
GSGetValue(NSObject *self, NSString *key, SEL sel,
GSObjCGetValue(NSObject *self, NSString *key, SEL sel,
const char *type, unsigned size, int offset)
{
if (sel != 0)
@ -935,6 +947,13 @@ GSGetValue(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)
{
GSObjCSetValue(self, key, val, sel, type, size, offset);
}
/**
* This is used internally by the key-value coding methods, to set a
* value in an object either via an accessor method (if sel is
@ -946,7 +965,7 @@ GSGetValue(NSObject *self, NSString *key, SEL sel,
* to set a value.
*/
void
GSSetValue(NSObject *self, NSString *key, id val, SEL sel,
GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel,
const char *type, unsigned size, int offset)
{
if (sel != 0)

View file

@ -123,10 +123,11 @@
if ([[self class] accessInstanceVariablesDirectly] == YES)
{
// _key
if (GSFindInstanceVariable(self, name, &type, &size, &off) == NO)
if (GSObjCFindInstanceVariable(self, name, &type, &size, &off)
== NO)
{
name = &buf[4]; // key
GSFindInstanceVariable(self, name, &type, &size, &off);
GSObjCFindInstanceVariable(self, name, &type, &size, &off);
}
}
if (type == NULL)
@ -147,7 +148,7 @@
}
}
}
return GSGetValue(self, aKey, sel, type, size, off);
return GSObjCGetValue(self, aKey, sel, type, size, off);
}
}
@ -197,10 +198,11 @@
buf[4] = lo;
buf[3] = '_';
name = &buf[3]; // _key
if (GSFindInstanceVariable(self, name, &type, &size, &off) == NO)
if (GSObjCFindInstanceVariable(self, name, &type, &size, &off)
== NO)
{
name = &buf[4]; // key
GSFindInstanceVariable(self, name, &type, &size, &off);
GSObjCFindInstanceVariable(self, name, &type, &size, &off);
}
}
if (type == NULL)
@ -216,7 +218,7 @@
}
}
}
GSSetValue(self, aKey, anObject, sel, type, size, off);
GSObjCSetValue(self, aKey, anObject, sel, type, size, off);
}
}
@ -264,16 +266,17 @@
buf[3] = '_';
buf[4] = lo;
name = &buf[3]; // _key
if (GSFindInstanceVariable(self, name, &type, &size, &off)
if (GSObjCFindInstanceVariable(self, name, &type, &size, &off)
== NO)
{
name = &buf[4]; // key
GSFindInstanceVariable(self, name, &type, &size, &off);
GSObjCFindInstanceVariable(self, name, &type, &size,
&off);
}
}
}
}
GSSetValue(self, aKey, anObject, sel, type, size, off);
GSObjCSetValue(self, aKey, anObject, sel, type, size, off);
}
}
@ -377,13 +380,13 @@
buf[4] = lo;
buf[3] = '_';
name = &buf[3]; // _key
if (GSFindInstanceVariable(self, name, &type, &size, &off) == NO)
if (GSObjCFindInstanceVariable(self, name, &type, &size, &off) == NO)
{
name = &buf[4]; // key
GSFindInstanceVariable(self, name, &type, &size, &off);
GSObjCFindInstanceVariable(self, name, &type, &size, &off);
}
}
return GSGetValue(self, aKey, sel, type, size, off);
return GSObjCGetValue(self, aKey, sel, type, size, off);
}
}