ReactOS  0.4.15-dev-488-gc7a1924
scanf.c File Reference
#include <stdarg.h>
#include <limits.h>
#include <wine/winternl.h>
#include <wine/debug.h>
#include "winesup.h"
#include "scanf.h"
Include dependency graph for scanf.c:

Go to the source code of this file.

Macros

#define WIDE_SCANF   1
 
#define STRING   1
 
#define WIDE_SCANF   1
 
#define STRING   1
 
#define STRING   1
 
#define STRING_LEN   1
 
#define WIDE_SCANF   1
 
#define STRING   1
 
#define STRING_LEN   1
 
#define CONSOLE   1
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msvcrt)
 
static int char2digit (char c, int base)
 
static int wchar2digit (wchar_t c, int base)
 
int CDECL fscanf (FILE *file, const char *format,...)
 
int CDECL scanf (const char *format,...)
 
int CDECL fwscanf (FILE *file, const wchar_t *format,...)
 
int CDECL wscanf (const wchar_t *format,...)
 
int CDECL sscanf (const char *str, const char *format,...)
 
int CDECL swscanf (const wchar_t *str, const wchar_t *format,...)
 
int CDECL _cscanf (const char *format,...)
 
int WINAPIV _snwscanf (const wchar_t *input, size_t length, const wchar_t *format,...)
 
int CDECL _snscanf (const char *input, size_t length, const char *format,...)
 

Macro Definition Documentation

◆ CONSOLE

#define CONSOLE   1

Definition at line 109 of file scanf.c.

◆ STRING [1/4]

#define STRING   1

Definition at line 101 of file scanf.c.

◆ STRING [2/4]

#define STRING   1

Definition at line 101 of file scanf.c.

◆ STRING [3/4]

#define STRING   1

Definition at line 101 of file scanf.c.

◆ STRING [4/4]

#define STRING   1

Definition at line 101 of file scanf.c.

◆ STRING_LEN [1/2]

#define STRING_LEN   1

Definition at line 102 of file scanf.c.

◆ STRING_LEN [2/2]

#define STRING_LEN   1

Definition at line 102 of file scanf.c.

◆ WIDE_SCANF [1/3]

#define WIDE_SCANF   1

Definition at line 99 of file scanf.c.

◆ WIDE_SCANF [2/3]

#define WIDE_SCANF   1

Definition at line 99 of file scanf.c.

◆ WIDE_SCANF [3/3]

#define WIDE_SCANF   1

Definition at line 99 of file scanf.c.

Function Documentation

◆ _cscanf()

int CDECL _cscanf ( const char format,
  ... 
)

Definition at line 207 of file scanf.c.

208 {
210  int res;
211 
213  res = vcscanf_l(format, NULL, valist);
215  return res;
216 }
static static const char __ms_va_list
Definition: printf.c:76
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:64

◆ _snscanf()

int CDECL _snscanf ( const char input,
size_t  length,
const char format,
  ... 
)

Definition at line 237 of file scanf.c.

238 {
240  int res;
241 
243  res = vsnscanf_l(input, length, format, NULL, valist);
245  return res;
246 }
static static const char __ms_va_list
Definition: printf.c:76
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
GLenum GLenum GLenum input
Definition: glext.h:9031
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:64

◆ _snwscanf()

int WINAPIV _snwscanf ( const wchar_t input,
size_t  length,
const wchar_t format,
  ... 
)

Definition at line 222 of file scanf.c.

224 {
226  int res;
227 
229  res = vsnwscanf_l(input, length, format, NULL, valist);
231  return res;
232 }
static static const char __ms_va_list
Definition: printf.c:76
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
GLenum GLenum GLenum input
Definition: glext.h:9031
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:64

◆ char2digit()

static int char2digit ( char  c,
int  base 
)
static

Definition at line 41 of file scanf.c.

41  {
42  if ((c>='0') && (c<='9') && (c<='0'+base-1)) return (c-'0');
43  if (base<=10) return -1;
44  if ((c>='A') && (c<='Z') && (c<='A'+base-11)) return (c-'A'+10);
45  if ((c>='a') && (c<='z') && (c<='a'+base-11)) return (c-'a'+10);
46  return -1;
47 }
const GLubyte * c
Definition: glext.h:8905

◆ fscanf()

int CDECL fscanf ( FILE file,
const char format,
  ... 
)

Definition at line 118 of file scanf.c.

119 {
121  int res;
122 
124  res = vfscanf_l(file, format, NULL, valist);
126  return res;
127 }
static static const char __ms_va_list
Definition: printf.c:76
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:64
Definition: fci.c:126

◆ fwscanf()

int CDECL fwscanf ( FILE file,
const wchar_t format,
  ... 
)

Definition at line 146 of file scanf.c.

147 {
149  int res;
150 
152  res = vfwscanf_l(file, format, NULL, valist);
154  return res;
155 }
static static const char __ms_va_list
Definition: printf.c:76
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:64
Definition: fci.c:126

◆ scanf()

int CDECL scanf ( const char format,
  ... 
)

Definition at line 132 of file scanf.c.

133 {
135  int res;
136 
138  res = vfscanf_l(stdin, format, NULL, valist);
140  return res;
141 }
static static const char __ms_va_list
Definition: printf.c:76
FILE * stdin
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:64

◆ sscanf()

int CDECL sscanf ( const char str,
const char format,
  ... 
)

Definition at line 177 of file scanf.c.

178 {
180  int res;
181 
183  res = vsscanf_l(str, format, NULL, valist);
185  return res;
186 }
static static const char __ms_va_list
Definition: printf.c:76
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:64

◆ swscanf()

int CDECL swscanf ( const wchar_t str,
const wchar_t format,
  ... 
)

Definition at line 192 of file scanf.c.

193 {
195  int res;
196 
198  res = vswscanf_l(str, format, NULL, valist);
200  return res;
201 }
static static const char __ms_va_list
Definition: printf.c:76
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:64

Referenced by test_swscanf().

◆ wchar2digit()

static int wchar2digit ( wchar_t  c,
int  base 
)
static

Definition at line 52 of file scanf.c.

52  {
53  if ((c>='0') && (c<='9') && (c<='0'+base-1)) return (c-'0');
54  if (base<=10) return -1;
55  if ((c>='A') && (c<='Z') && (c<='A'+base-11)) return (c-'A'+10);
56  if ((c>='a') && (c<='z') && (c<='a'+base-11)) return (c-'a'+10);
57  return -1;
58 }
const GLubyte * c
Definition: glext.h:8905

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msvcrt  )

◆ wscanf()

int CDECL wscanf ( const wchar_t format,
  ... 
)

Definition at line 161 of file scanf.c.

162 {
164  int res;
165 
167  res = vfwscanf_l(stdin, format, NULL, valist);
169  return res;
170 }
static static const char __ms_va_list
Definition: printf.c:76
FILE * stdin
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
smooth NULL
Definition: ftsmooth.c:416
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:64