X25AM Programming Manual

PTP Applications
X25AM Programming Manual527201-001
3-84
Text of C Example
*------------------------------------------------------------------
* Step 4: Prompt the user for terminal input.
*------------------------------------------------------------------
*/
PromptTerminal( );
} /* InitializeIO () */
/*
*-----------------------------------------------------------------------
* PRINT_ERROR_MESSAGE FUNCTION
* ----------------------------
*
* This function looks up the given error code on its internal table, and
* then prints out the corresponding text message for that error. It will
* terminate the program execution unless the error code is 0.
*
*-----------------------------------------------------------------------
*/
#define TOTAL_ERR_MSG 9
void PrintErrorMessage( short error )
{
typedef struct error_info {
short err_code;
char *err_msg;
} ERROR_INFO;
short index;
static ERROR_INFO error_msg[ TOTAL_ERR_MSG ] = {
{ 0, "0: NO ERROR OR NOT A COMM ERROR" },
{ 1, "1: END OF FILE" },
{ 2, "2: INVALID OPERATION" },
{ 14, "14: DEVICE DOES NOT EXIST" },
{ 21, "21: ILLEGAL COUNT PARAMETERS IN WRITE/READ REQUEST" },
{ 28, "28: NUMBER OF OUTSTANDING OPERATIONS > OPEN REQUEST" },
{ 33, "33: X.25 CAN NOT OBTAIN I/O POOL FOR THE REQUEST" },
{ 122, "122: REQUEST ABORTED, POSSIBLE DATA LOSS DUE TO RESET" },
{ 140, "140: MODEM ERROR" }
}; /* error_msg */
for( index=0; index < TOTAL_ERR_MSG ; index++ )
{