imm32: Delay import ole32.dll.
[wine.git] / include / msvcrt / corecrt_wstdio.h
blob404f7345c8e3d2259cba06c66d13cb3cd413daa6
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the Wine project.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
7 #ifndef _WSTDIO_DEFINED
8 #define _WSTDIO_DEFINED
10 #include <corecrt.h>
11 #include <corecrt_stdio_config.h>
13 #ifndef RC_INVOKED
14 #include <stdarg.h>
15 #endif
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
21 #include <pshpack8.h>
23 #ifndef _FILE_DEFINED
24 #define _FILE_DEFINED
25 #include <pshpack8.h>
26 typedef struct _iobuf
28 char* _ptr;
29 int _cnt;
30 char* _base;
31 int _flag;
32 int _file;
33 int _charbuf;
34 int _bufsiz;
35 char* _tmpfname;
36 } FILE;
37 #include <poppack.h>
38 #endif /* _FILE_DEFINED */
40 #ifndef WEOF
41 #define WEOF (wint_t)(0xFFFF)
42 #endif
44 _ACRTIMP FILE *__cdecl __acrt_iob_func(unsigned index);
46 #define stdin (__acrt_iob_func(0))
47 #define stdout (__acrt_iob_func(1))
48 #define stderr (__acrt_iob_func(2))
50 _ACRTIMP wint_t __cdecl _fgetwc_nolock(FILE*);
51 _ACRTIMP wint_t __cdecl _fgetwchar(void);
52 _ACRTIMP wint_t __cdecl _fputwc_nolock(wint_t,FILE*);
53 _ACRTIMP wint_t __cdecl _fputwchar(wint_t);
54 _ACRTIMP wint_t __cdecl _getwc_nolock(FILE*);
55 _ACRTIMP wchar_t* __cdecl _getws(wchar_t*);
56 _ACRTIMP wint_t __cdecl _putwc_nolock(wint_t,FILE*);
57 _ACRTIMP int __cdecl _putws(const wchar_t*);
58 _ACRTIMP wint_t __cdecl _ungetwc_nolock(wint_t,FILE*);
59 _ACRTIMP FILE* __cdecl _wfdopen(int,const wchar_t*);
60 _ACRTIMP FILE* __cdecl _wfopen(const wchar_t*,const wchar_t*);
61 _ACRTIMP errno_t __cdecl _wfopen_s(FILE**,const wchar_t*,const wchar_t*);
62 _ACRTIMP FILE* __cdecl _wfreopen(const wchar_t*,const wchar_t*,FILE*);
63 _ACRTIMP FILE* __cdecl _wfsopen(const wchar_t*,const wchar_t*,int);
64 _ACRTIMP void __cdecl _wperror(const wchar_t*);
65 _ACRTIMP FILE* __cdecl _wpopen(const wchar_t*,const wchar_t*);
66 _ACRTIMP int __cdecl _wremove(const wchar_t*);
67 _ACRTIMP wchar_t* __cdecl _wtempnam(const wchar_t*,const wchar_t*);
68 _ACRTIMP wchar_t* __cdecl _wtmpnam(wchar_t*);
70 _ACRTIMP wint_t __cdecl fgetwc(FILE*);
71 _ACRTIMP wchar_t* __cdecl fgetws(wchar_t*,int,FILE*);
72 _ACRTIMP wint_t __cdecl fputwc(wint_t,FILE*);
73 _ACRTIMP int __cdecl fputws(const wchar_t*,FILE*);
74 _ACRTIMP int __cdecl fputws(const wchar_t*,FILE*);
75 _ACRTIMP wint_t __cdecl getwc(FILE*);
76 _ACRTIMP wint_t __cdecl getwchar(void);
77 _ACRTIMP wchar_t* __cdecl getws(wchar_t*);
78 _ACRTIMP wint_t __cdecl putwc(wint_t,FILE*);
79 _ACRTIMP wint_t __cdecl putwchar(wint_t);
80 _ACRTIMP int __cdecl putws(const wchar_t*);
81 _ACRTIMP wint_t __cdecl ungetwc(wint_t,FILE*);
83 #ifdef _UCRT
85 _ACRTIMP int __cdecl __stdio_common_vfwprintf(unsigned __int64,FILE*,const wchar_t*,_locale_t,va_list);
86 _ACRTIMP int __cdecl __stdio_common_vfwprintf_s(unsigned __int64,FILE*,const wchar_t*,_locale_t,va_list);
87 _ACRTIMP int __cdecl __stdio_common_vsnwprintf_s(unsigned __int64,wchar_t*,size_t,size_t,const wchar_t*,_locale_t,va_list);
88 _ACRTIMP int __cdecl __stdio_common_vswprintf(unsigned __int64,wchar_t*,size_t,const wchar_t*,_locale_t,va_list);
89 _ACRTIMP int __cdecl __stdio_common_vswprintf_p(unsigned __int64,wchar_t*,size_t,const wchar_t*,_locale_t,va_list);
90 _ACRTIMP int __cdecl __stdio_common_vswprintf_s(unsigned __int64,wchar_t*,size_t,const wchar_t*,_locale_t,va_list);
92 _ACRTIMP int __cdecl __stdio_common_vfwscanf(unsigned __int64,FILE*,const wchar_t*,_locale_t,va_list);
93 _ACRTIMP int __cdecl __stdio_common_vswscanf(unsigned __int64,const wchar_t*,size_t,const wchar_t*,_locale_t,va_list);
95 #endif /* _UCRT */
97 #if defined(_UCRT) && !defined(_NO_CRT_STDIO_INLINE)
99 static inline int __cdecl _vsnwprintf(wchar_t *buffer, size_t size, const wchar_t *format, va_list args)
101 int ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
102 return ret < 0 ? -1 : ret;
105 static inline int WINAPIV _snwprintf(wchar_t *buffer, size_t size, const wchar_t* format, ...)
107 int ret;
108 va_list args;
110 va_start(args, format);
111 ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
112 va_end(args);
113 return ret;
116 static inline int __cdecl _vsnwprintf_s(wchar_t *buffer, size_t size, size_t count, const wchar_t *format, va_list args)
118 int ret = __stdio_common_vsnwprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, count, format, NULL, args);
119 return ret < 0 ? -1 : ret;
122 static inline int WINAPIV _snwprintf_s(wchar_t *buffer, size_t size, size_t count, const wchar_t *format, ...)
124 int ret;
125 va_list args;
127 va_start(args, format);
128 ret = __stdio_common_vsnwprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, count, format, NULL, args);
129 va_end(args);
130 return ret;
133 static inline int __cdecl vswprintf(wchar_t *buffer, size_t size, const wchar_t *format, va_list args)
135 int ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
136 return ret < 0 ? -1 : ret;
139 static inline int WINAPIV swprintf(wchar_t *buffer, size_t size, const wchar_t *format, ...)
141 int ret;
142 va_list args;
144 va_start(args, format);
145 ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
146 va_end(args);
147 return ret;
150 static inline int __cdecl _vswprintf(wchar_t *buffer, const wchar_t *format, va_list args)
152 int ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, -1, format, NULL, args);
153 return ret < 0 ? -1 : ret;
156 static inline int WINAPIV _swprintf(wchar_t *buffer, const wchar_t *format, ...)
158 int ret;
159 va_list args;
161 va_start(args, format);
162 ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, -1, format, NULL, args);
163 va_end(args);
164 return ret < 0 ? -1 : ret;
167 static inline int __cdecl vswprintf_s(wchar_t *buffer, size_t size, const wchar_t *format, va_list args)
169 int ret = __stdio_common_vswprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
170 return ret < 0 ? -1 : ret;
173 static inline int WINAPIV swprintf_s(wchar_t *buffer, size_t size, const wchar_t* format, ...)
175 int ret;
176 va_list args;
178 va_start(args, format);
179 ret = __stdio_common_vswprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
180 va_end(args);
181 return ret;
184 static inline int WINAPIV _swprintf_l(wchar_t *buffer, size_t size, const wchar_t* format, _locale_t locale, ...)
186 int ret;
187 va_list args;
189 va_start(args, locale);
190 ret = __stdio_common_vswprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, locale, args);
191 va_end(args);
192 return ret;
195 static inline int __cdecl _vscwprintf(const wchar_t *format, va_list args)
197 int ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
198 NULL, 0, format, NULL, args);
199 return ret < 0 ? -1 : ret;
202 static inline int __cdecl _vswprintf_p_l(wchar_t *buffer, size_t size, const wchar_t *format, _locale_t locale, va_list args)
204 int ret = __stdio_common_vswprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, locale, args);
205 return ret < 0 ? -1 : ret;
208 static inline int __cdecl _vscwprintf_p_l(const wchar_t *format, _locale_t locale, va_list args)
210 int ret = __stdio_common_vswprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
211 NULL, 0, format, locale, args);
212 return ret < 0 ? -1 : ret;
215 static inline int WINAPIV _scwprintf(const wchar_t *format, ...)
217 int ret;
218 va_list args;
220 va_start(args, format);
221 ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
222 NULL, 0, format, NULL, args);
223 va_end(args);
224 return ret;
227 static inline int __cdecl vfwprintf(FILE *file, const wchar_t *format, va_list args)
229 return __stdio_common_vfwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
232 static inline int WINAPIV fwprintf(FILE *file, const wchar_t *format, ...)
234 int ret;
235 va_list args;
237 va_start(args, format);
238 ret = __stdio_common_vfwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
239 va_end(args);
240 return ret;
243 static inline int __cdecl vfwprintf_s(FILE *file, const wchar_t *format, va_list args)
245 return __stdio_common_vfwprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
248 static inline int WINAPIV fwprintf_s(FILE *file, const wchar_t *format, ...)
250 int ret;
251 va_list args;
253 va_start(args, format);
254 ret = vfwprintf_s(file, format, args);
255 va_end(args);
256 return ret;
259 static inline int __cdecl vwprintf(const wchar_t *format, va_list args)
261 return __stdio_common_vfwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
264 static inline int WINAPIV wprintf(const wchar_t *format, ...)
266 int ret;
267 va_list args;
269 va_start(args, format);
270 ret = __stdio_common_vfwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
271 va_end(args);
272 return ret;
275 static inline int __cdecl vwprintf_s(const wchar_t *format, va_list args)
277 return __stdio_common_vfwprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
280 static inline int WINAPIV wprintf_s(const wchar_t *format, ...)
282 int ret;
283 va_list args;
285 va_start(args, format);
286 ret = vfwprintf_s(stdout, format, args);
287 va_end(args);
288 return ret;
291 static inline int WINAPIV swscanf(const wchar_t *buffer, const wchar_t *format, ...)
293 int ret;
294 va_list args;
296 va_start(args, format);
297 ret = __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, buffer, -1, format, NULL, args);
298 va_end(args);
299 return ret;
302 static inline int WINAPIV swscanf_s(const wchar_t *buffer, const wchar_t *format, ...)
304 int ret;
305 va_list args;
307 va_start(args, format);
308 ret = __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, buffer, -1, format, NULL, args);
309 va_end(args);
310 return ret;
313 static inline int WINAPIV fwscanf(FILE *file, const wchar_t *format, ...)
315 int ret;
316 va_list args;
318 va_start(args, format);
319 ret = __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, file, format, NULL, args);
320 va_end(args);
321 return ret;
324 static inline int WINAPIV fwscanf_s(FILE *file, const wchar_t *format, ...)
326 int ret;
327 va_list args;
329 va_start(args, format);
330 ret = __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, file, format, NULL, args);
331 va_end(args);
332 return ret;
335 static inline int WINAPIV wscanf(FILE *file, const wchar_t *format, ...)
337 int ret;
338 va_list args;
340 va_start(args, format);
341 ret = __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, stdin, format, NULL, args);
342 va_end(args);
343 return ret;
346 static inline int WINAPIV wscanf_s(FILE *file, const wchar_t *format, ...)
348 int ret;
349 va_list args;
351 va_start(args, format);
352 ret = __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, stdin, format, NULL, args);
353 va_end(args);
354 return ret;
357 #else /* _UCRT && !_NO_CRT_STDIO_INLINE */
359 _ACRTIMP int WINAPIV _scwprintf(const wchar_t*,...);
360 _ACRTIMP int WINAPIV _snwprintf(wchar_t*,size_t,const wchar_t*,...);
361 _ACRTIMP int WINAPIV _snwprintf_s(wchar_t*,size_t,size_t,const wchar_t*,...);
362 _ACRTIMP int __cdecl _vscwprintf(const wchar_t*,va_list);
363 _ACRTIMP int __cdecl _vscwprintf_p_l(const wchar_t*,_locale_t,va_list);
364 _ACRTIMP int __cdecl _vsnwprintf(wchar_t*,size_t,const wchar_t*,va_list);
365 _ACRTIMP int __cdecl _vsnwprintf_s(wchar_t*,size_t,size_t,const wchar_t*,va_list);
366 _ACRTIMP int __cdecl _vswprintf_p_l(wchar_t*,size_t,const wchar_t*,_locale_t,va_list);
367 _ACRTIMP int WINAPIV fwprintf(FILE*,const wchar_t*,...);
368 _ACRTIMP int WINAPIV fwprintf_s(FILE*,const wchar_t*,...);
369 _ACRTIMP int WINAPIV swprintf_s(wchar_t*,size_t,const wchar_t*,...);
370 _ACRTIMP int __cdecl vfwprintf(FILE*,const wchar_t*,va_list);
371 _ACRTIMP int __cdecl vfwprintf_s(FILE*,const wchar_t*,va_list);
372 _ACRTIMP int __cdecl vswprintf_s(wchar_t*,size_t,const wchar_t*,va_list);
373 _ACRTIMP int __cdecl vwprintf(const wchar_t*,va_list);
374 _ACRTIMP int __cdecl vwprintf_s(const wchar_t*,va_list);
375 _ACRTIMP int WINAPIV wprintf(const wchar_t*,...);
376 _ACRTIMP int WINAPIV wprintf_s(const wchar_t*,...);
378 #ifdef _CRT_NON_CONFORMING_SWPRINTFS
379 _ACRTIMP int WINAPIV swprintf(wchar_t*,const wchar_t*,...);
380 _ACRTIMP int __cdecl vswprintf(wchar_t*,const wchar_t*,va_list);
381 #elif !defined(_NO_CRT_STDIO_INLINE)
382 static inline int __cdecl vswprintf(wchar_t *buffer, size_t size, const wchar_t *format, va_list args) { return _vsnwprintf(buffer,size,format,args); }
383 static inline int WINAPIV swprintf(wchar_t *buffer, size_t size, const wchar_t *format, ...)
385 int ret;
386 va_list args;
388 va_start(args, format);
389 ret = _vsnwprintf(buffer, size, format, args);
390 va_end(args);
391 return ret;
393 #else
394 _ACRTIMP int __cdecl vswprintf(wchar_t*,size_t,const wchar_t*,va_list);
395 _ACRTIMP int WINAPIV swprintf(wchar_t*,size_t,const wchar_t*,...);
396 #endif /* _CRT_NON_CONFORMING_SWPRINTFS */
398 _ACRTIMP int WINAPIV fwscanf(FILE*,const wchar_t*,...);
399 _ACRTIMP int WINAPIV fwscanf_s(FILE*,const wchar_t*,...);
400 _ACRTIMP int WINAPIV swscanf(const wchar_t*,const wchar_t*,...);
401 _ACRTIMP int WINAPIV swscanf_s(const wchar_t*,const wchar_t*,...);
402 _ACRTIMP int WINAPIV wscanf(const wchar_t*,...);
403 _ACRTIMP int WINAPIV wscanf_s(const wchar_t*,...);
405 #endif /* _UCRT && !_NO_CRT_STDIO_INLINE */
407 #ifdef __cplusplus
409 #endif
411 #include <poppack.h>
413 #endif /* _WSTDIO_DEFINED */