Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. program.hxx
  5. Abstract:
  6. Author:
  7. David J. Gilman (davegi) 02-Mar-1991
  8. Environment:
  9. ULIB, User Mode
  10. --*/
  11. #if ! defined( _PROGRAM_ )
  12. #define _PROGRAM_
  13. #include "rtmsg.h"
  14. #include "smsg.hxx"
  15. DECLARE_CLASS( PATH );
  16. DECLARE_CLASS( PROGRAM );
  17. class PROGRAM : public OBJECT {
  18. public:
  19. NONVIRTUAL
  20. ULIB_EXPORT
  21. BOOLEAN
  22. Initialize (
  23. IN MSGID UsageMsg DEFAULT MSG_UTILS_HELP,
  24. IN MSGID FatalMsg DEFAULT MSG_UTILS_ERROR_FATAL,
  25. IN ULONG FatalLevel DEFAULT 1
  26. );
  27. NONVIRTUAL
  28. ULIB_EXPORT
  29. ~PROGRAM (
  30. );
  31. VIRTUAL
  32. ULIB_EXPORT
  33. BOOLEAN
  34. DisplayMessage (
  35. IN MSGID Message,
  36. IN MESSAGE_TYPE Type DEFAULT NORMAL_MESSAGE
  37. ) CONST;
  38. VIRTUAL
  39. ULIB_EXPORT
  40. BOOLEAN
  41. DisplayMessage (
  42. IN MSGID Message,
  43. IN MESSAGE_TYPE Type,
  44. IN PSTR Format,
  45. IN ...
  46. ) CONST;
  47. STATIC
  48. ULIB_EXPORT
  49. VOID
  50. ExitProgram (
  51. ULONG Level
  52. );
  53. VIRTUAL
  54. ULIB_EXPORT
  55. VOID
  56. Fatal (
  57. ) CONST;
  58. VIRTUAL
  59. ULIB_EXPORT
  60. VOID
  61. Fatal (
  62. IN ULONG ErrorLevel,
  63. IN MSGID Message,
  64. IN PSTR Format,
  65. IN ...
  66. ) CONST;
  67. VIRTUAL
  68. ULIB_EXPORT
  69. PSTREAM
  70. GetStandardInput (
  71. );
  72. VIRTUAL
  73. ULIB_EXPORT
  74. PSTREAM
  75. GetStandardOutput (
  76. );
  77. VIRTUAL
  78. ULIB_EXPORT
  79. PSTREAM
  80. GetStandardError (
  81. );
  82. VIRTUAL
  83. ULIB_EXPORT
  84. VOID
  85. Usage (
  86. ) CONST;
  87. STATIC
  88. PPATH
  89. QueryImagePath (
  90. );
  91. VIRTUAL
  92. ULIB_EXPORT
  93. VOID
  94. ValidateVersion (
  95. IN MSGID InvalidVersionMsg DEFAULT MSG_UTILS_ERROR_INVALID_VERSION,
  96. IN ULONG ErrorLevel DEFAULT 1
  97. ) CONST;
  98. protected:
  99. ULIB_EXPORT
  100. DECLARE_CONSTRUCTOR( PROGRAM );
  101. STREAM_MESSAGE _Message; // Message stream
  102. PSTREAM _Standard_Input; // Standard input
  103. PSTREAM _Standard_Output; // Standard output
  104. PSTREAM _Standard_Error; // Standard error
  105. private:
  106. MSGID _UsageMsg; // Usage message id.
  107. MSGID _FatalMsg; // Fatal message id.
  108. ULONG _FatalLevel; // Fatal error level
  109. };
  110. #endif // _PROGRAM_