MentOS  0.8.0
The Mentoring Operating System
Functions
vscanf.c File Reference

Reading formatting routines. More...

Functions

static int __vsscanf (const char *buf, const char *s, va_list ap)
 Read formatted data from string. More...
 
static int __vfscanf (int fd, const char *fmt, va_list ap)
 Read formatted data from file. More...
 
int scanf (const char *fmt,...)
 Read formatted input from stdin. More...
 
int fscanf (int fd, const char *fmt,...)
 The same as sscanf but the source is a file. More...
 
int sscanf (const char *buf, const char *fmt,...)
 Read formatted data from string. More...
 

Detailed Description

Reading formatting routines.

Function Documentation

◆ __vfscanf()

static int __vfscanf ( int  fd,
const char *  fmt,
va_list  ap 
)
static

Read formatted data from file.

Parameters
fdthe file descriptor associated with the file.
fmtformat string, following the same specifications as printf.
apthe list of arguments where the values are stored.
Returns
On success, the function returns the number of items of the argument list successfully filled. EOF otherwise.

◆ __vsscanf()

static int __vsscanf ( const char *  buf,
const char *  s,
va_list  ap 
)
static

Read formatted data from string.

Parameters
bufString processed as source to retrieve the data.
sFormat string, following the same specifications as printf.
apThe list of arguments where the values are stored.
Returns
On success, the function returns the number of items of the argument list successfully filled. EOF otherwise.

◆ fscanf()

int fscanf ( int  fd,
const char *  fmt,
  ... 
)

The same as sscanf but the source is a file.

Parameters
fdThe file descriptor associated with the file.
fmtFormat string, following the same specifications as printf.
...The list of arguments where the values are stored.
Returns
On success, the function returns the number of items of the argument list successfully filled. EOF otherwise.

◆ scanf()

int scanf ( const char *  fmt,
  ... 
)

Read formatted input from stdin.

Parameters
fmtFormat string, following the same specifications as printf.
...The list of arguments where the values are stored.
Returns
On success, the function returns the number of items of the argument list successfully filled. EOF otherwise.

◆ sscanf()

int sscanf ( const char *  str,
const char *  fmt,
  ... 
)

Read formatted data from string.

Parameters
strString processed as source to retrieve the data.
fmtFormat string, following the same specifications as printf.
...The list of arguments where the values are stored.
Returns
On success, the function returns the number of items of the argument list successfully filled. EOF otherwise.