2016-10-22 21:54:29 +00:00
|
|
|
/*
|
2017-10-16 21:58:23 +00:00
|
|
|
* PROJECT: ReactOS Console Utilities Library
|
|
|
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
|
|
|
* PURPOSE: Console/terminal paging functionality.
|
|
|
|
* COPYRIGHT: Copyright 2017-2018 ReactOS Team
|
|
|
|
* Copyright 2017-2018 Hermes Belusca-Maito
|
2016-10-22 21:54:29 +00:00
|
|
|
*/
|
|
|
|
|
2018-02-01 23:35:08 +00:00
|
|
|
/**
|
|
|
|
* @file pager.h
|
|
|
|
* @ingroup ConUtils
|
|
|
|
*
|
|
|
|
* @brief Console/terminal paging functionality.
|
|
|
|
**/
|
|
|
|
|
2016-10-22 21:54:29 +00:00
|
|
|
#ifndef __PAGER_H__
|
|
|
|
#define __PAGER_H__
|
|
|
|
|
2017-10-16 21:58:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
2016-10-22 21:54:29 +00:00
|
|
|
#ifndef _UNICODE
|
|
|
|
#error The ConUtils library at the moment only supports compilation with _UNICODE defined!
|
|
|
|
#endif
|
|
|
|
|
2018-01-27 14:48:59 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-10-22 21:54:29 +00:00
|
|
|
|
|
|
|
// #include <wincon.h>
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _CON_PAGER
|
|
|
|
{
|
|
|
|
PCON_SCREEN Screen;
|
|
|
|
|
|
|
|
// TODO: Add more properties. Maybe those extra parameters
|
|
|
|
// of PAGE_PROMPT could go there?
|
|
|
|
|
|
|
|
/* Used to count number of lines since last pause */
|
|
|
|
DWORD LineCount;
|
|
|
|
} CON_PAGER, *PCON_PAGER;
|
|
|
|
|
2017-10-01 16:03:44 +00:00
|
|
|
#define INIT_CON_PAGER(pScreen) {(pScreen), 0}
|
|
|
|
|
|
|
|
#define InitializeConPager(pPager, pScreen) \
|
|
|
|
do { \
|
|
|
|
(pPager)->Screen = (pScreen); \
|
|
|
|
(pPager)->LineCount = 0; \
|
|
|
|
} while (0)
|
|
|
|
|
2017-10-16 21:58:23 +00:00
|
|
|
|
2016-10-22 21:54:29 +00:00
|
|
|
// Pager, Done, Total
|
|
|
|
typedef BOOL (__stdcall *PAGE_PROMPT)(IN PCON_PAGER, IN DWORD, IN DWORD);
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
ConWritePaging(
|
|
|
|
IN PCON_PAGER Pager,
|
|
|
|
IN PAGE_PROMPT PagePrompt,
|
|
|
|
IN BOOL StartPaging,
|
|
|
|
IN PTCHAR szStr,
|
|
|
|
IN DWORD len);
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
ConPutsPaging(
|
|
|
|
IN PCON_PAGER Pager,
|
|
|
|
IN PAGE_PROMPT PagePrompt,
|
|
|
|
IN BOOL StartPaging,
|
|
|
|
IN LPTSTR szStr);
|
|
|
|
|
2017-10-01 16:03:44 +00:00
|
|
|
BOOL
|
|
|
|
ConResPagingEx(
|
|
|
|
IN PCON_PAGER Pager,
|
|
|
|
IN PAGE_PROMPT PagePrompt,
|
|
|
|
IN BOOL StartPaging,
|
|
|
|
IN HINSTANCE hInstance OPTIONAL,
|
|
|
|
IN UINT uID);
|
|
|
|
|
2016-10-22 21:54:29 +00:00
|
|
|
BOOL
|
|
|
|
ConResPaging(
|
|
|
|
IN PCON_PAGER Pager,
|
|
|
|
IN PAGE_PROMPT PagePrompt,
|
|
|
|
IN BOOL StartPaging,
|
|
|
|
IN UINT uID);
|
|
|
|
|
2018-01-27 14:48:59 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2017-10-16 21:58:23 +00:00
|
|
|
|
2016-10-22 21:54:29 +00:00
|
|
|
#endif /* __PAGER_H__ */
|
2017-10-16 21:58:23 +00:00
|
|
|
|
|
|
|
/* EOF */
|