ReactOS  0.4.14-dev-55-g2da92ac
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 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 CDECL _snscanf (const char *input, size_t length, const char *format,...)
 

Macro Definition Documentation

◆ CONSOLE

#define CONSOLE   1

Definition at line 101 of file scanf.c.

◆ STRING [1/3]

#define STRING   1

Definition at line 93 of file scanf.c.

◆ STRING [2/3]

#define STRING   1

Definition at line 93 of file scanf.c.

◆ STRING [3/3]

#define STRING   1

Definition at line 93 of file scanf.c.

◆ STRING_LEN

#define STRING_LEN   1

Definition at line 94 of file scanf.c.

◆ WIDE_SCANF [1/2]

#define WIDE_SCANF   1

Definition at line 84 of file scanf.c.

◆ WIDE_SCANF [2/2]

#define WIDE_SCANF   1

Definition at line 84 of file scanf.c.

Function Documentation

◆ _cscanf()

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

Definition at line 199 of file scanf.c.

200 {
202  int res;
203 
205  res = vcscanf_l(format, NULL, valist);
207  return res;
208 }
static const char __ms_va_list
Definition: printf.c:70
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:443
#define __ms_va_start(list, arg)
Definition: windef.h:442
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:59

◆ _snscanf()

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

Definition at line 214 of file scanf.c.

215 {
217  int res;
218 
220  res = vsnscanf_l(input, length, format, NULL, valist);
222  return res;
223 }
static const char __ms_va_list
Definition: printf.c:70
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:443
#define __ms_va_start(list, arg)
Definition: windef.h:442
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:59

◆ 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 110 of file scanf.c.

111 {
113  int res;
114 
116  res = vfscanf_l(file, format, NULL, valist);
118  return res;
119 }
static const char __ms_va_list
Definition: printf.c:70
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:443
#define __ms_va_start(list, arg)
Definition: windef.h:442
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:59
Definition: fci.c:126

◆ fwscanf()

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

Definition at line 138 of file scanf.c.

139 {
141  int res;
142 
144  res = vfwscanf_l(file, format, NULL, valist);
146  return res;
147 }
static const char __ms_va_list
Definition: printf.c:70
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:443
#define __ms_va_start(list, arg)
Definition: windef.h:442
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:59
Definition: fci.c:126

◆ scanf()

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

Definition at line 124 of file scanf.c.

125 {
127  int res;
128 
130  res = vfscanf_l(stdin, format, NULL, valist);
132  return res;
133 }
static const char __ms_va_list
Definition: printf.c:70
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:443
#define __ms_va_start(list, arg)
Definition: windef.h:442
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:59

◆ sscanf()

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

Definition at line 169 of file scanf.c.

170 {
172  int res;
173 
175  res = vsscanf_l(str, format, NULL, valist);
177  return res;
178 }
static const char __ms_va_list
Definition: printf.c:70
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:443
#define __ms_va_start(list, arg)
Definition: windef.h:442
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:59

Referenced by test_sscanf().

◆ swscanf()

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

Definition at line 184 of file scanf.c.

185 {
187  int res;
188 
190  res = vswscanf_l(str, format, NULL, valist);
192  return res;
193 }
static const char __ms_va_list
Definition: printf.c:70
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:443
#define __ms_va_start(list, arg)
Definition: windef.h:442
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:59

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 153 of file scanf.c.

154 {
156  int res;
157 
159  res = vfwscanf_l(stdin, format, NULL, valist);
161  return res;
162 }
static const char __ms_va_list
Definition: printf.c:70
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:443
#define __ms_va_start(list, arg)
Definition: windef.h:442
GLuint res
Definition: glext.h:9613
static __ms_va_list valist
Definition: printf.c:59