extern void ConsErrMsg( cmsg_info *cinfo ) { // C compiler call back to do a console print to stderr IDEMsgInfo info; IDEMsgSeverity severity; severity = 0; switch( cinfo->class ) { case CMSG_INFO: severity = IDEMSGSEV_NOTE; break; case CMSG_WARN: severity = IDEMSGSEV_WARNING; break; case CMSG_ERRO: severity = IDEMSGSEV_ERROR; break; } IdeMsgInit( &info, severity, cinfo->msgtxt ); IdeMsgSetHelp( &info, "wccerrs.hlp", cinfo->msgnum ); IdeMsgSetMsgNo( &info, cinfo->msgnum ); if( cinfo->fname != NULL ) { IdeMsgSetSrcFile( &info, cinfo->fname ); } if( cinfo->line != 0 ) { IdeMsgSetSrcLine( &info, cinfo->line ); } (*Cbs->PrintWithInfo)( Hdl, &info ); // we are ignoring return for now }
extern void ConsErrMsgVerbatim( char const *line ) { // C compiler call back to a console print to stderr IDEMsgInfo info; IdeMsgInit( &info, IDEMSGSEV_ERROR, line ); (*Cbs->PrintWithInfo)( Hdl, &info ); // we are ignoring return for now }
extern void NoteMsg( char const *line ) { // C compiler call back to print a banner type msg IDEMsgInfo info; IdeMsgInit( &info, IDEMSGSEV_NOTE_MSG, line ); (*Cbs->PrintWithInfo)( Hdl, &info ); // we are ignoring return for now }
static void setPrintInfo( IDEMsgInfo *buf, OutPutInfo *src, char *msg ) /*********************************************************************/ { if( src == NULL ) { IdeMsgInit( buf, IDEMSGSEV_DEBUG, msg ); } else { IdeMsgInit( buf, SeverityMap[src->severity], msg ); if( src->flags & OUTFLAG_FILE ) { IdeMsgSetSrcFile( buf, src->file ); } if( src->flags & OUTFLAG_ERRID ) { IdeMsgSetMsgNo( buf, src->errid ) ; IdeMsgSetHelp( buf, "wrcerrs.hlp", src->errid ); } if( src->flags & OUTFLAG_LINE ) { IdeMsgSetSrcLine( buf, src->lineno ); } } }
static void ideDisplay // DISPLAY USING IDE INTERFACE ( IDEMsgSeverity severity // - message severity , MSG_NUM msgnum // - message number , char* msg // - message , TOKEN_LOCN* msg_locn ) // - message location or NULL { IDECallBacks* cbs; // - pointer to call backs IDEMsgInfo inf; // - message information char *fname; // - file name boolean goes_in_err_file; // - output msg into .err file IdeMsgInit( &inf, severity, msg ); IdeMsgSetMsgNo( &inf, msgnum ); IdeMsgSetHelp( &inf, "wpperrs.hlp", msgnum + 1 ); if( CompFlags.ew_switch_used ) { IdeMsgSetReadable( &inf ); } if( NULL != msg_locn ) { if( msg_locn->src_file != NULL ) { fname = fileName( msg_locn->src_file ); IdeMsgSetSrcFile( &inf, fname ); IdeMsgSetSrcLine( &inf, msg_locn->line ); IdeMsgSetSrcColumn( &inf, msg_locn->column ); } notes_locn = *msg_locn; } goes_in_err_file = FALSE; switch( severity ) { case IDEMSGSEV_WARNING: case IDEMSGSEV_ERROR: case IDEMSGSEV_NOTE: goes_in_err_file = TRUE; break; case IDEMSGSEV_BANNER: case IDEMSGSEV_DEBUG: break; case IDEMSGSEV_NOTE_MSG: if( CompFlags.log_note_msgs ) { goes_in_err_file = TRUE; } break; DbgDefault( "unknown severity" ); } cbs = CompInfo.dll_callbacks; if( goes_in_err_file ) { if( ! ( CompFlags.eq_switch_used && CompFlags.ide_console_output ) ) { (*cbs->PrintWithInfo)( CompInfo.dll_handle, &inf ); } idePrt( CompInfo.dll_handle, &inf ); } else { (*cbs->PrintWithInfo)( CompInfo.dll_handle, &inf ); } }
void Message( char *buff, ... ) { va_list arglist; char msg[ 512 ]; IDEMsgInfo msg_info; if( Options.quiet ) return; va_start( arglist, buff ); _vbprintf( msg, 512, buff, arglist ); if( ideCb ) { IdeMsgInit( &msg_info, IDEMSGSEV_NOTE_MSG, msg ); ideCb->PrintWithInfo( ideHdl, &msg_info ); } va_end( arglist ); }
void FatalError( int str, ... ) { va_list arglist; char buff[ MAX_ERROR_SIZE ]; char msg[ 512 ]; IDEMsgInfo msg_info; va_start( arglist, str ); MsgGet( str, buff ); _vbprintf( msg, 512, buff, arglist ); if( ideCb ) { IdeMsgInit( &msg_info, IDEMSGSEV_ERROR, msg ); ideCb->PrintWithInfo( ideHdl, &msg_info ); } va_end( arglist ); longjmp( Env, 1 ); }
void Warning( int str, ... ) { va_list arglist; char buff[ MAX_ERROR_SIZE ]; char msg[ 512 ]; IDEMsgInfo msg_info; if( Options.quiet ) return; MsgGet( str, buff ); va_start( arglist, str ); _vbprintf( msg, 512, buff, arglist ); if( ideCb ) { IdeMsgInit( &msg_info, IDEMSGSEV_WARNING, msg ); ideCb->PrintWithInfo( ideHdl, &msg_info ); } va_end( arglist ); }