mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Further tidying of objc functions
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15154 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
52ca7410dc
commit
7c09917f11
2 changed files with 29 additions and 1 deletions
|
@ -76,6 +76,16 @@
|
|||
* Get the type encoding for a named ivar,
|
||||
* and copy a value into an ivar.
|
||||
*/
|
||||
GS_EXPORT BOOL GSObjCFindInstanceVariable(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);
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
|
|
@ -38,6 +38,13 @@
|
|||
#include <mframe.h>
|
||||
#include <string.h>
|
||||
|
||||
BOOL
|
||||
GSFindInstanceVariable(id obj, const char *name,
|
||||
const char **type, unsigned int *size, int *offset)
|
||||
{
|
||||
return GSFindInstanceVariable(obj, name, type, size, offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to locate information about the instance
|
||||
* variable of obj called name. It returns YES if the variable
|
||||
|
@ -46,7 +53,7 @@
|
|||
* they are null pointers).
|
||||
*/
|
||||
BOOL
|
||||
GSFindInstanceVariable(id obj, const char *name,
|
||||
GSObjCFindInstanceVariable(id obj, const char *name,
|
||||
const char **type, unsigned int *size, int *offset)
|
||||
{
|
||||
Class class;
|
||||
|
@ -93,6 +100,11 @@ GSFindInstanceVariable(id obj, const char *name,
|
|||
*/
|
||||
void
|
||||
GSGetVariable(id obj, int offset, unsigned int size, void *data)
|
||||
{
|
||||
GSObjCGetVariable(obj, offset, size, data);
|
||||
}
|
||||
void
|
||||
GSObjCGetVariable(id obj, int offset, unsigned int size, void *data)
|
||||
{
|
||||
memcpy(data, ((void*)obj) + offset, size);
|
||||
}
|
||||
|
@ -104,6 +116,12 @@ GSGetVariable(id obj, int offset, unsigned int size, void *data)
|
|||
*/
|
||||
void
|
||||
GSSetVariable(id obj, int offset, unsigned int size, const void *data)
|
||||
{
|
||||
GSObjCSetVariable(obj, offset, size, data);
|
||||
}
|
||||
|
||||
void
|
||||
GSObjCSetVariable(id obj, int offset, unsigned int size, const void *data)
|
||||
{
|
||||
memcpy(((void*)obj) + offset, data, size);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue