Added Printv function
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@515 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1cb4e811b6
commit
84e12f6b0f
3 changed files with 27 additions and 0 deletions
|
|
@ -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()
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue