Added DohGetVoid() and DohSetVoid()

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@297 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-02-29 20:19:46 +00:00
commit 3ff9b8fac0
2 changed files with 34 additions and 0 deletions

View file

@ -577,6 +577,21 @@ DohGetChar(DOH *obj, const DOH *name) {
return 0; 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() * DohSetInt()
* *
@ -621,6 +636,20 @@ DohSetChar(DOH *obj, const DOH *name, char *value) {
Setattr(obj,(DOH *) name,temp); 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 * Sequence Interface
* ---------------------------------------------------------------------- */ * ---------------------------------------------------------------------- */

View file

@ -172,6 +172,8 @@ typedef struct DohObjInfo {
extern char *DohGetChar(DOH *obj, const DOH *name); extern char *DohGetChar(DOH *obj, const DOH *name);
extern void DohSetInt(DOH *obj, const DOH *name, int); extern void DohSetInt(DOH *obj, const DOH *name, int);
extern void DohSetDouble(DOH *obj, const DOH *name, double); 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 */ /* Sequence methods */
@ -267,8 +269,11 @@ typedef struct DohObjInfo {
#define GetInt DohGetInt #define GetInt DohGetInt
#define GetDouble DohGetDouble #define GetDouble DohGetDouble
#define GetChar DohGetChar #define GetChar DohGetChar
#define GetVoid DohGetVoid
#define SetInt DohSetInt #define SetInt DohSetInt
#define SetDouble DohSetDouble #define SetDouble DohSetDouble
#define SetChar DohSetattr
#define SetVoid DohSetVoid
#define Firstitem DohFirstitem #define Firstitem DohFirstitem
#define Nextitem DohNextitem #define Nextitem DohNextitem
#define Readline DohReadline #define Readline DohReadline