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; 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]; pBuf[0] = 0;
ret[0] = 0;
for( int slotno = 0; slotno < MAX_THREADS; ++slotno ) for( int slotno = 0; slotno < MAX_THREADS; ++slotno )
{ {
const char *buf = GetCheckpointLog( slotno, 0 ); const char *buf = GetCheckpointLog( slotno, 0 );
if( buf == NULL ) if( buf == NULL )
continue; continue;
strcat( ret, buf ); strcat( pBuf, buf );
strcat( ret, delim ); strcat( pBuf, delim );
for( int line = 1; (buf = GetCheckpointLog( slotno, line )) != NULL; ++line ) for( int line = 1; (buf = GetCheckpointLog( slotno, line )) != NULL; ++line )
{ {
strcat( ret, buf ); strcat( pBuf, buf );
strcat( ret, delim ); strcat( pBuf, delim );
} }
} }
return ret;
} }
/* /*
+1 -1
View File
@@ -43,7 +43,7 @@ namespace Checkpoints
{ {
void LogCheckpoints( bool yes=true ); void LogCheckpoints( bool yes=true );
void SetCheckpoint( const char *file, int line, const char *message ); 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)) #define CHECKPOINT (Checkpoints::SetCheckpoint(__FILE__, __LINE__, NULL))