This commit is contained in:
Glenn Maynard
2004-10-27 19:49:08 +00:00
parent 37c4e97ceb
commit 303d0600d4
2 changed files with 8 additions and 9 deletions
+7 -8
View File
@@ -382,26 +382,25 @@ static const char *GetCheckpointLog( int slotno, int lineno )
return slot.ThreadFormattedOutput;
}
const char *Checkpoints::GetLogs( const char *delim )
/* XXX: iSize check unimplemented */
void Checkpoints::GetLogs( char *pBuf, int iSize, const char *delim )
{
static char ret[1024*32];
ret[0] = 0;
pBuf[0] = 0;
for( int slotno = 0; slotno < MAX_THREADS; ++slotno )
{
const char *buf = GetCheckpointLog( slotno, 0 );
if( buf == NULL )
continue;
strcat( ret, buf );
strcat( ret, delim );
strcat( pBuf, buf );
strcat( pBuf, delim );
for( int line = 1; (buf = GetCheckpointLog( slotno, line )) != NULL; ++line )
{
strcat( ret, buf );
strcat( ret, delim );
strcat( pBuf, buf );
strcat( pBuf, delim );
}
}
return ret;
}
/*
+1 -1
View File
@@ -43,7 +43,7 @@ namespace Checkpoints
{
void LogCheckpoints( bool yes=true );
void SetCheckpoint( const char *file, int line, const char *message );
const char *GetLogs( const char *delim );
void GetLogs( char *pBuf, int iSize, const char *delim );
};
#define CHECKPOINT (Checkpoints::SetCheckpoint(__FILE__, __LINE__, NULL))