-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwscanf.c
59 lines (40 loc) · 1.29 KB
/
wscanf.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*++
toro C Library
https://github.com/KilianKegel/toro-C-Library#toro-c-library-formerly-known-as-torito-c-library
Copyright (c) 2017-2025, Kilian Kegel. All rights reserved.
SPDX-License-Identifier: GNU General Public License v3.0
Module Name:
Swscanf.c
Abstract:
Implementation of the Standard C function.
Read formatted data from a wide string.
Author:
Kilian Kegel
--*/
#include <CdeServices.h>
//
// stdio.h
//
#define FILE void
extern int vfwscanf(FILE* stream, const wchar_t* pwcsFormat, va_list ap);
/**
Synopsis
#include <wchar.h>
int wscanf(const wchar_t *format, ...);
Description
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/scanf-scanf-l-wscanf-wscanf-l
http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf#page=378
Reads formatted data from the standard input stream.
Parameters
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/scanf-scanf-l-wscanf-wscanf-l#parameters
Returns
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/scanf-scanf-l-wscanf-wscanf-l#return-value
**/
int wscanf(const wchar_t* pwcsFormat, ...) {
va_list ap;
int nRet;
va_start(ap, pwcsFormat);
nRet = vfwscanf((void*)CDE_STDIN, pwcsFormat, ap);
va_end(ap);
return nRet;
}