/******************************************************************************/
/* SAMPLE CONSUMER: consumer.h                                                */
/*                                                                            */
/* COPYRIGHT:                                                                 */
/* ----------                                                                 */
/* Copyright (C) International Business Machines Corp., 1992,1995.            */
/*                                                                            */
/* DISCLAIMER OF WARRANTIES:                                                  */
/* -------------------------                                                  */
/* The following [enclosed] code is sample code created by IBM                */
/* Corporation.  This sample code is not part of any standard IBM product     */
/* and is provided to you solely for the purpose of assisting you in the      */
/* development of your applications.  The code is provided "AS IS",           */
/* without warranty of any kind.  IBM shall not be liable for any damages     */
/* arising out of your use of the sample code, even if they have been         */
/* advised of the possibility of such damages.                                */
/*                                                                            */
/******************************************************************************/
/*                                                                            */
/*  Sample header file for the Event Management Service sample consumer.      */
/*                                                                            */
/*  This header file contains one macro used to handle non-zero status        */
/*  values.  It will display the error associated with the error as well      */
/*  other DCE SVC related error information.                                  */
/*                                                                            */
/******************************************************************************/
#define CHECK_STATUS( _str, _val )                                             \
{                                                                              \
    unsigned char _error_text[80];                                             \
    int _rc;                                                                   \
                                                                               \
    if ((*_val)) {                                                             \
        printf("Error in %s", _str);                                           \
        printf(": %d\n", (*_val));                                             \
        dce_error_inq_text( (unsigned long)(*_val),                            \
                          (unsigned char*)_error_text,                         \
                          &_rc );                                              \
        if ( _rc != 1 ) {                                                      \
            printf("%s\n", _error_text);                                       \
        }                                                                      \
        exit(1);                                                               \
    }                                                                          \
}
