home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / retcode.h < prev    next >
Text File  |  1998-04-25  |  2KB  |  60 lines

  1. // --retcode.h------------------------------------------------------------------
  2. //
  3. // Copyright (c) Microsoft Corp. 1986-1996. All Rights Reserved.
  4. //
  5. //  Header file for return codes and exit codes.
  6. // 
  7. // -----------------------------------------------------------------------------
  8. #if !defined(_RETCODE_H)
  9. #define _RETCODE_H
  10.  
  11. //$--_Rc-----------------------------------------------------------------------
  12. //  Available return codes.
  13. // ----------------------------------------------------------------------------
  14. typedef enum _rc {
  15.     RC_SUCCESS = 0,   
  16.     RC_ERROR,               // general error
  17.     RC_PROTOCOL,            // protocol error 
  18.     RC_SYNTAX,              // syntax error
  19.     RC_EOF,                 // end of file
  20.     RC_IMPLEMENTATION,      // not implemented yet
  21.     RC_SOFTWARE,            // error in software
  22.     RC_CONFIG,              // configuration error
  23.     RC_MEMORY,              // memory allocation error 
  24.     RC_CONTENTION,          // contention error
  25.     RC_NOTFOUND,            // not found
  26.     RC_DISKSPACE,           // out of disk space
  27.     RC_SHUTDOWN,            // service shutdown
  28.     RC_EXPIRED,             // expired
  29.     RC_TIMEOUT,             // timeout
  30.     RC_INVALID_PARAMETER,   // invalid parameter
  31.     RC_LAST                 // all errors are less than this
  32. } RC;
  33.  
  34. //$--_Ec-----------------------------------------------------------------------
  35. //  Available exit codes.
  36. // ----------------------------------------------------------------------------
  37. typedef enum _ec {
  38.     EC_SUCCESS = 0,   
  39.     EC_ERROR,           // general error
  40.     EC_LAST             // all errors are less than this
  41. } EC;
  42.  
  43. // ----------------------------------------------------------------------------
  44. //  Macros.
  45. // ----------------------------------------------------------------------------
  46.  
  47. #define RC_SUCCEEDED(x) \
  48.     ((x) == RC_SUCCESS)
  49.  
  50. #define RC_FAILED(x) \
  51.     ((x) != RC_SUCCESS)
  52.  
  53. #define EC_SUCCEEDED(x) \
  54.     ((x) == EC_SUCCESS)
  55.  
  56. #define EC_FAILED(x) \
  57.     ((x) != EC_SUCCESS)
  58.  
  59. #endif
  60.