ReactOS  0.4.14-dev-342-gdc047f9
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)(IN PCON_STREAM, IN PTCHAR, IN DWORD);
43  // Stream, szStr, len
45 
46 
47 INT
49 ConWrite(
51  IN PTCHAR szStr,
52  IN DWORD len);
53 
54 INT
57  IN PTCHAR szStr,
58  IN DWORD len);
59 
60 INT
61 ConPuts(
63  IN LPWSTR szStr);
64 
65 INT
68  IN LPWSTR szStr,
69  IN va_list args);
70 
71 INT
72 __cdecl
73 ConPrintf(
75  IN LPWSTR szStr,
76  ...);
77 
78 INT
82  IN UINT uID,
83  IN LANGID LanguageId);
84 
85 INT
88  IN UINT uID);
89 
90 INT
94  IN UINT uID,
95  IN LANGID LanguageId,
96  IN va_list args);
97 
98 INT
101  IN UINT uID,
102  IN va_list args);
103 
104 INT
105 __cdecl
109  IN UINT uID,
110  IN LANGID LanguageId,
111  ...);
112 
113 INT
114 __cdecl
117  IN UINT uID,
118  ...);
119 
120 INT
121 ConMsgPuts(
123  IN DWORD dwFlags,
124  IN LPCVOID lpSource OPTIONAL,
125  IN DWORD dwMessageId,
126  IN DWORD dwLanguageId);
127 
128 INT
131  IN DWORD dwFlags,
132  IN LPCVOID lpSource OPTIONAL,
133  IN DWORD dwMessageId,
134  IN DWORD dwLanguageId,
135  IN va_list args);
136 
137 INT
140  IN DWORD dwFlags,
141  IN LPCVOID lpSource OPTIONAL,
142  IN DWORD dwMessageId,
143  IN DWORD dwLanguageId,
144  IN va_list *Arguments OPTIONAL);
145 
146 INT
147 __cdecl
150  IN DWORD dwFlags,
151  IN LPCVOID lpSource OPTIONAL,
152  IN DWORD dwMessageId,
153  IN DWORD dwLanguageId,
154  ...);
155 
156 INT
160  IN DWORD dwFlags,
161  IN UINT uID,
162  IN LANGID LanguageId,
163  IN va_list *Arguments OPTIONAL);
164 
165 INT
168  IN DWORD dwFlags,
169  IN UINT uID,
170  IN va_list *Arguments OPTIONAL);
171 
172 INT
173 __cdecl
177  IN DWORD dwFlags,
178  IN UINT uID,
179  IN LANGID LanguageId,
180  ...);
181 
182 INT
183 __cdecl
186  IN DWORD dwFlags,
187  IN UINT uID,
188  ...);
189 
190 
191 
192 VOID
194 
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif /* __OUTSTREAM_H__ */
201 
202 /* EOF */
#define IN
Definition: typedefs.h:38
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 ConResPrintfV(IN PCON_STREAM Stream, IN UINT uID, IN va_list args)
Definition: outstream.c:695
WORD LANGID
Definition: typedefs.h:79
Definition: match.c:390
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
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
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
HINSTANCE hInstance
Definition: charmap.c:20
INT ConStreamWrite(IN PCON_STREAM Stream, IN PTCHAR szStr, IN DWORD len)
Definition: outstream.c:398
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
VOID ConClearLine(IN PCON_STREAM Stream)
Definition: outstream.c:1483
INT(__stdcall * CON_WRITE_FUNC)(IN PCON_STREAM, IN PTCHAR, IN DWORD)
Definition: outstream.h:44
INT __cdecl ConPrintf(IN PCON_STREAM Stream, IN LPWSTR szStr,...)
Definition: outstream.c:520
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 ConPrintfV(IN PCON_STREAM Stream, IN LPWSTR szStr, IN va_list args)
Definition: outstream.c:466
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
WCHAR * LPWSTR
Definition: xmlstorage.h:184
INT __stdcall ConWrite(IN PCON_STREAM Stream, IN PTCHAR szStr, IN DWORD len)
Definition: outstream.c:85
_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
char * PTCHAR
Definition: ntbasedef.h:483
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68