mirror of
https://github.com/reactos/reactos.git
synced 2025-06-08 02:40:32 +00:00
[CONUTILS][CMD] Add and use a helper ConStdStreamsSetCacheCodePage() macro instead of repeatedly calling ConStreamSetCacheCodePage() on the standard streams.
This commit is contained in:
parent
f268430c05
commit
35f499e52f
3 changed files with 16 additions and 7 deletions
|
@ -529,9 +529,7 @@ Execute(LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd)
|
||||||
OutputCodePage = uNewOutputCodePage;
|
OutputCodePage = uNewOutputCodePage;
|
||||||
|
|
||||||
/* Update the streams codepage cache as well */
|
/* Update the streams codepage cache as well */
|
||||||
ConStreamSetCacheCodePage(StdIn , InputCodePage );
|
ConStdStreamsSetCacheCodePage(InputCodePage, OutputCodePage);
|
||||||
ConStreamSetCacheCodePage(StdOut, OutputCodePage);
|
|
||||||
ConStreamSetCacheCodePage(StdErr, OutputCodePage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore the original console title */
|
/* Restore the original console title */
|
||||||
|
|
|
@ -321,9 +321,7 @@ INT cmd_start (LPTSTR Rest)
|
||||||
OutputCodePage = uNewOutputCodePage;
|
OutputCodePage = uNewOutputCodePage;
|
||||||
|
|
||||||
/* Update the streams codepage cache as well */
|
/* Update the streams codepage cache as well */
|
||||||
ConStreamSetCacheCodePage(StdIn , InputCodePage );
|
ConStdStreamsSetCacheCodePage(InputCodePage, OutputCodePage);
|
||||||
ConStreamSetCacheCodePage(StdOut, OutputCodePage);
|
|
||||||
ConStreamSetCacheCodePage(StdErr, OutputCodePage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -136,14 +136,27 @@ ConStreamSetMode(
|
||||||
IN UINT CacheCodePage OPTIONAL);
|
IN UINT CacheCodePage OPTIONAL);
|
||||||
|
|
||||||
#ifdef USE_CRT
|
#ifdef USE_CRT
|
||||||
|
|
||||||
// FIXME!
|
// FIXME!
|
||||||
#warning The ConStreamSetCacheCodePage function does not make much sense with the CRT!
|
#warning The ConStreamSetCacheCodePage function does not make much sense with the CRT!
|
||||||
|
|
||||||
|
#define ConStdStreamsSetCacheCodePage(InputCodePage, OutputCodePage) NOTHING
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
ConStreamSetCacheCodePage(
|
ConStreamSetCacheCodePage(
|
||||||
IN PCON_STREAM Stream,
|
IN PCON_STREAM Stream,
|
||||||
IN UINT CacheCodePage);
|
IN UINT CacheCodePage);
|
||||||
#endif
|
|
||||||
|
#define ConStdStreamsSetCacheCodePage(InputCodePage, OutputCodePage) \
|
||||||
|
do { \
|
||||||
|
ConStreamSetCacheCodePage(StdIn , (InputCodePage )); \
|
||||||
|
ConStreamSetCacheCodePage(StdOut, (OutputCodePage)); \
|
||||||
|
ConStreamSetCacheCodePage(StdErr, (OutputCodePage)); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#endif /* defined(USE_CRT) */
|
||||||
|
|
||||||
HANDLE
|
HANDLE
|
||||||
ConStreamGetOSHandle(
|
ConStreamGetOSHandle(
|
||||||
|
|
Loading…
Reference in a new issue