Header File

This is the C language header file used to define error code variables for the sample error routine, SRVERROR. Compile this header file with both the sample client and server programs included in this book.

 /********************************************************************/
 /*                                                                  */
 /*                     SRVERROR HEADER FILE                         */
 /*                                                                  */
 /* This is the header file for the sample error routine, SRVERROR.  */
 /*                                                                  */
 /* The calling program passes to SRVERROR information that          */
 /* indicates the type of error that occurred and the expected and   */
 /* actual value for the returned parameter which was in error.      */
 /* This information is passed in the structure described below.     */
 /*                                                                  */
 /* SRVERROR examines the information, logs the error, if            */
 /* appropriate, and returns one of the following return codes:      */
 /*                                                                  */
 /*  no_server_error - indicates no serious error has occurred and   */
 /*                    processing should continue normally.          */
 /*                                                                  */
 /*  conversation_failure - indicates a failure in processing the    */
 /*                         conversation.  No further processing     */
 /*                         should be done for this conversation.    */
 /*                         If the calling program is a server,      */
 /*                         the program does not end because of      */
 /*                         this error.                              */
 /*                                                                  */
 /*  server_error - indicates a failure in processing for the server.*/
 /*                 Server processing should be terminated.          */
 /*                                                                  */
 /********************************************************************/
int srverror();
#define no_server_error                             0
#define conversation_failure                        4
#define server_failure                              8
 /********************************************************************/
 /*               STRUCTURE FOR COMMUNICATING ERRORS                 */
 /*                                                                  */
 /*   This data structure is passed to the SRVERROR function         */
 /*   to describe the error encountered.  The first component        */
 /*   of the structure is the error_type, which is a numeric         */
 /*   value that describes the APPC callable service that            */
 /*   received an unexpected result and the parameter on             */
 /*   the call that appears to be in error.                          */
 /*                                                                  */
 /*   Following the error_type indicator are the expected value      */
 /*   of the parameter apparently in error and the actual            */
 /*   value returned by the call.  In the case of numeric            */
 /*   parameters, the values are passed in the structure.            */
 /*   In the case of character parameters, a pointer to the          */
 /*   character string is passed.                                    */
 /*                                                                  */
 /********************************************************************/
  struct {
          int problem;
          union {
                struct {
                       long int expected_return_code;
                       long int actual_return_code;
                       } rc_problem;
                struct {
                       long int expected_reason_code;
                       long int actual_reason_code;
                       } reason_problem;
                struct {
                       char *expected_data;
                       char *actual_data;
                       } data_problem;
                struct {
                       long int expected_status;
                       long int actual_status;
                       } status_problem;
                struct {
                       long int expected_data_rcv;
                       long int actual_data_rcv;
                       } data_rcv_problem;
                struct {
                       long int expected_length;
                       long int actual_length;
                       } length_problem;
                } error_reason;
         } error_description;
 #define ATBRFA2_RET_CODE_ERROR                    168
 #define ATBRAL2_RET_CODE_ERROR                    176
 #define ATBRAL2_REASON_CODE_ERROR                 177
 #define ATBURA2_RET_CODE_ERROR                    188
 #define CMALLC_RET_CODE_ERROR                     202
 #define CMDEAL_RET_CODE_ERROR                     206
 #define CMINIT_RET_CODE_ERROR                     218
 #define CMRCV_BUFFER_ERROR                        220
 #define CMRCV_DATA_RCV_ERROR                      221
 #define CMRCV_RCVD_LEN_ERROR                      222
 #define CMRCV_STATUS_ERROR                        223
 #define CMRCV_RET_CODE_ERROR                      225
 #define CMSEND_RET_CODE_ERROR                     228