X25AM Programming Manual

PTP Applications
X25AM Programming Manual527201-001
3-86
Text of C Example
}; /* if read() */
} /* PromptTerminal() */
/*
*----------------------------------------------------------------------
* REPORT_COMM_ERROR FUNCTION
* --------------------------
*
* This function is called if there are errors reported by the Guardian
* I/O routines (e.g. READ, WRITE, etc). It will do the following:
*
* 1) calls PrintErrorMessage to display the corresponding text messages
* of the given error code;
* 2) displays ? prompt on terminal for input;
* 3) posts a new read on the X.25 line if the error code was 0.
*
*----------------------------------------------------------------------
*/
void ReportCommError( short error )
{
PrintErrorMessage( error );
PromptTerminal( );
if( READ( comm_file, comm_buffR, MAX_COMM_READ, , READ_TAG ) != CCE )
{
FILEINFO( comm_file, &error );
/*
*--------------------------------------------------------------
* Display appropriate error messages on the terminal and then
* terminate the program execution.
*--------------------------------------------------------------
*/
PrintErrorMessage( error );
exit( EXIT_FAILURE );
}; /* if read() */
} /* ReportCommError() */