ReactOS  0.4.14-dev-297-g23e575c
pager.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Console Utilities Library
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: Console/terminal paging functionality.
5  * COPYRIGHT: Copyright 2017-2018 ReactOS Team
6  * Copyright 2017-2018 Hermes Belusca-Maito
7  */
8 
16 #ifndef __PAGER_H__
17 #define __PAGER_H__
18 
19 #pragma once
20 
21 #ifndef _UNICODE
22 #error The ConUtils library at the moment only supports compilation with _UNICODE defined!
23 #endif
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 // #include <wincon.h>
31 
32 
33 typedef struct _CON_PAGER
34 {
36 
37  // TODO: Add more properties. Maybe those extra parameters
38  // of PAGE_PROMPT could go there?
39 
40  /* Used to count number of lines since last pause */
43 
44 #define INIT_CON_PAGER(pScreen) {(pScreen), 0}
45 
46 #define InitializeConPager(pPager, pScreen) \
47 do { \
48  (pPager)->Screen = (pScreen); \
49  (pPager)->LineCount = 0; \
50 } while (0)
51 
52 
53  // Pager, Done, Total
55 
56 BOOL
58  IN PCON_PAGER Pager,
60  IN BOOL StartPaging,
61  IN PTCHAR szStr,
62  IN DWORD len);
63 
64 BOOL
66  IN PCON_PAGER Pager,
68  IN BOOL StartPaging,
69  IN LPTSTR szStr);
70 
71 BOOL
73  IN PCON_PAGER Pager,
75  IN BOOL StartPaging,
77  IN UINT uID);
78 
79 BOOL
81  IN PCON_PAGER Pager,
83  IN BOOL StartPaging,
84  IN UINT uID);
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* __PAGER_H__ */
91 
92 /* EOF */
#define IN
Definition: typedefs.h:38
static BOOL __stdcall PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total)
Definition: more.c:51
BOOL ConPutsPaging(IN PCON_PAGER Pager, IN PAGE_PROMPT PagePrompt, IN BOOL StartPaging, IN LPTSTR szStr)
Definition: pager.c:120
#define BOOL
Definition: nt_native.h:43
#define DWORD
Definition: nt_native.h:44
CHAR * LPTSTR
Definition: xmlstorage.h:192
PCON_SCREEN Screen
Definition: pager.h:35
HINSTANCE hInstance
Definition: charmap.c:20
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL ConWritePaging(IN PCON_PAGER Pager, IN PAGE_PROMPT PagePrompt, IN BOOL StartPaging, IN PTCHAR szStr, IN DWORD len)
Definition: pager.c:38
BOOL(__stdcall * PAGE_PROMPT)(IN PCON_PAGER, IN DWORD, IN DWORD)
Definition: pager.h:54
unsigned long DWORD
Definition: ntddk_ex.h:95
#define __stdcall
Definition: typedefs.h:25
GLenum GLsizei len
Definition: glext.h:6722
struct _CON_PAGER * PCON_PAGER
unsigned int UINT
Definition: ndis.h:50
DWORD LineCount
Definition: pager.h:41
BOOL ConResPagingEx(IN PCON_PAGER Pager, IN PAGE_PROMPT PagePrompt, IN BOOL StartPaging, IN HINSTANCE hInstance OPTIONAL, IN UINT uID)
Definition: pager.c:137
struct _CON_PAGER CON_PAGER
BOOL ConResPaging(IN PCON_PAGER Pager, IN PAGE_PROMPT PagePrompt, IN BOOL StartPaging, IN UINT uID)
Definition: pager.c:155
char * PTCHAR
Definition: ntbasedef.h:483
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68