2002-08-17 03:22:00 +02:00
|
|
|
/*
|
|
|
|
* general implementation of scanf used by scanf, sscanf, fscanf,
|
|
|
|
* _cscanf, wscanf, swscanf and fwscanf
|
|
|
|
*
|
|
|
|
* Copyright 1996,1998 Marcus Meissner
|
|
|
|
* Copyright 1996 Jukka Iivonen
|
|
|
|
* Copyright 1997,2000 Uwe Bonnes
|
|
|
|
* Copyright 2000 Jon Griffiths
|
|
|
|
* Copyright 2002 Daniel Gudbjartsson
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-08-17 03:22:00 +02:00
|
|
|
*/
|
|
|
|
|
2020-12-04 15:50:22 +01:00
|
|
|
#include <conio.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2010-04-22 17:55:27 +02:00
|
|
|
#include <limits.h>
|
2012-11-01 15:27:29 +01:00
|
|
|
#include <math.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
|
|
|
|
#include "windef.h"
|
2002-08-17 03:22:00 +02:00
|
|
|
#include "winbase.h"
|
2002-10-15 04:20:07 +02:00
|
|
|
#include "winternl.h"
|
2002-08-17 03:22:00 +02:00
|
|
|
#include "msvcrt.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
|
|
|
|
|
|
|
/* helper function for *scanf. Returns the value of character c in the
|
|
|
|
* given base, or -1 if the given character is not a digit of the base.
|
|
|
|
*/
|
|
|
|
static int char2digit(char c, int base) {
|
|
|
|
if ((c>='0') && (c<='9') && (c<='0'+base-1)) return (c-'0');
|
|
|
|
if (base<=10) return -1;
|
|
|
|
if ((c>='A') && (c<='Z') && (c<='A'+base-11)) return (c-'A'+10);
|
|
|
|
if ((c>='a') && (c<='z') && (c<='a'+base-11)) return (c-'a'+10);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* helper function for *wscanf. Returns the value of character c in the
|
|
|
|
* given base, or -1 if the given character is not a digit of the base.
|
|
|
|
*/
|
2020-11-27 14:16:49 +01:00
|
|
|
static int wchar2digit(wchar_t c, int base) {
|
2007-06-22 23:39:31 +02:00
|
|
|
if ((c>='0') && (c<='9') && (c<='0'+base-1)) return (c-'0');
|
2002-08-17 03:22:00 +02:00
|
|
|
if (base<=10) return -1;
|
2007-06-22 23:39:31 +02:00
|
|
|
if ((c>='A') && (c<='Z') && (c<='A'+base-11)) return (c-'A'+10);
|
|
|
|
if ((c>='a') && (c<='z') && (c<='a'+base-11)) return (c-'a'+10);
|
2002-08-17 03:22:00 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2010-04-22 13:48:49 +02:00
|
|
|
/* vfscanf_l */
|
2002-08-17 03:22:00 +02:00
|
|
|
#undef WIDE_SCANF
|
|
|
|
#undef CONSOLE
|
|
|
|
#undef STRING
|
2010-04-22 17:55:27 +02:00
|
|
|
#undef SECURE
|
2002-08-17 03:22:00 +02:00
|
|
|
#include "scanf.h"
|
|
|
|
|
2016-08-24 13:58:31 +02:00
|
|
|
/* vfscanf_s_l */
|
2010-04-22 13:51:41 +02:00
|
|
|
#define SECURE 1
|
|
|
|
#include "scanf.h"
|
|
|
|
|
2010-04-22 13:48:49 +02:00
|
|
|
/* vfwscanf_l */
|
2002-08-17 03:22:00 +02:00
|
|
|
#define WIDE_SCANF 1
|
|
|
|
#undef CONSOLE
|
|
|
|
#undef STRING
|
2010-04-22 17:55:27 +02:00
|
|
|
#undef SECURE
|
2002-08-17 03:22:00 +02:00
|
|
|
#include "scanf.h"
|
|
|
|
|
2010-04-22 13:52:18 +02:00
|
|
|
/* vfwscanf_s_l */
|
|
|
|
#define SECURE 1
|
|
|
|
#include "scanf.h"
|
|
|
|
|
2010-04-22 13:48:49 +02:00
|
|
|
/* vsscanf_l */
|
2002-08-17 03:22:00 +02:00
|
|
|
#undef WIDE_SCANF
|
|
|
|
#undef CONSOLE
|
|
|
|
#define STRING 1
|
2010-04-22 17:55:27 +02:00
|
|
|
#undef SECURE
|
2002-08-17 03:22:00 +02:00
|
|
|
#include "scanf.h"
|
|
|
|
|
2010-04-22 13:52:55 +02:00
|
|
|
/* vsscanf_s_l */
|
|
|
|
#define SECURE 1
|
|
|
|
#include "scanf.h"
|
|
|
|
|
2011-04-05 17:06:58 +02:00
|
|
|
/* vsnscanf_l */
|
|
|
|
#undef SECURE
|
|
|
|
#define STRING_LEN 1
|
|
|
|
#include "scanf.h"
|
|
|
|
|
|
|
|
/* vsnscanf_s_l */
|
|
|
|
#define SECURE
|
|
|
|
#include "scanf.h"
|
2020-01-02 19:01:56 +01:00
|
|
|
#undef STRING_LEN
|
2011-04-05 17:07:17 +02:00
|
|
|
|
2020-01-02 19:01:56 +01:00
|
|
|
/* vswscanf_l */
|
2011-04-05 17:07:17 +02:00
|
|
|
#define WIDE_SCANF 1
|
2020-01-02 19:01:56 +01:00
|
|
|
#undef CONSOLE
|
|
|
|
#define STRING 1
|
2011-04-05 17:07:17 +02:00
|
|
|
#undef SECURE
|
|
|
|
#include "scanf.h"
|
|
|
|
|
2020-01-02 19:01:56 +01:00
|
|
|
/* vsnwscanf_l */
|
|
|
|
#define STRING_LEN 1
|
|
|
|
#include "scanf.h"
|
|
|
|
|
2011-04-05 17:07:17 +02:00
|
|
|
/* vsnwscanf_s_l */
|
|
|
|
#define SECURE 1
|
|
|
|
#include "scanf.h"
|
2011-04-05 17:06:58 +02:00
|
|
|
#undef STRING_LEN
|
|
|
|
|
2010-04-22 13:53:10 +02:00
|
|
|
/* vswscanf_s_l */
|
|
|
|
#define SECURE 1
|
|
|
|
#include "scanf.h"
|
|
|
|
|
2010-04-22 13:48:49 +02:00
|
|
|
/* vcscanf_l */
|
2002-08-17 03:22:00 +02:00
|
|
|
#undef WIDE_SCANF
|
|
|
|
#define CONSOLE 1
|
|
|
|
#undef STRING
|
2010-04-22 17:55:27 +02:00
|
|
|
#undef SECURE
|
2002-08-17 03:22:00 +02:00
|
|
|
#include "scanf.h"
|
2004-02-19 02:13:12 +01:00
|
|
|
|
2010-04-22 13:53:28 +02:00
|
|
|
/* vcscanf_s_l */
|
|
|
|
#define SECURE 1
|
|
|
|
#include "scanf.h"
|
|
|
|
|
2010-04-22 13:54:03 +02:00
|
|
|
/* 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"
|
|
|
|
|
2004-02-19 02:13:12 +01:00
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* fscanf (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV fscanf(FILE *file, const char *format, ...)
|
2004-02-19 02:13:12 +01:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2004-02-19 02:13:12 +01:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfscanf_l(file, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2004-02-19 02:13:12 +01:00
|
|
|
return res;
|
2010-04-22 13:49:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _fscanf_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _fscanf_l(FILE *file, const char *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale, ...)
|
2010-04-22 13:49:06 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:49:06 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfscanf_l(file, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:49:06 +02:00
|
|
|
return res;
|
2004-02-19 02:13:12 +01:00
|
|
|
}
|
|
|
|
|
2010-04-22 13:51:41 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* fscanf_s (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV fscanf_s(FILE *file, const char *format, ...)
|
2010-04-22 13:51:41 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:51:41 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfscanf_s_l(file, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:51:41 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _fscanf_s_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _fscanf_s_l(FILE *file, const char *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale, ...)
|
2010-04-22 13:51:41 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:51:41 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfscanf_s_l(file, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:51:41 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2004-02-19 02:13:12 +01:00
|
|
|
/*********************************************************************
|
|
|
|
* scanf (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV scanf(const char *format, ...)
|
2004-02-19 02:13:12 +01:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2004-02-19 02:13:12 +01:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfscanf_l(MSVCRT_stdin, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2004-02-19 02:13:12 +01:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2010-04-22 13:49:16 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* _scanf_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _scanf_l(const char *format, _locale_t locale, ...)
|
2010-04-22 13:49:16 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:49:16 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfscanf_l(MSVCRT_stdin, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:49:16 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2010-04-22 13:51:57 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* scanf_s (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV scanf_s(const char *format, ...)
|
2010-04-22 13:51:57 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:51:57 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfscanf_s_l(MSVCRT_stdin, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:51:57 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _scanf_s_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _scanf_s_l(const char *format, _locale_t locale, ...)
|
2010-04-22 13:51:57 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:51:57 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfscanf_s_l(MSVCRT_stdin, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:51:57 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2004-02-19 02:13:12 +01:00
|
|
|
/*********************************************************************
|
|
|
|
* fwscanf (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV fwscanf(FILE *file, const wchar_t *format, ...)
|
2004-02-19 02:13:12 +01:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2004-02-19 02:13:12 +01:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfwscanf_l(file, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2004-02-19 02:13:12 +01:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2010-04-22 13:49:35 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* _fwscanf_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _fwscanf_l(FILE *file, const wchar_t *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale, ...)
|
2010-04-22 13:49:35 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:49:35 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfwscanf_l(file, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:49:35 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2010-04-22 13:52:18 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* fwscanf_s (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV fwscanf_s(FILE *file, const wchar_t *format, ...)
|
2010-04-22 13:52:18 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:52:18 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfwscanf_s_l(file, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:52:18 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _fwscanf_s_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _fwscanf_s_l(FILE *file, const wchar_t *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale, ...)
|
2010-04-22 13:52:18 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:52:18 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfwscanf_s_l(file, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:52:18 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2004-02-19 02:13:12 +01:00
|
|
|
/*********************************************************************
|
|
|
|
* wscanf (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV wscanf(const wchar_t *format, ...)
|
2004-02-19 02:13:12 +01:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2004-02-19 02:13:12 +01:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfwscanf_l(MSVCRT_stdin, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2004-02-19 02:13:12 +01:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2010-04-22 13:49:58 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* _wscanf_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _wscanf_l(const wchar_t *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale, ...)
|
2010-04-22 13:49:58 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:49:58 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfwscanf_l(MSVCRT_stdin, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:49:58 +02:00
|
|
|
return res;
|
|
|
|
}
|
2004-02-19 02:13:12 +01:00
|
|
|
|
2010-04-22 13:52:33 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* wscanf_s (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV wscanf_s(const wchar_t *format, ...)
|
2010-04-22 13:52:33 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:52:33 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfwscanf_s_l(MSVCRT_stdin, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:52:33 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _wscanf_s_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _wscanf_s_l(const wchar_t *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale, ...)
|
2010-04-22 13:52:33 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:52:33 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vfwscanf_s_l(MSVCRT_stdin, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:52:33 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2004-02-19 02:13:12 +01:00
|
|
|
/*********************************************************************
|
|
|
|
* sscanf (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV sscanf(const char *str, const char *format, ...)
|
2004-02-19 02:13:12 +01:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2004-02-19 02:13:12 +01:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsscanf_l(str, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2004-02-19 02:13:12 +01:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2010-04-22 13:50:20 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* _sscanf_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _sscanf_l(const char *str, const char *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale, ...)
|
2010-04-22 13:50:20 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:50:20 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsscanf_l(str, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:50:20 +02:00
|
|
|
return res;
|
|
|
|
}
|
2004-02-19 02:13:12 +01:00
|
|
|
|
2010-04-22 13:52:55 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* sscanf_s (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV sscanf_s(const char *str, const char *format, ...)
|
2010-04-22 13:52:55 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:52:55 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsscanf_s_l(str, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:52:55 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _sscanf_s_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _sscanf_s_l(const char *str, const char *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale, ...)
|
2010-04-22 13:52:55 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:52:55 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsscanf_s_l(str, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:52:55 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2004-02-19 02:13:12 +01:00
|
|
|
/*********************************************************************
|
|
|
|
* swscanf (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV swscanf(const wchar_t *str, const wchar_t *format, ...)
|
2004-02-19 02:13:12 +01:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2004-02-19 02:13:12 +01:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vswscanf_l(str, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2004-02-19 02:13:12 +01:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2010-04-22 13:51:03 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* _swscanf_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _swscanf_l(const wchar_t *str, const wchar_t *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale, ...)
|
2010-04-22 13:51:03 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:51:03 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vswscanf_l(str, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:51:03 +02:00
|
|
|
return res;
|
|
|
|
}
|
2004-02-19 02:13:12 +01:00
|
|
|
|
2010-04-22 13:53:10 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* swscanf_s (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV swscanf_s(const wchar_t *str, const wchar_t *format, ...)
|
2010-04-22 13:53:10 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:53:10 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vswscanf_s_l(str, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:53:10 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _swscanf_s_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _swscanf_s_l(const wchar_t *str, const wchar_t *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale, ...)
|
2010-04-22 13:53:10 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:53:10 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vswscanf_s_l(str, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:53:10 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2004-02-19 02:13:12 +01:00
|
|
|
/*********************************************************************
|
|
|
|
* _cscanf (MSVCRT.@)
|
|
|
|
*/
|
2017-11-02 10:19:18 +01:00
|
|
|
int WINAPIV _cscanf(const char *format, ...)
|
2004-02-19 02:13:12 +01:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2004-02-19 02:13:12 +01:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vcscanf_l(format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2004-02-19 02:13:12 +01:00
|
|
|
return res;
|
|
|
|
}
|
2010-04-22 13:51:15 +02:00
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _cscanf_l (MSVCRT.@)
|
|
|
|
*/
|
2020-11-26 19:19:18 +01:00
|
|
|
int WINAPIV _cscanf_l(const char *format, _locale_t locale, ...)
|
2010-04-22 13:51:15 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:51:15 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vcscanf_l(format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:51:15 +02:00
|
|
|
return res;
|
|
|
|
}
|
2010-04-22 13:53:28 +02:00
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _cscanf_s (MSVCRT.@)
|
|
|
|
*/
|
2017-11-02 10:19:18 +01:00
|
|
|
int WINAPIV _cscanf_s(const char *format, ...)
|
2010-04-22 13:53:28 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:53:28 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vcscanf_s_l(format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:53:28 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _cscanf_s_l (MSVCRT.@)
|
|
|
|
*/
|
2020-11-26 19:19:18 +01:00
|
|
|
int WINAPIV _cscanf_s_l(const char *format, _locale_t locale, ...)
|
2010-04-22 13:53:28 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:53:28 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vcscanf_s_l(format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:53:28 +02:00
|
|
|
return res;
|
|
|
|
}
|
2010-04-22 13:54:03 +02:00
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _cwscanf (MSVCRT.@)
|
|
|
|
*/
|
2020-11-27 14:16:49 +01:00
|
|
|
int WINAPIV _cwscanf(const wchar_t *format, ...)
|
2010-04-22 13:54:03 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:54:03 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vcwscanf_l(format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:54:03 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _cwscanf_l (MSVCRT.@)
|
|
|
|
*/
|
2020-11-27 14:16:49 +01:00
|
|
|
int WINAPIV _cwscanf_l(const wchar_t *format, _locale_t locale, ...)
|
2010-04-22 13:54:03 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:54:03 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vcwscanf_l(format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:54:03 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _cwscanf_s (MSVCRT.@)
|
|
|
|
*/
|
2020-11-27 14:16:49 +01:00
|
|
|
int WINAPIV _cwscanf_s(const wchar_t *format, ...)
|
2010-04-22 13:54:03 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:54:03 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vcwscanf_s_l(format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:54:03 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _cwscanf_s_l (MSVCRT.@)
|
|
|
|
*/
|
2020-11-27 14:16:49 +01:00
|
|
|
int WINAPIV _cwscanf_s_l(const wchar_t *format, _locale_t locale, ...)
|
2010-04-22 13:54:03 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2010-04-22 13:54:03 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vcwscanf_s_l(format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2010-04-22 13:54:03 +02:00
|
|
|
return res;
|
|
|
|
}
|
2011-04-05 17:06:58 +02:00
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _snscanf (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _snscanf(const char *input, size_t length, const char *format, ...)
|
2011-04-05 17:06:58 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2011-04-05 17:06:58 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsnscanf_l(input, length, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2011-04-05 17:06:58 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _snscanf_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _snscanf_l(const char *input, size_t length,
|
2020-11-26 19:19:18 +01:00
|
|
|
const char *format, _locale_t locale, ...)
|
2011-04-05 17:06:58 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2011-04-05 17:06:58 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsnscanf_l(input, length, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2011-04-05 17:06:58 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _snscanf_s (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _snscanf_s(const char *input, size_t length, const char *format, ...)
|
2011-04-05 17:06:58 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2011-04-05 17:06:58 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsnscanf_s_l(input, length, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2011-04-05 17:06:58 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _snscanf_s_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _snscanf_s_l(const char *input, size_t length,
|
2020-11-26 19:19:18 +01:00
|
|
|
const char *format, _locale_t locale, ...)
|
2011-04-05 17:06:58 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2011-04-05 17:06:58 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsnscanf_s_l(input, length, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2011-04-05 17:06:58 +02:00
|
|
|
return res;
|
|
|
|
}
|
2011-04-05 17:07:17 +02:00
|
|
|
|
2015-10-29 11:39:44 +01:00
|
|
|
|
|
|
|
/*********************************************************************
|
2017-09-04 20:06:56 +02:00
|
|
|
* __stdio_common_vsscanf (UCRTBASE.@)
|
2015-10-29 11:39:44 +01:00
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int CDECL __stdio_common_vsscanf(unsigned __int64 options,
|
2020-11-27 14:17:05 +01:00
|
|
|
const char *input, size_t length,
|
2015-10-29 11:39:44 +01:00
|
|
|
const char *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale,
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist)
|
2015-10-29 11:39:44 +01:00
|
|
|
{
|
2015-11-03 19:40:41 +01:00
|
|
|
/* LEGACY_WIDE_SPECIFIERS only has got an effect on the wide
|
|
|
|
* scanf. LEGACY_MSVCRT_COMPATIBILITY affects parsing of nan/inf,
|
|
|
|
* but parsing of those isn't implemented at all yet. */
|
|
|
|
if (options & ~UCRTBASE_SCANF_MASK)
|
2015-10-29 11:39:44 +01:00
|
|
|
FIXME("options %s not handled\n", wine_dbgstr_longlong(options));
|
2020-11-30 14:37:33 +01:00
|
|
|
if (options & _CRT_INTERNAL_SCANF_SECURECRT)
|
2020-12-02 00:54:03 +01:00
|
|
|
return vsnscanf_s_l(input, length, format, locale, valist);
|
2015-11-03 19:40:41 +01:00
|
|
|
else
|
2020-12-02 00:54:03 +01:00
|
|
|
return vsnscanf_l(input, length, format, locale, valist);
|
2015-10-29 11:39:44 +01:00
|
|
|
}
|
|
|
|
|
2016-08-24 13:58:31 +02:00
|
|
|
/*********************************************************************
|
2017-09-04 20:06:56 +02:00
|
|
|
* __stdio_common_vswscanf (UCRTBASE.@)
|
2016-08-24 13:58:31 +02:00
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int CDECL __stdio_common_vswscanf(unsigned __int64 options,
|
2020-11-27 14:17:05 +01:00
|
|
|
const wchar_t *input, size_t length,
|
2020-11-27 14:16:49 +01:00
|
|
|
const wchar_t *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale,
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist)
|
2016-08-24 13:58:31 +02:00
|
|
|
{
|
|
|
|
/* LEGACY_WIDE_SPECIFIERS only has got an effect on the wide
|
|
|
|
* scanf. LEGACY_MSVCRT_COMPATIBILITY affects parsing of nan/inf,
|
|
|
|
* but parsing of those isn't implemented at all yet. */
|
|
|
|
if (options & ~UCRTBASE_SCANF_MASK)
|
|
|
|
FIXME("options %s not handled\n", wine_dbgstr_longlong(options));
|
2020-11-30 14:37:33 +01:00
|
|
|
if (options & _CRT_INTERNAL_SCANF_SECURECRT)
|
2020-12-02 00:54:03 +01:00
|
|
|
return vsnwscanf_s_l(input, length, format, locale, valist);
|
2016-08-24 13:58:31 +02:00
|
|
|
else
|
2020-12-02 00:54:03 +01:00
|
|
|
return vsnwscanf_l(input, length, format, locale, valist);
|
2016-08-24 13:58:31 +02:00
|
|
|
}
|
|
|
|
|
2016-08-24 13:58:32 +02:00
|
|
|
/*********************************************************************
|
2017-09-04 20:06:56 +02:00
|
|
|
* __stdio_common_vfscanf (UCRTBASE.@)
|
2016-08-24 13:58:32 +02:00
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int CDECL __stdio_common_vfscanf(unsigned __int64 options,
|
2020-12-01 13:51:39 +01:00
|
|
|
FILE *file,
|
2016-08-24 13:58:32 +02:00
|
|
|
const char *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale,
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist)
|
2016-08-24 13:58:32 +02:00
|
|
|
{
|
2020-11-30 14:37:33 +01:00
|
|
|
if (options & ~_CRT_INTERNAL_SCANF_SECURECRT)
|
2016-08-24 13:58:32 +02:00
|
|
|
FIXME("options %s not handled\n", wine_dbgstr_longlong(options));
|
2020-11-30 14:37:33 +01:00
|
|
|
if (options & _CRT_INTERNAL_SCANF_SECURECRT)
|
2020-12-02 00:54:03 +01:00
|
|
|
return vfscanf_s_l(file, format, locale, valist);
|
2016-08-24 13:58:32 +02:00
|
|
|
else
|
2020-12-02 00:54:03 +01:00
|
|
|
return vfscanf_l(file, format, locale, valist);
|
2016-08-24 13:58:32 +02:00
|
|
|
}
|
|
|
|
|
2016-08-08 23:02:16 +02:00
|
|
|
/*********************************************************************
|
2017-09-04 20:06:56 +02:00
|
|
|
* __stdio_common_vfwscanf (UCRTBASE.@)
|
2016-08-08 23:02:16 +02:00
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int CDECL __stdio_common_vfwscanf(unsigned __int64 options,
|
2020-12-01 13:51:39 +01:00
|
|
|
FILE *file,
|
2020-11-27 14:16:49 +01:00
|
|
|
const wchar_t *format,
|
2020-11-26 19:19:18 +01:00
|
|
|
_locale_t locale,
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist)
|
2016-08-08 23:02:16 +02:00
|
|
|
{
|
2020-11-30 14:37:33 +01:00
|
|
|
if (options & ~_CRT_INTERNAL_SCANF_SECURECRT)
|
2016-08-08 23:02:16 +02:00
|
|
|
FIXME("options %s not handled\n", wine_dbgstr_longlong(options));
|
2020-11-30 14:37:33 +01:00
|
|
|
if (options & _CRT_INTERNAL_SCANF_SECURECRT)
|
2020-12-02 00:54:03 +01:00
|
|
|
return vfwscanf_s_l(file, format, locale, valist);
|
2016-08-08 23:02:16 +02:00
|
|
|
else
|
2020-12-02 00:54:03 +01:00
|
|
|
return vfwscanf_l(file, format, locale, valist);
|
2016-08-08 23:02:16 +02:00
|
|
|
}
|
|
|
|
|
2011-04-05 17:07:17 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* _snwscanf (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _snwscanf(wchar_t *input, size_t length,
|
2020-11-27 14:16:49 +01:00
|
|
|
const wchar_t *format, ...)
|
2011-04-05 17:07:17 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2011-04-05 17:07:17 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsnwscanf_l(input, length, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2011-04-05 17:07:17 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _snwscanf_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _snwscanf_l(wchar_t *input, size_t length,
|
2020-11-27 14:16:49 +01:00
|
|
|
const wchar_t *format, _locale_t locale, ...)
|
2011-04-05 17:07:17 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2011-04-05 17:07:17 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsnwscanf_l(input, length, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2011-04-05 17:07:17 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _snwscanf_s (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _snwscanf_s(wchar_t *input, size_t length,
|
2020-11-27 14:16:49 +01:00
|
|
|
const wchar_t *format, ...)
|
2011-04-05 17:07:17 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2011-04-05 17:07:17 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, format);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsnwscanf_s_l(input, length, format, NULL, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2011-04-05 17:07:17 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _snscanf_s_l (MSVCRT.@)
|
|
|
|
*/
|
2020-12-02 00:54:03 +01:00
|
|
|
int WINAPIV _snwscanf_s_l(wchar_t *input, size_t length,
|
2020-11-27 14:16:49 +01:00
|
|
|
const wchar_t *format, _locale_t locale, ...)
|
2011-04-05 17:07:17 +02:00
|
|
|
{
|
2021-10-22 11:12:09 +02:00
|
|
|
va_list valist;
|
2011-04-05 17:07:17 +02:00
|
|
|
int res;
|
|
|
|
|
2021-10-22 11:12:09 +02:00
|
|
|
va_start(valist, locale);
|
2020-12-02 00:54:03 +01:00
|
|
|
res = vsnwscanf_s_l(input, length, format, locale, valist);
|
2021-10-22 11:12:09 +02:00
|
|
|
va_end(valist);
|
2011-04-05 17:07:17 +02:00
|
|
|
return res;
|
|
|
|
}
|
2017-09-23 19:16:45 +02:00
|
|
|
|
2020-12-02 00:54:03 +01:00
|
|
|
#if _MSVCR_VER==120
|
2017-12-28 18:46:54 +01:00
|
|
|
|
2017-09-23 19:16:45 +02:00
|
|
|
/*********************************************************************
|
|
|
|
* vsscanf (MSVCRT120.@)
|
|
|
|
*/
|
2021-10-22 11:12:09 +02:00
|
|
|
int CDECL MSVCRT_vsscanf(const char *buffer, const char *format, va_list valist)
|
2017-09-23 19:16:45 +02:00
|
|
|
{
|
|
|
|
if (!MSVCRT_CHECK_PMT(buffer != NULL && format != NULL)) return -1;
|
|
|
|
|
2020-12-02 00:54:03 +01:00
|
|
|
return vsscanf_l(buffer, format, NULL, valist);
|
2017-09-23 19:16:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* vswscanf (MSVCRT120.@)
|
|
|
|
*/
|
2021-10-22 11:12:09 +02:00
|
|
|
int CDECL vswscanf(const wchar_t *buffer, const wchar_t *format, va_list valist)
|
2017-09-23 19:16:45 +02:00
|
|
|
{
|
|
|
|
if (!MSVCRT_CHECK_PMT(buffer != NULL && format != NULL)) return -1;
|
|
|
|
|
2020-12-02 00:54:03 +01:00
|
|
|
return vswscanf_l(buffer, format, NULL, valist);
|
2017-09-23 19:16:45 +02:00
|
|
|
}
|
2017-12-28 18:46:54 +01:00
|
|
|
|
|
|
|
#endif /* _MSVCR_VER>=120 */
|