Added DohGetVoid() and DohSetVoid()
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@297 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1765b9dac4
commit
95724b0e8f
2 changed files with 34 additions and 0 deletions
|
|
@ -577,6 +577,21 @@ DohGetChar(DOH *obj, const DOH *name) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* DohGetVoid()
|
||||
*
|
||||
* Returns an element as a void *
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void *
|
||||
DohGetVoid(DOH *obj, const DOH *name) {
|
||||
DOH *val;
|
||||
DohTrace(DOH_CALLS,"DohGetVoid %x, %x\n",obj,name);
|
||||
val = Getattr(obj,(DOH *) name);
|
||||
if (!val) return 0;
|
||||
return (void *) Data(val);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* DohSetInt()
|
||||
*
|
||||
|
|
@ -621,6 +636,20 @@ DohSetChar(DOH *obj, const DOH *name, char *value) {
|
|||
Setattr(obj,(DOH *) name,temp);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* DohSetVoid()
|
||||
*
|
||||
* Set an attribute as a void
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
DohSetVoid(DOH *obj, const DOH *name, void *value) {
|
||||
DOH *temp;
|
||||
DohTrace(DOH_CALLS,"DohSetChar %x, %x, %g\n", obj, name, value);
|
||||
temp = NewVoid(value,0);
|
||||
Setattr(obj,(DOH *) name,temp);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* Sequence Interface
|
||||
* ---------------------------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -172,6 +172,8 @@ typedef struct DohObjInfo {
|
|||
extern char *DohGetChar(DOH *obj, const DOH *name);
|
||||
extern void DohSetInt(DOH *obj, const DOH *name, int);
|
||||
extern void DohSetDouble(DOH *obj, const DOH *name, double);
|
||||
extern void *DohGetVoid(DOH *obj, const DOH *name);
|
||||
extern void DohSetVoid(DOH *obj, const DOH *name, void *value);
|
||||
|
||||
/* Sequence methods */
|
||||
|
||||
|
|
@ -267,8 +269,11 @@ typedef struct DohObjInfo {
|
|||
#define GetInt DohGetInt
|
||||
#define GetDouble DohGetDouble
|
||||
#define GetChar DohGetChar
|
||||
#define GetVoid DohGetVoid
|
||||
#define SetInt DohSetInt
|
||||
#define SetDouble DohSetDouble
|
||||
#define SetChar DohSetattr
|
||||
#define SetVoid DohSetVoid
|
||||
#define Firstitem DohFirstitem
|
||||
#define Nextitem DohNextitem
|
||||
#define Readline DohReadline
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue