Пример #1
0
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
}
Пример #2
0
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 );
    }
}
Пример #3
0
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 );
        }
    }
}