[CONUTILS] Make the headers C++ compatible.
[reactos.git] / sdk / lib / conutils / pager.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Console Utilities Library
4 * FILE: sdk/lib/conutils/pager.h
5 * PURPOSE: Console/terminal paging functionality.
6 * PROGRAMMERS: - Hermes Belusca-Maito (for the library);
7 * - All programmers who wrote the different console applications
8 * from which I took those functions and improved them.
9 */
10
11 #ifndef __PAGER_H__
12 #define __PAGER_H__
13
14 #ifndef _UNICODE
15 #error The ConUtils library at the moment only supports compilation with _UNICODE defined!
16 #endif
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22
23 // #include <wincon.h>
24
25
26 typedef struct _CON_PAGER
27 {
28 PCON_SCREEN Screen;
29
30 // TODO: Add more properties. Maybe those extra parameters
31 // of PAGE_PROMPT could go there?
32
33 /* Used to count number of lines since last pause */
34 DWORD LineCount;
35 } CON_PAGER, *PCON_PAGER;
36
37 #define INIT_CON_PAGER(pScreen) {(pScreen), 0}
38
39 #define InitializeConPager(pPager, pScreen) \
40 do { \
41 (pPager)->Screen = (pScreen); \
42 (pPager)->LineCount = 0; \
43 } while (0)
44
45 // Pager, Done, Total
46 typedef BOOL (__stdcall *PAGE_PROMPT)(IN PCON_PAGER, IN DWORD, IN DWORD);
47
48 BOOL
49 ConWritePaging(
50 IN PCON_PAGER Pager,
51 IN PAGE_PROMPT PagePrompt,
52 IN BOOL StartPaging,
53 IN PTCHAR szStr,
54 IN DWORD len);
55
56 BOOL
57 ConPutsPaging(
58 IN PCON_PAGER Pager,
59 IN PAGE_PROMPT PagePrompt,
60 IN BOOL StartPaging,
61 IN LPTSTR szStr);
62
63 BOOL
64 ConResPagingEx(
65 IN PCON_PAGER Pager,
66 IN PAGE_PROMPT PagePrompt,
67 IN BOOL StartPaging,
68 IN HINSTANCE hInstance OPTIONAL,
69 IN UINT uID);
70
71 BOOL
72 ConResPaging(
73 IN PCON_PAGER Pager,
74 IN PAGE_PROMPT PagePrompt,
75 IN BOOL StartPaging,
76 IN UINT uID);
77
78 #ifdef __cplusplus
79 }
80 #endif
81 #endif /* __PAGER_H__ */