Jacek Caban : stdio.h: Add ucrt fscanf and fscanf_s declarations.

Alexandre Julliard julliard at winehq.org
Fri Feb 21 15:27:06 CST 2020


Module: wine
Branch: master
Commit: 8a5983197a6ae0d3312f8af6afda875a987298fc
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8a5983197a6ae0d3312f8af6afda875a987298fc

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Feb 21 16:41:26 2020 +0100

stdio.h: Add ucrt fscanf and fscanf_s declarations.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/msvcrt/stdio.h | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h
index 42799223d9..6e4a58e41e 100644
--- a/include/msvcrt/stdio.h
+++ b/include/msvcrt/stdio.h
@@ -118,8 +118,6 @@ int    __cdecl fputs(const char*,FILE*);
 size_t __cdecl fread(void*,size_t,size_t,FILE*);
 size_t __cdecl fread_s(void*,size_t,size_t,size_t,FILE*);
 FILE*  __cdecl freopen(const char*,const char*,FILE*);
-int    WINAPIV fscanf(FILE*,const char*,...);
-int    WINAPIV fscanf_s(FILE*,const char*,...);
 int    __cdecl fseek(FILE*,__msvcrt_long,int);
 int    __cdecl _fseeki64(FILE*,__int64,int);
 int    __cdecl fsetpos(FILE*,fpos_t*);
@@ -158,6 +156,8 @@ _ACRTIMP int __cdecl __stdio_common_vsprintf_p(unsigned __int64,char*,size_t,con
 _ACRTIMP int __cdecl __stdio_common_vsprintf_s(unsigned __int64,char*,size_t,const char*,_locale_t,__ms_va_list);
 _ACRTIMP int __cdecl __stdio_common_vsnprintf_s(unsigned __int64,char*,size_t,size_t,const char*,_locale_t,__ms_va_list);
 
+_ACRTIMP int __cdecl __stdio_common_vfscanf(unsigned __int64,FILE*,const char*,_locale_t,__ms_va_list);
+
 static inline int __cdecl vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args)
 {
     int ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR,
@@ -302,6 +302,28 @@ static inline int WINAPIV printf_s(const char *format, ...)
     return ret;
 }
 
+static inline int WINAPIV fscanf(FILE *file, const char *format, ...)
+{
+    int ret;
+    __ms_va_list args;
+
+    __ms_va_start(args, format);
+    ret = __stdio_common_vfscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, file, format, NULL, args);
+    __ms_va_end(args);
+    return ret;
+}
+
+static inline int WINAPIV fscanf_s(FILE *file, const char *format, ...)
+{
+    int ret;
+    __ms_va_list args;
+
+    __ms_va_start(args, format);
+    ret = __stdio_common_vfscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS | _CRT_INTERNAL_SCANF_SECURECRT, file, format, NULL, args);
+    __ms_va_end(args);
+    return ret;
+}
+
 #else /* _UCRT */
 
 _ACRTIMP int WINAPIV _scprintf(const char *,...);
@@ -324,6 +346,9 @@ _ACRTIMP int __cdecl vsprintf_s(char*,size_t,const char*,__ms_va_list);
 int __cdecl _vsnprintf(char*,size_t,const char*,__ms_va_list);
 static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format,args); }
 
+_ACRTIMP int WINAPIV fscanf(FILE*,const char*,...);
+_ACRTIMP int WINAPIV fscanf_s(FILE*,const char*,...);
+
 #endif /* _UCRT */
 
 #endif /* _STDIO_DEFINED */




More information about the wine-cvs mailing list