FreeBSD kernel kern code
subr_scanf.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ctype.h>
#include <sys/limits.h>
#include <sys/stddef.h>
#include <machine/stdarg.h>
Include dependency graph for subr_scanf.c:

Go to the source code of this file.

Macros

#define BUF   32 /* Maximum length of numeric string. */
 
#define LONG   0x01 /* l: long or double */
 
#define SHORT   0x04 /* h: short */
 
#define SUPPRESS   0x08 /* suppress assignment */
 
#define POINTER   0x10 /* weird %p pointer (`fake hex') */
 
#define NOSKIP   0x20 /* do not skip blanks */
 
#define QUAD   0x400
 
#define INTMAXT   0x800 /* j: intmax_t */
 
#define PTRDIFFT   0x1000 /* t: ptrdiff_t */
 
#define SIZET   0x2000 /* z: size_t */
 
#define SHORTSHORT   0x4000 /** hh: char */
 
#define SIGNOK   0x40 /* +/- is (still) legal */
 
#define NDIGITS   0x80 /* no digits detected */
 
#define DPTOK   0x100 /* (float) decimal point is still legal */
 
#define EXPOK   0x200 /* (float) exponent (e+3, etc) still legal */
 
#define PFXOK   0x100 /* 0x prefix is (still) legal */
 
#define NZDIGITS   0x200 /* no zero digits detected */
 
#define CT_CHAR   0 /* %c conversion */
 
#define CT_CCL   1 /* %[...] conversion */
 
#define CT_STRING   2 /* %s conversion */
 
#define CT_INT   3 /* integer, i.e., strtoq or strtouq */
 

Typedefs

typedef u_quad_t(* ccfntype) (const char *, char **, int)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static const u_char * __sccl (char *, const u_char *)
 
int sscanf (const char *ibuf, const char *fmt,...)
 
int vsscanf (const char *inp, char const *fmt0, va_list ap)
 

Macro Definition Documentation

◆ BUF

#define BUF   32 /* Maximum length of numeric string. */

Definition at line 54 of file subr_scanf.c.

◆ CT_CCL

#define CT_CCL   1 /* %[...] conversion */

Definition at line 88 of file subr_scanf.c.

◆ CT_CHAR

#define CT_CHAR   0 /* %c conversion */

Definition at line 87 of file subr_scanf.c.

◆ CT_INT

#define CT_INT   3 /* integer, i.e., strtoq or strtouq */

Definition at line 90 of file subr_scanf.c.

◆ CT_STRING

#define CT_STRING   2 /* %s conversion */

Definition at line 89 of file subr_scanf.c.

◆ DPTOK

#define DPTOK   0x100 /* (float) decimal point is still legal */

Definition at line 78 of file subr_scanf.c.

◆ EXPOK

#define EXPOK   0x200 /* (float) exponent (e+3, etc) still legal */

Definition at line 79 of file subr_scanf.c.

◆ INTMAXT

#define INTMAXT   0x800 /* j: intmax_t */

Definition at line 65 of file subr_scanf.c.

◆ LONG

#define LONG   0x01 /* l: long or double */

Definition at line 59 of file subr_scanf.c.

◆ NDIGITS

#define NDIGITS   0x80 /* no digits detected */

Definition at line 76 of file subr_scanf.c.

◆ NOSKIP

#define NOSKIP   0x20 /* do not skip blanks */

Definition at line 63 of file subr_scanf.c.

◆ NZDIGITS

#define NZDIGITS   0x200 /* no zero digits detected */

Definition at line 82 of file subr_scanf.c.

◆ PFXOK

#define PFXOK   0x100 /* 0x prefix is (still) legal */

Definition at line 81 of file subr_scanf.c.

◆ POINTER

#define POINTER   0x10 /* weird %p pointer (`fake hex') */

Definition at line 62 of file subr_scanf.c.

◆ PTRDIFFT

#define PTRDIFFT   0x1000 /* t: ptrdiff_t */

Definition at line 66 of file subr_scanf.c.

◆ QUAD

#define QUAD   0x400

Definition at line 64 of file subr_scanf.c.

◆ SHORT

#define SHORT   0x04 /* h: short */

Definition at line 60 of file subr_scanf.c.

◆ SHORTSHORT

#define SHORTSHORT   0x4000 /** hh: char */

Definition at line 68 of file subr_scanf.c.

◆ SIGNOK

#define SIGNOK   0x40 /* +/- is (still) legal */

Definition at line 75 of file subr_scanf.c.

◆ SIZET

#define SIZET   0x2000 /* z: size_t */

Definition at line 67 of file subr_scanf.c.

◆ SUPPRESS

#define SUPPRESS   0x08 /* suppress assignment */

Definition at line 61 of file subr_scanf.c.

Typedef Documentation

◆ ccfntype

typedef u_quad_t(* ccfntype) (const char *, char **, int)

Definition at line 91 of file subr_scanf.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ __sccl()

static const u_char * __sccl ( char *  tab,
const u_char *  fmt 
)
static

Definition at line 581 of file subr_scanf.c.

Referenced by vsscanf().

Here is the caller graph for this function:

◆ sscanf()

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

Definition at line 96 of file subr_scanf.c.

References vsscanf().

Referenced by bitset_strscan(), kern_unmount(), res_find(), stats_tpl_sample_rates(), sysctl_handle_domainset(), and validate_uuid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vsscanf()

int vsscanf ( const char *  inp,
char const *  fmt0,
va_list  ap 
)

Definition at line 108 of file subr_scanf.c.

References __sccl(), BUF, buf, CT_CCL, CT_CHAR, CT_INT, CT_STRING, flags, INTMAXT, LONG, NDIGITS, NOSKIP, NZDIGITS, PFXOK, PTRDIFFT, QUAD, res, SHORT, SHORTSHORT, SIGNOK, SIZET, and SUPPRESS.

Referenced by sscanf(), and vfs_scanopt().

Here is the call graph for this function:
Here is the caller graph for this function: