[CONUTILS:PAGER][MORE] Code style/formatting.

- Shorten the names of the flags: CON_PAGER_FLAG_*** --> CON_PAGER_***.
- Reorder few members in the CON_PAGER pager structure where they make sense.
- ScreenColumns, ScreenRows --> PageColumns, PageRows: keeping the open
  possibility for having a pager controlling a region of different size
  than the screen.
- Add doxygen documentation for ConWritePaging().
This commit is contained in:
Hermès Bélusca-Maïto 2021-06-27 02:23:12 +02:00
parent 1c7f3476a0
commit f74a3f6e29
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 77 additions and 49 deletions

View file

@ -88,7 +88,8 @@ static BOOL IsBlankLine(IN PCWCH line, IN DWORD cch)
return TRUE;
}
static BOOL __stdcall
static BOOL
__stdcall
MorePagerLine(
IN OUT PCON_PAGER Pager,
IN PCWCH line,
@ -100,7 +101,7 @@ MorePagerLine(
{
if (Pager->lineno < s_nNextLineNo)
{
Pager->dwFlags |= CON_PAGER_FLAG_DONT_OUTPUT;
Pager->dwFlags |= CON_PAGER_DONT_OUTPUT;
s_bPrevLineIsBlank = FALSE;
return TRUE; /* Don't output */
}
@ -113,7 +114,7 @@ MorePagerLine(
{
if (s_bPrevLineIsBlank)
{
Pager->dwFlags |= CON_PAGER_FLAG_DONT_OUTPUT;
Pager->dwFlags |= CON_PAGER_DONT_OUTPUT;
return TRUE; /* Don't output */
}
@ -981,9 +982,9 @@ int wmain(int argc, WCHAR* argv[])
}
Pager.PagerLine = MorePagerLine;
Pager.dwFlags |= CON_PAGER_FLAG_EXPAND_TABS;
Pager.dwFlags |= CON_PAGER_EXPAND_TABS;
if (s_dwFlags & FLAG_P)
Pager.dwFlags |= CON_PAGER_FLAG_EXPAND_FF;
Pager.dwFlags |= CON_PAGER_EXPAND_FF;
Pager.nTabWidth = s_nTabWidth;
/* Special case where we run 'MORE' without any argument: we use STDIN */