third_party/inchi/INCHI_BASE/src/ichiprt1.c
int OutputINChIPlainError( INCHI_IOSTREAM *out_file,
                           char           *pErrorText,
                           int            bError )
{
    /* char szBuf[64]; */
    const char *pErr;
    char *szErrorText = pErrorText;
    int nEstLen, ret = 0;

    switch (bError)
    {
        case _IS_WARNING:
            pErr = x_warn;
            break;
        case _IS_ERROR:
            pErr = x_err;
            break;
        default: /*  _IS_FATAL */
            pErr = x_ferr;
            break;
    }
                  /* <%s: >, x_message */
    nEstLen = (int) ( sizeof( x_message ) - 1 + 1 + 1
                  /* <%s=\"%s\">, x_type, pErr */
                  + sizeof( x_type ) - 1 + 1 + 1 + strlen( pErr ) + 1
                  /* < %s=\"%s\"\n>, x_text, szErrorText */
                  + 1 + sizeof( x_text ) - 1 + 1 + 1 + strlen( szErrorText ) + 1 + 1 );

    inchi_ios_print( out_file,
                     "%s: %s=\"%s\" %s=\"%s\"",
                     x_message, x_type, pErr, x_text, szErrorText );
#ifdef TARGET_LIB_FOR_WINCHI
    inchi_ios_print( out_file, "\n" );
#endif
    ret = 1;

    return ret;
}
/****************************************************************************
  Print error message (plain text)
****************************************************************************/
Print error message (plain text)
Print error message ( plain text )
int OutputINChIPlainError( INCHI_IOSTREAM *out_file,
                           char           *pErrorText,
                           int            bError )
{
    const char *pErr;
    char *szErrorText = pErrorText;
    int nEstLen, ret = 0;
    switch (bError)
    {
        case _IS_WARNING:
            pErr = x_warn;
            break;
        case _IS_ERROR:
            pErr = x_err;
            break;
        default: 
            pErr = x_ferr;
            break;
    }
    nEstLen = (int) ( sizeof( x_message ) - 1 + 1 + 1
                  + sizeof( x_type ) - 1 + 1 + 1 + strlen( pErr ) + 1
                  + 1 + sizeof( x_text ) - 1 + 1 + 1 + strlen( szErrorText ) + 1 + 1 );
    inchi_ios_print( out_file,
                     "%s: %s=\"%s\" %s=\"%s\"",
                     x_message, x_type, pErr, x_text, szErrorText );
#ifdef TARGET_LIB_FOR_WINCHI
    inchi_ios_print( out_file, "\n" );
#endif
    ret = 1;
    return ret;
}
int OutputINChIPlainError ( INCHI_IOSTREAM * out_file , char * pErrorText , int bError ) { const char * pErr ; char * szErrorText = pErrorText ; int nEstLen , ret = 0 ; switch ( bError ) { case _IS_WARNING : pErr = x_warn ; break ; case _IS_ERROR : pErr = x_err ; break ; default : pErr = x_ferr ; break ; } nEstLen = ( int ) ( sizeof ( x_message ) - 1 + 1 + 1 + sizeof ( x_type ) - 1 + 1 + 1 + strlen ( pErr ) + 1 + 1 + sizeof ( x_text ) - 1 + 1 + 1 + strlen ( szErrorText ) + 1 + 1 ) ; inchi_ios_print ( out_file , " \" \" \" \" " , x_message , x_type , pErr , x_text , szErrorText ) ; #ifdef TARGET_LIB_FOR_WINCHI inchi_ios_print ( out_file , " \n " ) ; #endif ret = 1 ; return ret ; }
Print error message (plain text)
Print error message ( plain text )
/* char szBuf[64]; */ /*  _IS_FATAL */ /* <%s: >, x_message */ /* <%s=\"%s\">, x_type, pErr */ /* < %s=\"%s\"\n>, x_text, szErrorText */