requireToDebugger.c from redshed at Krugle
Show requireToDebugger.c syntax highlighted
/****************************************************************************************
requireToDebugger.c $Revision: 3 $
<http://rentzsch.com/require>
Copyright © 1997-2002 Red Shed Software. All rights reserved.
by Jonathan 'Wolf' Rentzsch (jon at redshed dot net)
Reports requirement failures via DebugStr().
************************************************************************************/
#include "requireImplementation.c"
/****************************************************************************************
Commenter Date Comment
--------- ----------------- -----------------------------------------------------
wolf Mon, Jul 21, 1997 Created.
************************************************************************************/
void
RequireNotice(
const char *msg,
const char *code,
const char *note,
long nmbr,
const char *file,
long line,
long errn )
{
Str255 outStr = "\p";
#define out outStr, sizeof( Str255 ) - 1
// Message line.
if( msg )
RAppendCStringToPString( msg, out );
else
RAppendPStringToPString( "\pGeneric Require Failure", out );
// Note line.
if( note ) {
RAppendPStringToPString( "\p\r note: ", out );
RAppendCStringToPString( note, out );
}
// File line.
if( file ) {
RAppendPStringToPString( "\p\r file: ", out );
RAppendCStringToPString( file, out );
}
// Line line.
if( line ) {
RAppendPStringToPString( "\p\r line: ", out );
RAppendLongToPString( line, out );
}
// Errn line.
if( errn ) {
RAppendPStringToPString( "\p\r errn: ", out );
RAppendLongToPString( errn, out );
}
// Nmbr line.
if( nmbr ) {
RAppendPStringToPString( "\p\r nmbr: ", out );
RAppendLongToPString( nmbr, out );
}
// Code line.
if( code ) {
RAppendPStringToPString( "\p\r code: ", out );
RAppendCStringToPString( code, out );
}
#undef out
DebugStr( outStr );
}
See more files for this project here