home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / retcode.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  2.1 KB  |  62 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. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  10. #define _RETCODE_H
  11.  
  12. //$--_Rc-----------------------------------------------------------------------
  13. //  Available return codes.
  14. // ----------------------------------------------------------------------------
  15. typedef enum _rc {
  16.     RC_SUCCESS = 0,   
  17.     RC_ERROR,               // general error
  18.     RC_PROTOCOL,            // protocol error 
  19.     RC_SYNTAX,              // syntax error
  20.     RC_EOF,                 // end of file
  21.     RC_IMPLEMENTATION,      // not implemented yet
  22.     RC_SOFTWARE,            // error in software
  23.     RC_CONFIG,              // configuration error
  24.     RC_MEMORY,              // memory allocation error 
  25.     RC_CONTENTION,          // contention error
  26.     RC_NOTFOUND,            // not found
  27.     RC_DISKSPACE,           // out of disk space
  28.     RC_SHUTDOWN,            // service shutdown
  29.     RC_EXPIRED,             // expired
  30.     RC_TIMEOUT,             // timeout
  31.     RC_INVALID_PARAMETER,   // invalid parameter
  32.     RC_LAST                 // all errors are less than this
  33. } RC;
  34.  
  35. //$--_Ec-----------------------------------------------------------------------
  36. //  Available exit codes.
  37. // ----------------------------------------------------------------------------
  38. typedef enum _ec {
  39.     EC_SUCCESS = 0,   
  40.     EC_ERROR,           // general error
  41.     EC_LAST             // all errors are less than this
  42. } EC;
  43.  
  44. // ----------------------------------------------------------------------------
  45. //  Macros.
  46. // ----------------------------------------------------------------------------
  47.  
  48. #define RC_SUCCEEDED(x) \
  49.     ((x) == RC_SUCCESS)
  50.  
  51. #define RC_FAILED(x) \
  52.     ((x) != RC_SUCCESS)
  53.  
  54. #define EC_SUCCEEDED(x) \
  55.     ((x) == EC_SUCCESS)
  56.  
  57. #define EC_FAILED(x) \
  58.     ((x) != EC_SUCCESS)
  59.  
  60. #pragma option pop /*P_O_Pop*/
  61. #endif
  62.