Beispiel #1
0
/*
 * Writes an error message to the error file.
 *
 * @param errstr specifies the error message
 */
void writeError( const char* errstr )
{
    FILE* ferr = getErrorFile( 1 );
    if ( ferr != NULL )
    {
        fputs( errstr, ferr );
        fflush( ferr );
    }
}
Beispiel #2
0
int main(void) {
    int result;
    error err = calc(10, 20, result);
    if (err != error::success) {
        printf("%s:%d: %s\n",
                getErrorFile().c_str(), getErrorLine(), getErrorMessage(err));
    } else {
        printf("No error\n");
    }
    return 0;
}
Beispiel #3
0
/*
 * Closes the error file.
 */
void closeErrorFile()
{
    FILE* ferr = getErrorFile( 0 );
    if ( ferr != NULL )
        fclose( ferr );
}