dmime/tests: Test wave segments and DMUS_WAVE_PMSG.
[wine.git] / include / msvcrt / stdio.h
blob745257ea5cc4f1c27a6883c8dff40283658b2acc
1 /*
2 * Standard I/O definitions.
4 * Derived from the mingw header written by Colin Peters.
5 * Modified for Wine use by Jon Griffiths and Francois Gouget.
6 * This file is in the public domain.
7 */
8 #ifndef __WINE_STDIO_H
9 #define __WINE_STDIO_H
11 #include <corecrt_wstdio.h>
13 /* file._flag flags */
14 #define _IOREAD 0x0001
15 #define _IOWRT 0x0002
16 #define _IOMYBUF 0x0008
17 #define _IOEOF 0x0010
18 #define _IOERR 0x0020
19 #define _IOSTRG 0x0040
20 #define _IORW 0x0080
22 #define STDIN_FILENO 0
23 #define STDOUT_FILENO 1
24 #define STDERR_FILENO 2
26 /* more file._flag flags, but these conflict with Unix */
27 #define _IOFBF 0x0000
28 #define _IONBF 0x0004
29 #define _IOLBF 0x0040
31 #define EOF (-1)
32 #define FILENAME_MAX 260
33 #define TMP_MAX 0x7fff
34 #define TMP_MAX_S 0x7fffffff
35 #define FOPEN_MAX 20
36 #define L_tmpnam 260
38 #define BUFSIZ 512
40 #ifndef SEEK_SET
41 #define SEEK_SET 0
42 #define SEEK_CUR 1
43 #define SEEK_END 2
44 #endif
46 #ifndef _FPOS_T_DEFINED
47 typedef __int64 DECLSPEC_ALIGN(8) fpos_t;
48 #define _FPOS_T_DEFINED
49 #endif
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
55 #ifndef _STDIO_DEFINED
56 # ifdef __i386__
57 _ACRTIMP FILE* __cdecl __p__iob(void);
58 # define _iob (__p__iob())
59 # else
60 _ACRTIMP FILE* __cdecl __iob_func(void);
61 # define _iob (__iob_func())
62 # endif
63 #endif /* _STDIO_DEFINED */
65 /* return value for _get_output_format */
66 #define _TWO_DIGIT_EXPONENT 0x1
68 #ifndef _STDIO_DEFINED
69 #define _STDIO_DEFINED
70 _ACRTIMP int __cdecl _fcloseall(void);
71 _ACRTIMP FILE* __cdecl _fdopen(int,const char*);
72 _ACRTIMP int __cdecl _fgetchar(void);
73 _ACRTIMP int __cdecl _filbuf(FILE*);
74 _ACRTIMP int __cdecl _fileno(FILE*);
75 _ACRTIMP int __cdecl _flsbuf(int,FILE*);
76 _ACRTIMP int __cdecl _flushall(void);
77 _ACRTIMP int __cdecl _fputchar(int);
78 _ACRTIMP FILE* __cdecl _fsopen(const char*,const char*,int);
79 _ACRTIMP int __cdecl _get_printf_count_output(void);
80 _ACRTIMP int __cdecl _getmaxstdio(void);
81 _ACRTIMP int __cdecl _getw(FILE*);
82 _ACRTIMP int __cdecl _pclose(FILE*);
83 _ACRTIMP FILE* __cdecl _popen(const char*,const char*);
84 _ACRTIMP int __cdecl _putw(int,FILE*);
85 _ACRTIMP int __cdecl _rmtmp(void);
86 _ACRTIMP int __cdecl _set_printf_count_output(int);
87 _ACRTIMP int __cdecl _setmaxstdio(int);
88 _ACRTIMP char* __cdecl _tempnam(const char*,const char*);
89 _ACRTIMP int __cdecl _unlink(const char*);
91 _ACRTIMP void __cdecl _lock_file(FILE*);
92 _ACRTIMP void __cdecl _unlock_file(FILE*);
93 _ACRTIMP size_t __cdecl _fread_nolock(void*,size_t,size_t,FILE*);
94 _ACRTIMP size_t __cdecl _fread_nolock_s(void*,size_t,size_t,size_t,FILE*);
95 _ACRTIMP size_t __cdecl _fwrite_nolock(const void*,size_t,size_t,FILE*);
96 _ACRTIMP int __cdecl _fclose_nolock(FILE*);
97 _ACRTIMP int __cdecl _fflush_nolock(FILE*);
98 _ACRTIMP int __cdecl _fgetc_nolock(FILE*);
99 _ACRTIMP int __cdecl _fputc_nolock(int,FILE*);
100 _ACRTIMP int __cdecl _fseek_nolock(FILE*,__msvcrt_long,int);
101 _ACRTIMP int __cdecl _fseeki64_nolock(FILE*,__int64,int);
102 _ACRTIMP __msvcrt_long __cdecl _ftell_nolock(FILE*);
103 _ACRTIMP __int64 __cdecl _ftelli64_nolock(FILE*);
104 _ACRTIMP int __cdecl _getc_nolock(FILE*);
105 _ACRTIMP int __cdecl _putc_nolock(int,FILE*);
106 _ACRTIMP int __cdecl _ungetc_nolock(int,FILE*);
108 _ACRTIMP void __cdecl clearerr(FILE*);
109 _ACRTIMP errno_t __cdecl clearerr_s(FILE*);
110 _ACRTIMP int __cdecl fclose(FILE*);
111 _ACRTIMP int __cdecl feof(FILE*);
112 _ACRTIMP int __cdecl ferror(FILE*);
113 _ACRTIMP int __cdecl fflush(FILE*);
114 _ACRTIMP int __cdecl fgetc(FILE*);
115 _ACRTIMP int __cdecl fgetpos(FILE*,fpos_t*);
116 _ACRTIMP char* __cdecl fgets(char*,int,FILE*);
117 _ACRTIMP FILE* __cdecl fopen(const char*,const char*);
118 _ACRTIMP errno_t __cdecl fopen_s(FILE**,const char*,const char*);
119 _ACRTIMP int __cdecl fputc(int,FILE*);
120 _ACRTIMP int __cdecl fputs(const char*,FILE*);
121 _ACRTIMP size_t __cdecl fread(void*,size_t,size_t,FILE*);
122 _ACRTIMP size_t __cdecl fread_s(void*,size_t,size_t,size_t,FILE*);
123 _ACRTIMP FILE* __cdecl freopen(const char*,const char*,FILE*);
124 _ACRTIMP errno_t __cdecl freopen_s(FILE**,const char*,const char*,FILE*);
125 _ACRTIMP int __cdecl fseek(FILE*,__msvcrt_long,int);
126 _ACRTIMP int __cdecl _fseeki64(FILE*,__int64,int);
127 _ACRTIMP int __cdecl fsetpos(FILE*,fpos_t*);
128 _ACRTIMP __msvcrt_long __cdecl ftell(FILE*);
129 _ACRTIMP __int64 __cdecl _ftelli64(FILE*);
130 _ACRTIMP size_t __cdecl fwrite(const void*,size_t,size_t,FILE*);
131 _ACRTIMP int __cdecl getc(FILE*);
132 _ACRTIMP int __cdecl getchar(void);
133 _ACRTIMP char* __cdecl gets(char*);
134 _ACRTIMP void __cdecl perror(const char*);
135 _ACRTIMP int __cdecl putc(int,FILE*);
136 _ACRTIMP int __cdecl putchar(int);
137 _ACRTIMP int __cdecl puts(const char*);
138 _ACRTIMP int __cdecl remove(const char*);
139 _ACRTIMP int __cdecl rename(const char*,const char*);
140 _ACRTIMP void __cdecl rewind(FILE*);
141 _ACRTIMP void __cdecl setbuf(FILE*,char*);
142 _ACRTIMP int __cdecl setvbuf(FILE*,char*,int,size_t);
143 _ACRTIMP FILE* __cdecl tmpfile(void);
144 _ACRTIMP char* __cdecl tmpnam(char*);
145 _ACRTIMP int __cdecl ungetc(int,FILE*);
146 _ACRTIMP unsigned int __cdecl _get_output_format(void);
147 _ACRTIMP unsigned int __cdecl _set_output_format(unsigned int);
149 #ifdef _UCRT
151 _ACRTIMP int __cdecl __stdio_common_vfprintf(unsigned __int64,FILE*,const char*,_locale_t,va_list);
152 _ACRTIMP int __cdecl __stdio_common_vfprintf_s(unsigned __int64,FILE*,const char*,_locale_t,va_list);
153 _ACRTIMP int __cdecl __stdio_common_vsprintf(unsigned __int64,char*,size_t,const char*,_locale_t,va_list);
154 _ACRTIMP int __cdecl __stdio_common_vsprintf_p(unsigned __int64,char*,size_t,const char*,_locale_t,va_list);
155 _ACRTIMP int __cdecl __stdio_common_vsprintf_s(unsigned __int64,char*,size_t,const char*,_locale_t,va_list);
156 _ACRTIMP int __cdecl __stdio_common_vsnprintf_s(unsigned __int64,char*,size_t,size_t,const char*,_locale_t,va_list);
158 _ACRTIMP int __cdecl __stdio_common_vfscanf(unsigned __int64,FILE*,const char*,_locale_t,va_list);
159 _ACRTIMP int __cdecl __stdio_common_vsscanf(unsigned __int64,char const*,size_t,const char*,_locale_t,va_list);
161 #endif /* _UCRT */
163 #if defined(_UCRT) && !defined(_NO_CRT_STDIO_INLINE)
165 static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
166 static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *format, va_list args)
168 int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
169 buffer, size, format, NULL, args);
170 return ret < 0 ? -1 : ret;
173 static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
174 static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *format, va_list args)
176 int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
177 buffer, size, format, NULL, args);
178 return ret < 0 ? -1 : ret;
181 static inline int __cdecl _vsnprintf_s(char *buffer, size_t size, size_t count, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(4, 0);
182 static inline int __cdecl _vsnprintf_s(char *buffer, size_t size, size_t count, const char *format, va_list args)
184 int ret = __stdio_common_vsnprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, count, format, NULL, args);
185 return ret < 0 ? -1 : ret;
188 static inline int WINAPIV _snprintf_s(char *buffer, size_t size, size_t count, const char *format, ...) __WINE_CRT_PRINTF_ATTR(4, 5);
189 static inline int WINAPIV _snprintf_s(char *buffer, size_t size, size_t count, const char *format, ...)
191 int ret;
192 va_list args;
194 va_start(args, format);
195 ret = __stdio_common_vsnprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, count, format, NULL, args);
196 va_end(args);
197 return ret;
200 static inline int __cdecl _vscprintf(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
201 static inline int __cdecl _vscprintf(const char *format, va_list args)
203 int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
204 NULL, 0, format, NULL, args);
205 return ret < 0 ? -1 : ret;
208 static inline int WINAPIV _scprintf(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
209 static inline int WINAPIV _scprintf(const char *format, ...)
211 int ret;
212 va_list args;
214 va_start(args, format);
215 ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
216 NULL, 0, format, NULL, args);
217 va_end(args);
218 return ret;
221 static inline int __cdecl vsprintf(char *buffer, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
222 static inline int __cdecl vsprintf(char *buffer, const char *format, va_list args)
224 int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
225 buffer, -1, format, NULL, args);
226 return ret < 0 ? -1 : ret;
229 static inline int __cdecl vsprintf_s(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
230 static inline int __cdecl vsprintf_s(char *buffer, size_t size, const char *format, va_list args)
232 int ret = __stdio_common_vsprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
233 return ret < 0 ? -1 : ret;
236 static inline int WINAPIV sprintf_s(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
237 static inline int WINAPIV sprintf_s(char *buffer, size_t size, const char *format, ...)
239 int ret;
240 va_list args;
242 va_start(args, format);
243 ret = __stdio_common_vsprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
244 va_end(args);
245 return ret;
248 static inline int __cdecl _vsprintf_p_l(char *buffer, size_t size, const char *format, _locale_t locale, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
249 static inline int __cdecl _vsprintf_p_l(char *buffer, size_t size, const char *format, _locale_t locale, va_list args)
251 int ret = __stdio_common_vsprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, locale, args);
252 return ret < 0 ? -1 : ret;
255 static inline int __cdecl vfprintf(FILE *file, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
256 static inline int __cdecl vfprintf(FILE *file, const char *format, va_list args)
258 return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
261 static inline int WINAPIV fprintf(FILE *file, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
262 static inline int WINAPIV fprintf(FILE *file, const char *format, ...)
264 int ret;
265 va_list args;
267 va_start(args, format);
268 ret = __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
269 va_end(args);
270 return ret;
273 static inline int __cdecl vfprintf_s(FILE *file, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
274 static inline int __cdecl vfprintf_s(FILE *file, const char *format, va_list args)
276 return __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
279 static inline int WINAPIV fprintf_s(FILE *file, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
280 static inline int WINAPIV fprintf_s(FILE *file, const char *format, ...)
282 int ret;
283 va_list args;
285 va_start(args, format);
286 ret = __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
287 va_end(args);
288 return ret;
291 static inline int vprintf(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
292 static inline int vprintf(const char *format, va_list args)
294 return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
297 static inline int WINAPIV printf(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
298 static inline int WINAPIV printf(const char *format, ...)
300 int ret;
301 va_list args;
303 va_start(args, format);
304 ret = __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
305 va_end(args);
306 return ret;
309 static inline int vprintf_s(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
310 static inline int vprintf_s(const char *format, va_list args)
312 return __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
315 static inline int WINAPIV printf_s(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
316 static inline int WINAPIV printf_s(const char *format, ...)
318 int ret;
319 va_list args;
321 va_start(args, format);
322 ret = __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
323 va_end(args);
324 return ret;
327 static inline int WINAPIV sscanf(const char *buffer, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
328 static inline int WINAPIV sscanf(const char *buffer, const char *format, ...)
330 int ret;
331 va_list args;
333 va_start(args, format);
334 ret = __stdio_common_vsscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, buffer, -1, format, NULL, args);
335 va_end(args);
336 return ret;
339 static inline int WINAPIV sscanf_s(const char *buffer, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
340 static inline int WINAPIV sscanf_s(const char *buffer, const char *format, ...)
342 int ret;
343 va_list args;
345 va_start(args, format);
346 ret = __stdio_common_vsscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, buffer, -1, format, NULL, args);
347 va_end(args);
348 return ret;
351 static inline int WINAPIV _snscanf_l(const char *buffer, size_t size, const char *format, _locale_t locale, ...) __WINE_CRT_SCANF_ATTR(3, 5);
352 static inline int WINAPIV _snscanf_l(const char *buffer, size_t size, const char *format, _locale_t locale, ...)
354 int ret;
355 va_list args;
357 va_start(args, locale);
358 ret = __stdio_common_vsscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, buffer, size, format, locale, args);
359 va_end(args);
360 return ret;
363 static inline int WINAPIV _sscanf_l(const char *buffer, const char *format, _locale_t locale, ...) __WINE_CRT_SCANF_ATTR(2, 4);
364 static inline int WINAPIV _sscanf_l(const char *buffer, const char *format, _locale_t locale, ...)
366 int ret;
367 va_list args;
369 va_start(args, locale);
370 ret = __stdio_common_vsscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, buffer, -1, format, locale, args);
371 va_end(args);
372 return ret;
375 static inline int WINAPIV fscanf(FILE *file, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
376 static inline int WINAPIV fscanf(FILE *file, const char *format, ...)
378 int ret;
379 va_list args;
381 va_start(args, format);
382 ret = __stdio_common_vfscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, file, format, NULL, args);
383 va_end(args);
384 return ret;
387 static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
388 static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...)
390 int ret;
391 va_list args;
393 va_start(args, format);
394 ret = __stdio_common_vfscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, file, format, NULL, args);
395 va_end(args);
396 return ret;
399 static inline int WINAPIV scanf(const char *format, ...) __WINE_CRT_SCANF_ATTR(1, 2);
400 static inline int WINAPIV scanf(const char *format, ...)
402 int ret;
403 va_list args;
405 va_start(args, format);
406 ret = __stdio_common_vfscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, stdin, format, NULL, args);
407 va_end(args);
408 return ret;
411 static inline int WINAPIV scanf_s(const char *format, ...) __WINE_CRT_SCANF_ATTR(1, 2);
412 static inline int WINAPIV scanf_s(const char *format, ...)
414 int ret;
415 va_list args;
417 va_start(args, format);
418 ret = __stdio_common_vfscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, stdin, format, NULL, args);
419 va_end(args);
420 return ret;
423 #else /* _UCRT && !_NO_CRT_STDIO_INLINE */
425 _ACRTIMP int WINAPIV _scprintf(const char *,...) __WINE_CRT_PRINTF_ATTR(1, 2);
426 _ACRTIMP int WINAPIV _snprintf_s(char*,size_t,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(4, 5);
427 _ACRTIMP int __cdecl _vscprintf(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
428 _ACRTIMP int __cdecl _vsnprintf_s(char*,size_t,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(4, 0);
429 _ACRTIMP int __cdecl _vsprintf_p_l(char*,size_t,const char*,_locale_t,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
430 _ACRTIMP int WINAPIV fprintf(FILE*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
431 _ACRTIMP int WINAPIV fprintf_s(FILE*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
432 _ACRTIMP int WINAPIV printf(const char*,...) __WINE_CRT_PRINTF_ATTR(1, 2);
433 _ACRTIMP int WINAPIV printf_s(const char*,...) __WINE_CRT_PRINTF_ATTR(1, 2);
434 _ACRTIMP int WINAPIV sprintf_s(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
435 _ACRTIMP int __cdecl vfprintf(FILE*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
436 _ACRTIMP int __cdecl vfprintf_s(FILE*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
437 _ACRTIMP int __cdecl vprintf(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
438 _ACRTIMP int __cdecl vprintf_s(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
439 _ACRTIMP int __cdecl vsprintf(char*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
440 _ACRTIMP int __cdecl vsprintf_s(char*,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
442 _ACRTIMP int __cdecl _vsnprintf(char*,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
443 static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
444 static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args)
445 { return _vsnprintf(buffer,size,format,args); }
447 _ACRTIMP int WINAPIV _snscanf_l(const char*,size_t,const char*,_locale_t,...) __WINE_CRT_SCANF_ATTR(3, 5);
448 _ACRTIMP int WINAPIV _sscanf_l(const char *,const char*,_locale_t,...) __WINE_CRT_SCANF_ATTR(2, 4);
449 _ACRTIMP int WINAPIV fscanf(FILE*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
450 _ACRTIMP int WINAPIV fscanf_s(FILE*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
451 _ACRTIMP int WINAPIV scanf(const char*,...) __WINE_CRT_SCANF_ATTR(1, 2);
452 _ACRTIMP int WINAPIV scanf_s(const char*,...) __WINE_CRT_SCANF_ATTR(1, 2);
453 _ACRTIMP int WINAPIV sscanf(const char*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
454 _ACRTIMP int WINAPIV sscanf_s(const char*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
456 #endif /* _UCRT && !_NO_CRT_STDIO_INLINE */
458 #endif /* _STDIO_DEFINED */
460 #ifdef __cplusplus
462 #endif
465 static inline FILE* fdopen(int fd, const char *mode) { return _fdopen(fd, mode); }
466 static inline int fgetchar(void) { return _fgetchar(); }
467 static inline int fileno(FILE* file) { return _fileno(file); }
468 static inline int fputchar(int c) { return _fputchar(c); }
469 static inline int pclose(FILE* file) { return _pclose(file); }
470 static inline FILE* popen(const char* command, const char* mode) { return _popen(command, mode); }
471 static inline char* tempnam(const char *dir, const char *prefix) { return _tempnam(dir, prefix); }
472 #ifndef _UNLINK_DEFINED
473 static inline int unlink(const char* path) { return _unlink(path); }
474 #define _UNLINK_DEFINED
475 #endif
477 #if !defined(_NO_CRT_STDIO_INLINE)
479 static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
480 static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format, ...)
482 int ret;
483 va_list args;
485 va_start(args, format);
486 ret = vsnprintf(buffer, size, format, args);
487 va_end(args);
488 return ret;
491 static inline int WINAPIV _snprintf(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
492 static inline int WINAPIV _snprintf(char *buffer, size_t size, const char *format, ...)
494 int ret;
495 va_list args;
497 va_start(args, format);
498 ret = _vsnprintf(buffer, size, format, args);
499 va_end(args);
500 return ret;
503 static inline int WINAPIV sprintf(char *buffer, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
504 static inline int WINAPIV sprintf(char *buffer, const char *format, ...)
506 int ret;
507 va_list args;
509 va_start(args, format);
510 ret = _vsnprintf(buffer, (size_t)_CRT_INT_MAX, format, args);
511 va_end(args);
512 return ret;
515 #else /* !_NO_CRT_STDIO_INLINE */
517 _ACRTIMP int WINAPIV snprintf(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
518 _ACRTIMP int WINAPIV _snprintf(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
519 _ACRTIMP int WINAPIV sprintf(char*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
521 #endif /* !_NO_CRT_STDIO_INLINE */
523 static inline wint_t fgetwchar(void) { return _fgetwchar(); }
524 static inline wint_t fputwchar(wint_t wc) { return _fputwchar(wc); }
525 static inline int getw(FILE* file) { return _getw(file); }
526 static inline int putw(int val, FILE* file) { return _putw(val, file); }
527 static inline FILE* wpopen(const wchar_t* command,const wchar_t* mode) { return _wpopen(command, mode); }
529 #endif /* __WINE_STDIO_H */