diff --git a/SWIG/Source/DOH/Doh/Makefile b/SWIG/Source/DOH/Doh/Makefile index 074b4b1f4..4d0d42032 100644 --- a/SWIG/Source/DOH/Doh/Makefile +++ b/SWIG/Source/DOH/Doh/Makefile @@ -9,7 +9,7 @@ # Set your C++ compiler here. g++ works on most machines, # but you might have to change it depending on your installation. # -CC = gcc -O2 +CC = cc prefix = /usr/sandbox # Comment out the following line if you're on an SGI or don't have ranlib! diff --git a/SWIG/Source/DOH/Doh/base.c b/SWIG/Source/DOH/Doh/base.c index d44aba66b..24127a7b6 100644 --- a/SWIG/Source/DOH/Doh/base.c +++ b/SWIG/Source/DOH/Doh/base.c @@ -412,7 +412,7 @@ DOH *DohFirst(DOH *obj) { if (b->objinfo->doh_mapping->doh_firstkey) { return DohGetattr(obj,(b->objinfo->doh_mapping->doh_firstkey)(obj)); } - } + } if (DohCheck(obj)) { DohError(DOH_UNSUPPORTED,"No firstkey method defined for type '%s'\n", b->objinfo->objname); } else { @@ -594,6 +594,40 @@ void DohInsertitem(DOH *obj, int index, DOH *value) { } } +/* Delete an item from an object */ +DOH *DohFirstitem(DOH *obj) { + DohBase *b = (DohBase *) obj; + DohError(DOH_CALLS,"DohFirstitem %x\n"); + if (DohIsSequence(obj)) { + if (b->objinfo->doh_sequence->doh_firstitem) { + return (b->objinfo->doh_sequence->doh_firstitem)(obj); + } + } + if (DohCheck(obj)) { + DohError(DOH_UNSUPPORTED,"No firstitem method defined for type '%s'\n", b->objinfo->objname); + } else { + DohError(DOH_UNKNOWN,"Unknown object %x passed to DohFirstitem\n",obj); + } + return 0; +} + +/* Delete an item from an object */ +DOH *DohNextitem(DOH *obj) { + DohBase *b = (DohBase *) obj; + DohError(DOH_CALLS,"DohNextitem %x\n"); + if (DohIsSequence(obj)) { + if (b->objinfo->doh_sequence->doh_nextitem) { + return (b->objinfo->doh_sequence->doh_nextitem)(obj); + } + } + if (DohCheck(obj)) { + DohError(DOH_UNSUPPORTED,"No nextitem method defined for type '%s'\n", b->objinfo->objname); + } else { + DohError(DOH_UNKNOWN,"Unknown object %x passed to DohNextitem\n",obj); + } + return 0; +} + /* ----------------------------------------------------------------------------- * File methods * ----------------------------------------------------------------------------- */ diff --git a/SWIG/Source/DOH/Include/doh.h b/SWIG/Source/DOH/Include/doh.h index 1503dea76..952ee3f65 100644 --- a/SWIG/Source/DOH/Include/doh.h +++ b/SWIG/Source/DOH/Include/doh.h @@ -51,8 +51,8 @@ typedef struct { int (*doh_setitem)(DOH *obj, int index, DOH *value); int (*doh_delitem)(DOH *obj, int index); int (*doh_insitem)(DOH *obj, int index, DOH *value); - DOH *(*doh_first)(DOH *obj); - DOH *(*doh_next)(DOH *obj); + DOH *(*doh_firstitem)(DOH *obj); + DOH *(*doh_nextitem)(DOH *obj); } DohSequenceMethods; /* File methods */ @@ -136,6 +136,8 @@ extern DOH *DohFirst(DOH *obj); extern DOH *DohNext(DOH *obj); extern DOH *DohFirstkey(DOH *obj); extern DOH *DohNextkey(DOH *obj); +extern DOH *DohFirstitem(DOH *obj); +extern DOH *DohNextitem(DOH *obj); extern void *DohData(DOH *obj); extern int DohGetline(DOH *obj); extern void DohSetline(DOH *obj, int line); @@ -203,6 +205,8 @@ extern int DohvPrintf(DOH *obj, char *format, va_list ap); #define vPrintf DohvPrintf #define GetInt DohGetInt #define GetDouble DohGetDouble +#define Firstitem DohFirstitem +#define Nextitem DohNextitem /* #define Scanf DohScanf #define vScanf DohvScanf*/