setupapi: Return CR_SUCCESS for CM_Get_DevNode_Status{_Ex}.
[wine.git] / include / msvcrt / stdio.h
blobce1985422856de6cf6892d261c099ebc1b57e221
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 int __cdecl fseek(FILE*,__msvcrt_long,int);
125 _ACRTIMP int __cdecl _fseeki64(FILE*,__int64,int);
126 _ACRTIMP int __cdecl fsetpos(FILE*,fpos_t*);
127 _ACRTIMP __msvcrt_long __cdecl ftell(FILE*);
128 _ACRTIMP __int64 __cdecl _ftelli64(FILE*);
129 _ACRTIMP size_t __cdecl fwrite(const void*,size_t,size_t,FILE*);
130 _ACRTIMP int __cdecl getc(FILE*);
131 _ACRTIMP int __cdecl getchar(void);
132 _ACRTIMP char* __cdecl gets(char*);
133 _ACRTIMP void __cdecl perror(const char*);
134 _ACRTIMP int __cdecl putc(int,FILE*);
135 _ACRTIMP int __cdecl putchar(int);
136 _ACRTIMP int __cdecl puts(const char*);
137 _ACRTIMP int __cdecl remove(const char*);
138 _ACRTIMP int __cdecl rename(const char*,const char*);
139 _ACRTIMP void __cdecl rewind(FILE*);
140 _ACRTIMP void __cdecl setbuf(FILE*,char*);
141 _ACRTIMP int __cdecl setvbuf(FILE*,char*,int,size_t);
142 _ACRTIMP FILE* __cdecl tmpfile(void);
143 _ACRTIMP char* __cdecl tmpnam(char*);
144 _ACRTIMP int __cdecl ungetc(int,FILE*);
145 _ACRTIMP unsigned int __cdecl _get_output_format(void);
146 _ACRTIMP unsigned int __cdecl _set_output_format(unsigned int);
148 #ifdef _UCRT
150 _ACRTIMP int __cdecl __stdio_common_vfprintf(unsigned __int64,FILE*,const char*,_locale_t,va_list);
151 _ACRTIMP int __cdecl __stdio_common_vfprintf_s(unsigned __int64,FILE*,const char*,_locale_t,va_list);
152 _ACRTIMP int __cdecl __stdio_common_vsprintf(unsigned __int64,char*,size_t,const char*,_locale_t,va_list);
153 _ACRTIMP int __cdecl __stdio_common_vsprintf_p(unsigned __int64,char*,size_t,const char*,_locale_t,va_list);
154 _ACRTIMP int __cdecl __stdio_common_vsprintf_s(unsigned __int64,char*,size_t,const char*,_locale_t,va_list);
155 _ACRTIMP int __cdecl __stdio_common_vsnprintf_s(unsigned __int64,char*,size_t,size_t,const char*,_locale_t,va_list);
157 _ACRTIMP int __cdecl __stdio_common_vfscanf(unsigned __int64,FILE*,const char*,_locale_t,va_list);
158 _ACRTIMP int __cdecl __stdio_common_vsscanf(unsigned __int64,char const*,size_t,const char*,_locale_t,va_list);
160 #endif /* _UCRT */
162 #if defined(_UCRT) && !defined(_NO_CRT_STDIO_INLINE)
164 static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
165 static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *format, va_list args)
167 int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
168 buffer, size, format, NULL, args);
169 return ret < 0 ? -1 : ret;
172 static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
173 static inline int __cdecl _vsnprintf(char *buffer, size_t size, const char *format, va_list args)
175 int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
176 buffer, size, format, NULL, args);
177 return ret < 0 ? -1 : ret;
180 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);
181 static inline int __cdecl _vsnprintf_s(char *buffer, size_t size, size_t count, const char *format, va_list args)
183 int ret = __stdio_common_vsnprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, count, format, NULL, args);
184 return ret < 0 ? -1 : ret;
187 static inline int WINAPIV _snprintf_s(char *buffer, size_t size, size_t count, const char *format, ...) __WINE_CRT_PRINTF_ATTR(4, 5);
188 static inline int WINAPIV _snprintf_s(char *buffer, size_t size, size_t count, const char *format, ...)
190 int ret;
191 va_list args;
193 va_start(args, format);
194 ret = __stdio_common_vsnprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, count, format, NULL, args);
195 va_end(args);
196 return ret;
199 static inline int __cdecl _vscprintf(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
200 static inline int __cdecl _vscprintf(const char *format, va_list args)
202 int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
203 NULL, 0, format, NULL, args);
204 return ret < 0 ? -1 : ret;
207 static inline int WINAPIV _scprintf(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
208 static inline int WINAPIV _scprintf(const char *format, ...)
210 int ret;
211 va_list args;
213 va_start(args, format);
214 ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
215 NULL, 0, format, NULL, args);
216 va_end(args);
217 return ret;
220 static inline int __cdecl vsprintf(char *buffer, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
221 static inline int __cdecl vsprintf(char *buffer, const char *format, va_list args)
223 int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION,
224 buffer, -1, format, NULL, args);
225 return ret < 0 ? -1 : ret;
228 static inline int __cdecl vsprintf_s(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
229 static inline int __cdecl vsprintf_s(char *buffer, size_t size, const char *format, va_list args)
231 int ret = __stdio_common_vsprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
232 return ret < 0 ? -1 : ret;
235 static inline int WINAPIV sprintf_s(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
236 static inline int WINAPIV sprintf_s(char *buffer, size_t size, const char *format, ...)
238 int ret;
239 va_list args;
241 va_start(args, format);
242 ret = __stdio_common_vsprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, NULL, args);
243 va_end(args);
244 return ret;
247 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);
248 static inline int __cdecl _vsprintf_p_l(char *buffer, size_t size, const char *format, _locale_t locale, va_list args)
250 int ret = __stdio_common_vsprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, buffer, size, format, locale, args);
251 return ret < 0 ? -1 : ret;
254 static inline int __cdecl vfprintf(FILE *file, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
255 static inline int __cdecl vfprintf(FILE *file, const char *format, va_list args)
257 return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
260 static inline int WINAPIV fprintf(FILE *file, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
261 static inline int WINAPIV fprintf(FILE *file, const char *format, ...)
263 int ret;
264 va_list args;
266 va_start(args, format);
267 ret = __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
268 va_end(args);
269 return ret;
272 static inline int __cdecl vfprintf_s(FILE *file, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(2, 0);
273 static inline int __cdecl vfprintf_s(FILE *file, const char *format, va_list args)
275 return __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
278 static inline int WINAPIV fprintf_s(FILE *file, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
279 static inline int WINAPIV fprintf_s(FILE *file, const char *format, ...)
281 int ret;
282 va_list args;
284 va_start(args, format);
285 ret = __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, format, NULL, args);
286 va_end(args);
287 return ret;
290 static inline int vprintf(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
291 static inline int vprintf(const char *format, va_list args)
293 return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
296 static inline int WINAPIV printf(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
297 static inline int WINAPIV printf(const char *format, ...)
299 int ret;
300 va_list args;
302 va_start(args, format);
303 ret = __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
304 va_end(args);
305 return ret;
308 static inline int vprintf_s(const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(1, 0);
309 static inline int vprintf_s(const char *format, va_list args)
311 return __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
314 static inline int WINAPIV printf_s(const char *format, ...) __WINE_CRT_PRINTF_ATTR(1, 2);
315 static inline int WINAPIV printf_s(const char *format, ...)
317 int ret;
318 va_list args;
320 va_start(args, format);
321 ret = __stdio_common_vfprintf_s(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, format, NULL, args);
322 va_end(args);
323 return ret;
326 static inline int WINAPIV sscanf(const char *buffer, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
327 static inline int WINAPIV sscanf(const char *buffer, const char *format, ...)
329 int ret;
330 va_list args;
332 va_start(args, format);
333 ret = __stdio_common_vsscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, buffer, -1, format, NULL, args);
334 va_end(args);
335 return ret;
338 static inline int WINAPIV sscanf_s(const char *buffer, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
339 static inline int WINAPIV sscanf_s(const char *buffer, const char *format, ...)
341 int ret;
342 va_list args;
344 va_start(args, format);
345 ret = __stdio_common_vsscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, buffer, -1, format, NULL, args);
346 va_end(args);
347 return ret;
350 static inline int WINAPIV _snscanf_l(const char *buffer, size_t size, const char *format, _locale_t locale, ...) __WINE_CRT_SCANF_ATTR(3, 5);
351 static inline int WINAPIV _snscanf_l(const char *buffer, size_t size, const char *format, _locale_t locale, ...)
353 int ret;
354 va_list args;
356 va_start(args, locale);
357 ret = __stdio_common_vsscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, buffer, size, format, locale, args);
358 va_end(args);
359 return ret;
362 static inline int WINAPIV _sscanf_l(const char *buffer, const char *format, _locale_t locale, ...) __WINE_CRT_SCANF_ATTR(2, 4);
363 static inline int WINAPIV _sscanf_l(const char *buffer, const char *format, _locale_t locale, ...)
365 int ret;
366 va_list args;
368 va_start(args, locale);
369 ret = __stdio_common_vsscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, buffer, -1, format, locale, args);
370 va_end(args);
371 return ret;
374 static inline int WINAPIV fscanf(FILE *file, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
375 static inline int WINAPIV fscanf(FILE *file, const char *format, ...)
377 int ret;
378 va_list args;
380 va_start(args, format);
381 ret = __stdio_common_vfscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, file, format, NULL, args);
382 va_end(args);
383 return ret;
386 static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...) __WINE_CRT_SCANF_ATTR(2, 3);
387 static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...)
389 int ret;
390 va_list args;
392 va_start(args, format);
393 ret = __stdio_common_vfscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, file, format, NULL, args);
394 va_end(args);
395 return ret;
398 static inline int WINAPIV scanf(const char *format, ...) __WINE_CRT_SCANF_ATTR(1, 2);
399 static inline int WINAPIV scanf(const char *format, ...)
401 int ret;
402 va_list args;
404 va_start(args, format);
405 ret = __stdio_common_vfscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, stdin, format, NULL, args);
406 va_end(args);
407 return ret;
410 static inline int WINAPIV scanf_s(const char *format, ...) __WINE_CRT_SCANF_ATTR(1, 2);
411 static inline int WINAPIV scanf_s(const char *format, ...)
413 int ret;
414 va_list args;
416 va_start(args, format);
417 ret = __stdio_common_vfscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, stdin, format, NULL, args);
418 va_end(args);
419 return ret;
422 #else /* _UCRT && !_NO_CRT_STDIO_INLINE */
424 _ACRTIMP int WINAPIV _scprintf(const char *,...) __WINE_CRT_PRINTF_ATTR(1, 2);
425 _ACRTIMP int WINAPIV _snprintf_s(char*,size_t,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(4, 5);
426 _ACRTIMP int __cdecl _vscprintf(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
427 _ACRTIMP int __cdecl _vsnprintf_s(char*,size_t,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(4, 0);
428 _ACRTIMP int __cdecl _vsprintf_p_l(char*,size_t,const char*,_locale_t,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
429 _ACRTIMP int WINAPIV fprintf(FILE*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
430 _ACRTIMP int WINAPIV fprintf_s(FILE*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
431 _ACRTIMP int WINAPIV printf(const char*,...) __WINE_CRT_PRINTF_ATTR(1, 2);
432 _ACRTIMP int WINAPIV printf_s(const char*,...) __WINE_CRT_PRINTF_ATTR(1, 2);
433 _ACRTIMP int WINAPIV sprintf_s(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
434 _ACRTIMP int __cdecl vfprintf(FILE*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
435 _ACRTIMP int __cdecl vfprintf_s(FILE*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
436 _ACRTIMP int __cdecl vprintf(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
437 _ACRTIMP int __cdecl vprintf_s(const char*,va_list) __WINE_CRT_PRINTF_ATTR(1, 0);
438 _ACRTIMP int __cdecl vsprintf(char*,const char*,va_list) __WINE_CRT_PRINTF_ATTR(2, 0);
439 _ACRTIMP int __cdecl vsprintf_s(char*,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
441 _ACRTIMP int __cdecl _vsnprintf(char*,size_t,const char*,va_list) __WINE_CRT_PRINTF_ATTR(3, 0);
442 static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args) __WINE_CRT_PRINTF_ATTR(3, 0);
443 static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args)
444 { return _vsnprintf(buffer,size,format,args); }
446 _ACRTIMP int WINAPIV _snscanf_l(const char*,size_t,const char*,_locale_t,...) __WINE_CRT_SCANF_ATTR(3, 5);
447 _ACRTIMP int WINAPIV _sscanf_l(const char *,const char*,_locale_t,...) __WINE_CRT_SCANF_ATTR(2, 4);
448 _ACRTIMP int WINAPIV fscanf(FILE*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
449 _ACRTIMP int WINAPIV fscanf_s(FILE*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
450 _ACRTIMP int WINAPIV scanf(const char*,...) __WINE_CRT_SCANF_ATTR(1, 2);
451 _ACRTIMP int WINAPIV scanf_s(const char*,...) __WINE_CRT_SCANF_ATTR(1, 2);
452 _ACRTIMP int WINAPIV sscanf(const char*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
453 _ACRTIMP int WINAPIV sscanf_s(const char*,const char*,...) __WINE_CRT_SCANF_ATTR(2, 3);
455 #endif /* _UCRT && !_NO_CRT_STDIO_INLINE */
457 #endif /* _STDIO_DEFINED */
459 #ifdef __cplusplus
461 #endif
464 static inline FILE* fdopen(int fd, const char *mode) { return _fdopen(fd, mode); }
465 static inline int fgetchar(void) { return _fgetchar(); }
466 static inline int fileno(FILE* file) { return _fileno(file); }
467 static inline int fputchar(int c) { return _fputchar(c); }
468 static inline int pclose(FILE* file) { return _pclose(file); }
469 static inline FILE* popen(const char* command, const char* mode) { return _popen(command, mode); }
470 static inline char* tempnam(const char *dir, const char *prefix) { return _tempnam(dir, prefix); }
471 #ifndef _UNLINK_DEFINED
472 static inline int unlink(const char* path) { return _unlink(path); }
473 #define _UNLINK_DEFINED
474 #endif
476 #if !defined(_NO_CRT_STDIO_INLINE)
478 static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
479 static inline int WINAPIV snprintf(char *buffer, size_t size, const char *format, ...)
481 int ret;
482 va_list args;
484 va_start(args, format);
485 ret = vsnprintf(buffer, size, format, args);
486 va_end(args);
487 return ret;
490 static inline int WINAPIV _snprintf(char *buffer, size_t size, const char *format, ...) __WINE_CRT_PRINTF_ATTR(3, 4);
491 static inline int WINAPIV _snprintf(char *buffer, size_t size, const char *format, ...)
493 int ret;
494 va_list args;
496 va_start(args, format);
497 ret = _vsnprintf(buffer, size, format, args);
498 va_end(args);
499 return ret;
502 static inline int WINAPIV sprintf(char *buffer, const char *format, ...) __WINE_CRT_PRINTF_ATTR(2, 3);
503 static inline int WINAPIV sprintf(char *buffer, const char *format, ...)
505 int ret;
506 va_list args;
508 va_start(args, format);
509 ret = _vsnprintf(buffer, (size_t)_CRT_INT_MAX, format, args);
510 va_end(args);
511 return ret;
514 #else /* !_NO_CRT_STDIO_INLINE */
516 _ACRTIMP int WINAPIV snprintf(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
517 _ACRTIMP int WINAPIV _snprintf(char*,size_t,const char*,...) __WINE_CRT_PRINTF_ATTR(3, 4);
518 _ACRTIMP int WINAPIV sprintf(char*,const char*,...) __WINE_CRT_PRINTF_ATTR(2, 3);
520 #endif /* !_NO_CRT_STDIO_INLINE */
522 static inline wint_t fgetwchar(void) { return _fgetwchar(); }
523 static inline wint_t fputwchar(wint_t wc) { return _fputwchar(wc); }
524 static inline int getw(FILE* file) { return _getw(file); }
525 static inline int putw(int val, FILE* file) { return _putw(val, file); }
526 static inline FILE* wpopen(const wchar_t* command,const wchar_t* mode) { return _wpopen(command, mode); }
528 #endif /* __WINE_STDIO_H */