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.

142 lines
2.1 KiB

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