ReactOS  0.4.15-dev-2522-g9e0a3cd
outstream.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: Provides basic abstraction wrappers around CRT streams or
5  * Win32 console API I/O functions, to deal with i18n + Unicode
6  * related problems.
7  * COPYRIGHT: Copyright 2017-2018 ReactOS Team
8  * Copyright 2017-2018 Hermes Belusca-Maito
9  */
10 
18 #ifndef __OUTSTREAM_H__
19 #define __OUTSTREAM_H__
20 
21 #pragma once
22 
23 /*
24  * Enable this define if you want to only use CRT functions to output
25  * UNICODE stream to the console, as in the way explained by
26  * http://archives.miloush.net/michkap/archive/2008/03/18/8306597.html
27  */
29 // #define USE_CRT
30 
31 #ifndef _UNICODE
32 #error The ConUtils library at the moment only supports compilation with _UNICODE defined!
33 #endif
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 // Shadow type, implementation-specific
41 
42 // typedef INT (__stdcall *CON_READ_FUNC)(
43  // IN PCON_STREAM Stream,
44  // OUT PTCHAR szStr,
45  // IN OUT PDWORD len);
46 
49  IN PCTCH szStr,
50  IN DWORD len);
51 
52 
53 INT
55 ConWrite(
57  IN PCTCH szStr,
58  IN DWORD len);
59 
60 INT
63  IN PCTCH szStr,
64  IN DWORD len);
65 
66 INT
67 ConPuts(
69  IN PCWSTR szStr);
70 
71 INT
74  IN PCWSTR szStr,
75  IN va_list args);
76 
77 INT
78 __cdecl
79 ConPrintf(
81  IN PCWSTR szStr,
82  ...);
83 
84 INT
88  IN UINT uID,
89  IN LANGID LanguageId);
90 
91 INT
94  IN UINT uID);
95 
96 INT
100  IN UINT uID,
101  IN LANGID LanguageId,
102  IN va_list args);
103 
104 INT
107  IN UINT uID,
108  IN va_list args);
109 
110 INT
111 __cdecl
115  IN UINT uID,
116  IN LANGID LanguageId,
117  ...);
118 
119 INT
120 __cdecl
123  IN UINT uID,
124  ...);
125 
126 INT
127 ConMsgPuts(
129  IN DWORD dwFlags,
130  IN LPCVOID lpSource OPTIONAL,
131  IN DWORD dwMessageId,
132  IN DWORD dwLanguageId);
133 
134 INT
137  IN DWORD dwFlags,
138  IN LPCVOID lpSource OPTIONAL,
139  IN DWORD dwMessageId,
140  IN DWORD dwLanguageId,
141  IN va_list args);
142 
143 INT
146  IN DWORD dwFlags,
147  IN LPCVOID lpSource OPTIONAL,
148  IN DWORD dwMessageId,
149  IN DWORD dwLanguageId,
150  IN va_list *Arguments OPTIONAL);
151 
152 INT
153 __cdecl
156  IN DWORD dwFlags,
157  IN LPCVOID lpSource OPTIONAL,
158  IN DWORD dwMessageId,
159  IN DWORD dwLanguageId,
160  ...);
161 
162 INT
166  IN DWORD dwFlags,
167  IN UINT uID,
168  IN LANGID LanguageId,
169  IN va_list *Arguments OPTIONAL);
170 
171 INT
174  IN DWORD dwFlags,
175  IN UINT uID,
176  IN va_list *Arguments OPTIONAL);
177 
178 INT
179 __cdecl
183  IN DWORD dwFlags,
184  IN UINT uID,
185  IN LANGID LanguageId,
186  ...);
187 
188 INT
189 __cdecl
192  IN DWORD dwFlags,
193  IN UINT uID,
194  ...);
195 
196 
197 
198 VOID
200 
201 
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif /* __OUTSTREAM_H__ */
207 
208 /* EOF */
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
INT ConResMsgPrintfV(IN PCON_STREAM Stream, IN DWORD dwFlags, IN UINT uID, IN va_list *Arguments OPTIONAL)
Definition: outstream.c:1329
#define __cdecl
Definition: accygwin.h:79
INT __cdecl ConResMsgPrintf(IN PCON_STREAM Stream, IN DWORD dwFlags, IN UINT uID,...)
Definition: outstream.c:1461
INT ConResPrintfExV(IN PCON_STREAM Stream, IN HINSTANCE hInstance OPTIONAL, IN UINT uID, IN LANGID LanguageId, IN va_list args)
Definition: outstream.c:653
#define INT
Definition: polytest.cpp:20
INT __cdecl ConPrintf(IN PCON_STREAM Stream, IN PCWSTR szStr,...)
Definition: outstream.c:520
INT(__stdcall * CON_WRITE_FUNC)(IN PCON_STREAM Stream, IN PCTCH szStr, IN DWORD len)
Definition: outstream.h:47
INT ConPrintfV(IN PCON_STREAM Stream, IN PCWSTR szStr, IN va_list args)
Definition: outstream.c:466
INT ConResPrintfV(IN PCON_STREAM Stream, IN UINT uID, IN va_list args)
Definition: outstream.c:695
WORD LANGID
Definition: typedefs.h:81
Definition: match.c:390
int32_t INT
Definition: typedefs.h:58
INT ConResPutsEx(IN PCON_STREAM Stream, IN HINSTANCE hInstance OPTIONAL, IN UINT uID, IN LANGID LanguageId)
Definition: outstream.c:569
INT __cdecl ConResPrintfEx(IN PCON_STREAM Stream, IN HINSTANCE hInstance OPTIONAL, IN UINT uID, IN LANGID LanguageId,...)
Definition: outstream.c:740
LPCCH PCTCH
Definition: ntbasedef.h:486
HINSTANCE hInstance
Definition: charmap.c:20
char * va_list
Definition: acmsvcex.h:78
INT __cdecl ConResPrintf(IN PCON_STREAM Stream, IN UINT uID,...)
Definition: outstream.c:781
INT ConMsgPuts(IN PCON_STREAM Stream, IN DWORD dwFlags, IN LPCVOID lpSource OPTIONAL, IN DWORD dwMessageId, IN DWORD dwLanguageId)
Definition: outstream.c:837
INT __cdecl ConResMsgPrintfEx(IN PCON_STREAM Stream, IN HINSTANCE hInstance OPTIONAL, IN DWORD dwFlags, IN UINT uID, IN LANGID LanguageId,...)
Definition: outstream.c:1394
unsigned long DWORD
Definition: ntddk_ex.h:95
INT ConResPuts(IN PCON_STREAM Stream, IN UINT uID)
Definition: outstream.c:610
#define __stdcall
Definition: typedefs.h:25
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLenum GLsizei len
Definition: glext.h:6722
INT ConPuts(IN PCON_STREAM Stream, IN PCWSTR szStr)
Definition: outstream.c:427
VOID ConClearLine(IN PCON_STREAM Stream)
Definition: outstream.c:1483
INT ConMsgPrintf2V(IN PCON_STREAM Stream, IN DWORD dwFlags, IN LPCVOID lpSource OPTIONAL, IN DWORD dwMessageId, IN DWORD dwLanguageId, IN va_list args)
Definition: outstream.c:909
INT ConResMsgPrintfExV(IN PCON_STREAM Stream, IN HINSTANCE hInstance OPTIONAL, IN DWORD dwFlags, IN UINT uID, IN LANGID LanguageId, IN va_list *Arguments OPTIONAL)
Definition: outstream.c:1218
INT __stdcall ConWrite(IN PCON_STREAM Stream, IN PCTCH szStr, IN DWORD len)
Definition: outstream.c:85
INT ConStreamWrite(IN PCON_STREAM Stream, IN PCTCH szStr, IN DWORD len)
Definition: outstream.c:398
struct _CON_STREAM * PCON_STREAM
Definition: outstream.h:40
unsigned int UINT
Definition: ndis.h:50
CONST void * LPCVOID
Definition: windef.h:191
INT __cdecl ConMsgPrintf(IN PCON_STREAM Stream, IN DWORD dwFlags, IN LPCVOID lpSource OPTIONAL, IN DWORD dwMessageId, IN DWORD dwLanguageId,...)
Definition: outstream.c:1130
_Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING Stream
Definition: fltkernel.h:1092
INT ConMsgPrintfV(IN PCON_STREAM Stream, IN DWORD dwFlags, IN LPCVOID lpSource OPTIONAL, IN DWORD dwMessageId, IN DWORD dwLanguageId, IN va_list *Arguments OPTIONAL)
Definition: outstream.c:1030
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68