diff --git a/SWIG/Source/DOH/Doh/fio.c b/SWIG/Source/DOH/Doh/fio.c index ece5fd775..290855c6a 100644 --- a/SWIG/Source/DOH/Doh/fio.c +++ b/SWIG/Source/DOH/Doh/fio.c @@ -387,6 +387,30 @@ DohPrintf(DOH *obj, const char *format, ...) { return ret; } +/* ----------------------------------------------------------------------------- + * DohPrintv() + * + * Print a null-terminated variable length list of DOH objects + * ----------------------------------------------------------------------------- */ + +int DohPrintv(DOHFile *f, ...) { + va_list ap; + int ret = 0; + DOH *obj; + va_start(ap,f); + while(1) { + obj = va_arg(ap,void *); + if (!obj) break; + if (DohCheck(obj)) { + ret += DohDump(obj,f); + } else { + ret += DohWrite(f,obj,strlen((char *) obj)); + } + } + va_end(ap); + return ret; +} + /* ----------------------------------------------------------------------------- * DohCopyto() * diff --git a/SWIG/Source/DOH/Doh/string.c b/SWIG/Source/DOH/Doh/string.c index 3a20905c3..16de665f9 100644 --- a/SWIG/Source/DOH/Doh/string.c +++ b/SWIG/Source/DOH/Doh/string.c @@ -846,6 +846,7 @@ NewString(const DOH *so) if (s) { strcpy(str->str,s); str->len = l; + str->sp = l; } else { str->str[0] = 0; str->len = 0; diff --git a/SWIG/Source/DOH/Include/doh.h b/SWIG/Source/DOH/Include/doh.h index b2d3df6c7..c7ce11132 100644 --- a/SWIG/Source/DOH/Include/doh.h +++ b/SWIG/Source/DOH/Include/doh.h @@ -120,6 +120,7 @@ extern void DohChop(DOHString *src); extern void DohEncoding(char *name, DOH *(*fn)(DOH *s)); extern int DohPrintf(DOHFile *obj, const char *format, ...); extern int DohvPrintf(DOHFile *obj, const char *format, va_list ap); +extern int DohPrintv(DOHFile *obj, ...); extern DOH *DohReadline(DOHFile *in); /* Miscellaneous */ @@ -163,6 +164,7 @@ extern int DohIsFile(const DOH *obj); #define Seek DohSeek #define Tell DohTell #define Printf DohPrintf +#define Printv DohPrintv #define Getc DohGetc #define Putc DohPutc #define Ungetc DohUngetc