Commit f36671c5 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Added _cwscanf* implementation.

parent 177d5455
...@@ -355,10 +355,10 @@ ...@@ -355,10 +355,10 @@
@ stub _cwprintf_p_l @ stub _cwprintf_p_l
@ stub _cwprintf_s @ stub _cwprintf_s
@ stub _cwprintf_s_l @ stub _cwprintf_s_l
@ stub _cwscanf @ varargs _cwscanf(wstr) msvcrt._cwscanf
@ stub _cwscanf_l @ varargs _cwscanf_l(wstr ptr) msvcrt._cwscanf_l
@ stub _cwscanf_s @ varargs _cwscanf_s(wstr) msvcrt._cwscanf_s
@ stub _cwscanf_s_l @ varargs _cwscanf_s_l(wstr ptr) msvcrt._cwscanf_s_l
@ extern _daylight msvcrt._daylight @ extern _daylight msvcrt._daylight
@ cdecl _decode_pointer(ptr) msvcr90._decode_pointer @ cdecl _decode_pointer(ptr) msvcr90._decode_pointer
@ cdecl _difftime32(long long) msvcrt._difftime32 @ cdecl _difftime32(long long) msvcrt._difftime32
......
...@@ -347,10 +347,10 @@ ...@@ -347,10 +347,10 @@
@ stub _cwprintf_p_l @ stub _cwprintf_p_l
@ stub _cwprintf_s @ stub _cwprintf_s
@ stub _cwprintf_s_l @ stub _cwprintf_s_l
@ stub _cwscanf @ varargs _cwscanf(wstr) msvcrt._cwscanf
@ stub _cwscanf_l @ varargs _cwscanf_l(wstr ptr) msvcrt._cwscanf_l
@ stub _cwscanf_s @ varargs _cwscanf_s(wstr) msvcrt._cwscanf_s
@ stub _cwscanf_s_l @ varargs _cwscanf_s_l(wstr ptr) msvcrt._cwscanf_s_l
@ extern _daylight msvcrt._daylight @ extern _daylight msvcrt._daylight
@ cdecl _decode_pointer(ptr) MSVCR90_decode_pointer @ cdecl _decode_pointer(ptr) MSVCR90_decode_pointer
@ cdecl _difftime32(long long) msvcrt._difftime32 @ cdecl _difftime32(long long) msvcrt._difftime32
......
...@@ -329,10 +329,10 @@ ...@@ -329,10 +329,10 @@
# stub _cwprintf_p_l # stub _cwprintf_p_l
# stub _cwprintf_s # stub _cwprintf_s
# stub _cwprintf_s_l # stub _cwprintf_s_l
# stub _cwscanf @ varargs _cwscanf(wstr)
# stub _cwscanf_l @ varargs _cwscanf_l(wstr ptr)
# stub _cwscanf_s @ varargs _cwscanf_s(wstr)
# stub _cwscanf_s_l @ varargs _cwscanf_s_l(wstr ptr)
@ extern _daylight MSVCRT___daylight @ extern _daylight MSVCRT___daylight
@ cdecl _difftime32(long long) MSVCRT__difftime32 @ cdecl _difftime32(long long) MSVCRT__difftime32
@ cdecl _difftime64(long long) MSVCRT__difftime64 @ cdecl _difftime64(long long) MSVCRT__difftime64
......
...@@ -113,6 +113,17 @@ static int wchar2digit(MSVCRT_wchar_t c, int base) { ...@@ -113,6 +113,17 @@ static int wchar2digit(MSVCRT_wchar_t c, int base) {
#define SECURE 1 #define SECURE 1
#include "scanf.h" #include "scanf.h"
/* vcwscanf_l */
#define WIDE_SCANF 1
#define CONSOLE 1
#undef STRING
#undef SECURE
#include "scanf.h"
/* vcwscanf_s_l */
#define SECURE 1
#include "scanf.h"
/********************************************************************* /*********************************************************************
* fscanf (MSVCRT.@) * fscanf (MSVCRT.@)
...@@ -515,3 +526,59 @@ int CDECL _cscanf_s_l(const char *format, MSVCRT__locale_t locale, ...) ...@@ -515,3 +526,59 @@ int CDECL _cscanf_s_l(const char *format, MSVCRT__locale_t locale, ...)
__ms_va_end(valist); __ms_va_end(valist);
return res; return res;
} }
/*********************************************************************
* _cwscanf (MSVCRT.@)
*/
int CDECL _cwscanf(const char *format, ...)
{
__ms_va_list valist;
int res;
__ms_va_start(valist, format);
res = MSVCRT_vcwscanf_l(format, NULL, valist);
__ms_va_end(valist);
return res;
}
/*********************************************************************
* _cwscanf_l (MSVCRT.@)
*/
int CDECL _cwscanf_l(const char *format, MSVCRT__locale_t locale, ...)
{
__ms_va_list valist;
int res;
__ms_va_start(valist, locale);
res = MSVCRT_vcwscanf_l(format, locale, valist);
__ms_va_end(valist);
return res;
}
/*********************************************************************
* _cwscanf_s (MSVCRT.@)
*/
int CDECL _cwscanf_s(const char *format, ...)
{
__ms_va_list valist;
int res;
__ms_va_start(valist, format);
res = MSVCRT_vcwscanf_s_l(format, NULL, valist);
__ms_va_end(valist);
return res;
}
/*********************************************************************
* _cwscanf_s_l (MSVCRT.@)
*/
int CDECL _cwscanf_s_l(const char *format, MSVCRT__locale_t locale, ...)
{
__ms_va_list valist;
int res;
__ms_va_start(valist, locale);
res = MSVCRT_vcwscanf_s_l(format, locale, valist);
__ms_va_end(valist);
return res;
}
...@@ -48,11 +48,19 @@ ...@@ -48,11 +48,19 @@
#ifdef CONSOLE #ifdef CONSOLE
#define _GETC_(file) (consumed++, _getch()) #define _GETC_(file) (consumed++, _getch())
#define _UNGETC_(nch, file) do { _ungetch(nch); consumed--; } while(0) #define _UNGETC_(nch, file) do { _ungetch(nch); consumed--; } while(0)
#ifdef WIDE_SCANF
#ifdef SECURE
#define _FUNCTION_ static int MSVCRT_vcwscanf_s_l(const char *format, MSVCRT__locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int MSVCRT_vcwscanf_l(const char *format, MSVCRT__locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#else /* WIDE_SCANF */
#ifdef SECURE #ifdef SECURE
#define _FUNCTION_ static int MSVCRT_vcscanf_s_l(const char *format, MSVCRT__locale_t locale, __ms_va_list ap) #define _FUNCTION_ static int MSVCRT_vcscanf_s_l(const char *format, MSVCRT__locale_t locale, __ms_va_list ap)
#else /* SECURE */ #else /* SECURE */
#define _FUNCTION_ static int MSVCRT_vcscanf_l(const char *format, MSVCRT__locale_t locale, __ms_va_list ap) #define _FUNCTION_ static int MSVCRT_vcscanf_l(const char *format, MSVCRT__locale_t locale, __ms_va_list ap)
#endif /* SECURE */ #endif /* SECURE */
#endif /* WIDE_SCANF */
#else #else
#ifdef STRING #ifdef STRING
#undef _EOF_ #undef _EOF_
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment