/*************************************************************************** * file: check_status.h * * This header file defines the CHECK_STATUS macro. This is taken from * O'Reilly book, p. 280. It is copied exactly out of the book; the * modifications I made in formatting made it not compile; go figure. ****************************************************************************/ #include #include /* required to call dce_error_inq_text routine */ #include /* needed if application uses threads */ #include /* needed if application uses exception handlers */ #define RESUME 0 #define ABORT 1 #define CHECK_STATUS(input_status, comment, action) \ { \ if(input_status != rpc_s_ok) { \ dce_error_inq_text(input_status, error_string, &error_stat); \ fprintf(stderr, "%s %s\n", comment, error_string); \ if(action == ABORT) \ exit(1); \ } \ } static int error_stat; static unsigned char error_string[dce_c_error_string_len]; void exit();