Leaked source code of windows server 2003
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.

230 lines
6.8 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. More.hxx
  5. Abstract:
  6. This module contains the definition for the MORE class, which
  7. implements the DOS5-compatible More pager.
  8. Author:
  9. Ramon Juan San Andres (ramonsa) 24-Apr-1990
  10. Revision History:
  11. --*/
  12. #if !defined( _MORE_ )
  13. #define _MORE_
  14. #include "arg.hxx"
  15. #include "object.hxx"
  16. #include "program.hxx"
  17. //
  18. // Commonly used character constants
  19. //
  20. #define CARRIAGERETURN '\r'
  21. #define LINEFEED '\n'
  22. #define FORMFEED '\f'
  23. //
  24. // Exit levels
  25. //
  26. #define EXIT_NORMAL 0
  27. #define EXIT_ERROR 1
  28. //
  29. // For prompting
  30. //
  31. #define STRING_BUFFER_SIZE 128
  32. //
  33. // Forward references
  34. //
  35. DECLARE_CLASS( ARRAY );
  36. DECLARE_CLASS( FSN_FILE );
  37. DECLARE_CLASS( KEYBOARD );
  38. DECLARE_CLASS( STREAM );
  39. DECLARE_CLASS( WSTRING );
  40. DECLARE_CLASS( PAGER );
  41. DECLARE_CLASS( MORE );
  42. class MORE : public PROGRAM {
  43. public:
  44. DECLARE_CONSTRUCTOR( MORE );
  45. NONVIRTUAL
  46. ~MORE (
  47. );
  48. NONVIRTUAL
  49. BOOLEAN
  50. Initialize (
  51. );
  52. NONVIRTUAL
  53. VOID
  54. DoPaging (
  55. );
  56. private:
  57. NONVIRTUAL
  58. VOID
  59. Construct (
  60. );
  61. NONVIRTUAL
  62. VOID
  63. CheckArgumentConsistency (
  64. );
  65. NONVIRTUAL
  66. VOID
  67. DeallocateThings (
  68. );
  69. NONVIRTUAL
  70. BOOLEAN
  71. DoOption (
  72. IN PFSN_FILE FsnFile,
  73. IN PPAGER Pager,
  74. OUT PULONG LinesInpage,
  75. OUT PBOOLEAN ClearScreen
  76. );
  77. NONVIRTUAL
  78. VOID
  79. GetArgumentsCmd(
  80. );
  81. NONVIRTUAL
  82. VOID
  83. GetArgumentsMore(
  84. );
  85. NONVIRTUAL
  86. VOID
  87. GetRegistryInfo(
  88. );
  89. NONVIRTUAL
  90. VOID
  91. InitializeThings (
  92. );
  93. NONVIRTUAL
  94. VOID
  95. PageStream (
  96. IN PSTREAM Stream,
  97. IN PFSN_FILE FsnFile,
  98. IN ULONG FirstLineToDisplay,
  99. IN ULONG FilesLeft
  100. );
  101. NONVIRTUAL
  102. VOID
  103. ParseArguments(
  104. IN PWSTRING CmdLine,
  105. OUT PARRAY ArgArray
  106. );
  107. NONVIRTUAL
  108. VOID
  109. Prompt (
  110. IN PFSN_FILE FsnFile,
  111. IN PPAGER Pager,
  112. IN BOOLEAN ShowLineNumber,
  113. IN BOOLEAN ShowHelp,
  114. IN MSGID OtherMsg
  115. );
  116. NONVIRTUAL
  117. PWSTRING
  118. QueryMessageString (
  119. IN MSGID MsgId
  120. );
  121. NONVIRTUAL
  122. ULONG
  123. ReadNumber (
  124. );
  125. NONVIRTUAL
  126. VOID
  127. SetArguments(
  128. );
  129. //
  130. // Command-line arguments.
  131. //
  132. BOOLEAN _ExtendedModeSwitch;
  133. BOOLEAN _ClearScreenSwitch;
  134. BOOLEAN _ExpandFormFeedSwitch;
  135. BOOLEAN _SqueezeBlanksSwitch;
  136. BOOLEAN _HelpSwitch;
  137. LONG _StartAtLine;
  138. LONG _TabExp;
  139. PMULTIPLE_PATH_ARGUMENT _FilesArgument;
  140. //
  141. // String with end-of line delimiters
  142. //
  143. PWSTRING _LineDelimiters;
  144. //
  145. // Strings used while prompting
  146. //
  147. PWSTRING _Percent;
  148. PWSTRING _Line;
  149. PWSTRING _Help;
  150. PWSTRING _OtherPrompt;
  151. //
  152. // Options during paging.
  153. //
  154. PWSTRING _DisplayLinesOption;
  155. PWSTRING _SkipLinesOption;
  156. PWSTRING _NextFileOption;
  157. PWSTRING _ShowLineNumberOption;
  158. PWSTRING _QuitOption;
  159. PWSTRING _Help1Option;
  160. PWSTRING _Help2Option;
  161. //
  162. // The quit flag is true when we want to stop paging
  163. //
  164. BOOLEAN _Quit;
  165. //
  166. // For displaying strings
  167. //
  168. BYTE _StringBuffer0[STRING_BUFFER_SIZE];
  169. BYTE _StringBuffer1[STRING_BUFFER_SIZE];
  170. BYTE _StringBuffer2[STRING_BUFFER_SIZE];
  171. BYTE _StringBuffer3[STRING_BUFFER_SIZE];
  172. //
  173. // The real keyboard
  174. //
  175. PKEYBOARD _Keyboard;
  176. };
  177. #endif // _MORE_