[CMD]: Small refactoring:
[reactos.git] / reactos / base / shell / cmd / console.h
1
2 #pragma once
3
4 /* Cache codepage */
5 extern UINT InputCodePage;
6 extern UINT OutputCodePage;
7
8 // /* Global variables */
9 // extern BOOL bCtrlBreak;
10 // extern BOOL bIgnoreEcho;
11 // extern BOOL bExit;
12
13 VOID ConInDummy (VOID);
14 VOID ConInDisable (VOID);
15 VOID ConInEnable (VOID);
16 VOID ConInFlush (VOID);
17 VOID ConInKey (PINPUT_RECORD);
18 VOID ConInString (LPTSTR, DWORD);
19
20
21 VOID ConOutChar (TCHAR);
22 VOID ConErrChar (TCHAR);
23 VOID ConPrintfV(DWORD, LPTSTR, va_list);
24
25 VOID ConPuts(DWORD nStdHandle, LPTSTR szText);
26 VOID ConPrintf(DWORD nStdHandle, LPTSTR szFormat, ...);
27 VOID ConResPuts(DWORD nStdHandle, UINT resID);
28 VOID ConResPrintf(DWORD nStdHandle, UINT resID, ...);
29 VOID ConFormatMessage(DWORD nStdHandle, DWORD MessageId, ...);
30
31 #define ConOutPuts(szStr) \
32 ConPuts(STD_OUTPUT_HANDLE, (szStr))
33
34 #define ConErrPuts(szStr) \
35 ConPuts(STD_ERROR_HANDLE, (szStr))
36
37 #define ConOutResPuts(uID) \
38 ConResPuts(STD_OUTPUT_HANDLE, (uID))
39
40 #define ConErrResPuts(uID) \
41 ConResPuts(STD_ERROR_HANDLE, (uID))
42
43 #define ConOutPrintf(szStr, ...) \
44 ConPrintf(STD_OUTPUT_HANDLE, (szStr), ##__VA_ARGS__)
45
46 #define ConErrPrintf(szStr, ...) \
47 ConPrintf(STD_ERROR_HANDLE, (szStr), ##__VA_ARGS__)
48
49 #define ConOutResPrintf(uID, ...) \
50 ConResPrintf(STD_OUTPUT_HANDLE, (uID), ##__VA_ARGS__)
51
52 #define ConErrResPrintf(uID, ...) \
53 ConResPrintf(STD_ERROR_HANDLE, (uID), ##__VA_ARGS__)
54
55 #define ConOutFormatMessage(MessageId, ...) \
56 ConFormatMessage(STD_OUTPUT_HANDLE, (MessageId), ##__VA_ARGS__)
57
58 #define ConErrFormatMessage(MessageId, ...) \
59 ConFormatMessage(STD_ERROR_HANDLE, (MessageId), ##__VA_ARGS__)
60
61
62 BOOL ConPrintfVPaging(DWORD nStdHandle, BOOL, LPTSTR, va_list);
63 BOOL ConOutPrintfPaging (BOOL NewPage, LPTSTR, ...);
64 VOID ConOutResPaging(BOOL NewPage, UINT resID);
65
66 SHORT GetCursorX (VOID);
67 SHORT GetCursorY (VOID);
68 VOID GetCursorXY (PSHORT, PSHORT);
69 VOID SetCursorXY (SHORT, SHORT);
70
71 VOID GetScreenSize (PSHORT, PSHORT);
72 VOID SetCursorType (BOOL, BOOL);
73
74
75 #ifdef INCLUDE_CMD_COLOR
76 BOOL ConGetDefaultAttributes(PWORD pwDefAttr);
77 #endif
78
79
80 BOOL ConSetTitle(IN LPCTSTR lpConsoleTitle);
81
82 #ifdef INCLUDE_CMD_BEEP
83 VOID ConRingBell(HANDLE hOutput);
84 #endif
85
86 #ifdef INCLUDE_CMD_CLS
87 VOID ConClearScreen(HANDLE hOutput);
88 #endif
89
90 #ifdef INCLUDE_CMD_COLOR
91 BOOL ConSetScreenColor(HANDLE hOutput, WORD wColor, BOOL bFill);
92 #endif
93
94 // TCHAR cgetchar (VOID);
95 // BOOL CheckCtrlBreak (INT);
96
97 // #define PROMPT_NO 0
98 // #define PROMPT_YES 1
99 // #define PROMPT_ALL 2
100 // #define PROMPT_BREAK 3
101
102 // INT PagePrompt (VOID);
103 // INT FilePromptYN (UINT);
104 // INT FilePromptYNA (UINT);