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.
7 #ifndef _WSTDIO_DEFINED
8 #define _WSTDIO_DEFINED
11 #include <corecrt_stdio_config.h>
38 #endif /* _FILE_DEFINED */
41 #define WEOF (wint_t)(0xFFFF)
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*);
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);
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
, ...)
110 va_start(args
, format
);
111 ret
= __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS
, buffer
, size
, format
, NULL
, args
);
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
, ...)
127 va_start(args
, format
);
128 ret
= __stdio_common_vsnwprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS
, buffer
, size
, count
, format
, NULL
, args
);
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
, ...)
144 va_start(args
, format
);
145 ret
= __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS
, buffer
, size
, format
, NULL
, args
);
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
, ...)
161 va_start(args
, format
);
162 ret
= __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS
, buffer
, -1, format
, NULL
, 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
, ...)
178 va_start(args
, format
);
179 ret
= __stdio_common_vswprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS
, buffer
, size
, format
, NULL
, args
);
184 static inline int WINAPIV
_swprintf_l(wchar_t *buffer
, size_t size
, const wchar_t* format
, _locale_t locale
, ...)
189 va_start(args
, locale
);
190 ret
= __stdio_common_vswprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS
, buffer
, size
, format
, locale
, args
);
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
, ...)
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
);
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
, ...)
237 va_start(args
, format
);
238 ret
= __stdio_common_vfwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS
, file
, format
, NULL
, args
);
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
, ...)
253 va_start(args
, format
);
254 ret
= vfwprintf_s(file
, format
, args
);
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
, ...)
269 va_start(args
, format
);
270 ret
= __stdio_common_vfwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS
, stdout
, format
, NULL
, args
);
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
, ...)
285 va_start(args
, format
);
286 ret
= vfwprintf_s(stdout
, format
, args
);
291 static inline int WINAPIV
swscanf(const wchar_t *buffer
, const wchar_t *format
, ...)
296 va_start(args
, format
);
297 ret
= __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS
, buffer
, -1, format
, NULL
, args
);
302 static inline int WINAPIV
swscanf_s(const wchar_t *buffer
, const wchar_t *format
, ...)
307 va_start(args
, format
);
308 ret
= __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS
| _CRT_INTERNAL_SCANF_SECURECRT
, buffer
, -1, format
, NULL
, args
);
313 static inline int WINAPIV
fwscanf(FILE *file
, const wchar_t *format
, ...)
318 va_start(args
, format
);
319 ret
= __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS
, file
, format
, NULL
, args
);
324 static inline int WINAPIV
fwscanf_s(FILE *file
, const wchar_t *format
, ...)
329 va_start(args
, format
);
330 ret
= __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS
| _CRT_INTERNAL_SCANF_SECURECRT
, file
, format
, NULL
, args
);
335 static inline int WINAPIV
wscanf(FILE *file
, const wchar_t *format
, ...)
340 va_start(args
, format
);
341 ret
= __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS
, stdin
, format
, NULL
, args
);
346 static inline int WINAPIV
wscanf_s(FILE *file
, const wchar_t *format
, ...)
351 va_start(args
, format
);
352 ret
= __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS
| _CRT_INTERNAL_SCANF_SECURECRT
, stdin
, format
, NULL
, args
);
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
, ...)
388 va_start(args
, format
);
389 ret
= _vsnwprintf(buffer
, size
, format
, args
);
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 */
413 #endif /* _WSTDIO_DEFINED */