home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Collection - Online Library - January 1996 / CKITOS2196.ISO / diskette / gg244090.dsk / unc.dsk / CHAPTER.12 / ERRCHK.H next >
C/C++ Source or Header  |  1993-08-04  |  727b  |  22 lines

  1. # ifndef _ERRCHK_H
  2. # define _ERRCHK_H
  3.  
  4. # ifndef _H_STDIO
  5. # include <stdio.h>
  6. # endif
  7.  
  8. char            dce_error_string[256];
  9. error_status_t  error_inq_st;
  10.  
  11. # define ERRCHK(x)                                                 \
  12.         if ( (x) != error_status_ok ) {                            \
  13.            fprintf( stderr, "%s: error in %s[%d]:", argv[0] ,      \
  14.                             __FILE__ , __LINE__ - 1 );             \
  15.            dce_error_inq_text(x, dce_error_string, &error_inq_st); \
  16.            fprintf(stderr, " %s.\n", dce_error_string);            \
  17.            fflush(stderr);                                         \
  18.            exit ( x );                                             \
  19.         }
  20.  
  21. # endif
  22.