add some more messy debug output

This commit is contained in:
Geoff McLane 2015-01-27 18:07:56 +01:00
parent acdaa67696
commit f83c604ad0
2 changed files with 13 additions and 1 deletions

View file

@ -13,6 +13,9 @@
#include "forward.h" #include "forward.h"
#include "fileio.h" #include "fileio.h"
#include "tidy.h" #include "tidy.h"
#if !defined(NDEBUG) && defined(_MSC_VER)
#include "sprtf.h"
#endif
typedef struct _fp_input_source typedef struct _fp_input_source
{ {
@ -82,6 +85,9 @@ void TIDY_CALL TY_(filesink_putByte)( void* sinkData, byte bv )
{ {
FILE* fout = (FILE*) sinkData; FILE* fout = (FILE*) sinkData;
fputc( bv, fout ); fputc( bv, fout );
#if !defined(NDEBUG) && defined(_MSC_VER)
SPRTF("%c",bv);
#endif
} }
void TY_(initFileSink)( TidyOutputSink* outp, FILE* fp ) void TY_(initFileSink)( TidyOutputSink* outp, FILE* fp )

View file

@ -1164,15 +1164,21 @@ void tidy_out( TidyDocImpl* doc, ctmbstr msg, ... )
{ {
ctmbstr cp; ctmbstr cp;
enum { sizeBuf=2048 }; enum { sizeBuf=2048 };
char *buf = TidyDocAlloc(doc,sizeBuf); char *buf = (char *)TidyDocAlloc(doc,sizeBuf);
va_list args; va_list args;
va_start( args, msg ); va_start( args, msg );
TY_(tmbvsnprintf)(buf, sizeBuf, msg, args); TY_(tmbvsnprintf)(buf, sizeBuf, msg, args);
va_end( args ); va_end( args );
#if !defined(NDEBUG) && defined(_MSC_VER)
add_std_out(0);
#endif
for ( cp=buf; *cp; ++cp ) for ( cp=buf; *cp; ++cp )
TY_(WriteChar)( *cp, doc->errout ); TY_(WriteChar)( *cp, doc->errout );
#if !defined(NDEBUG) && defined(_MSC_VER)
add_std_out(1);
#endif
TidyDocFree(doc, buf); TidyDocFree(doc, buf);
} }
} }