ChibiOS/HAL  7.2.0
Input Formatter Utility
Collaboration diagram for Input Formatter Utility:

Detailed Description

Mini scanf-like functionality.

Macros

#define CHSCANF_USE_FLOAT   FALSE
 Float type support. More...
 

Functions

int chvscanf (BaseBufferedStream *chp, const char *fmt, va_list ap)
 System formatted input function. More...
 
int chscanf (BaseBufferedStream *chp, const char *fmt,...)
 System formatted input function. More...
 
int chsnscanf (char *str, size_t size, const char *fmt,...)
 System formatted input function. More...
 
int chvsnscanf (char *str, size_t size, const char *fmt, va_list ap)
 System formatted input function. More...
 

Macro Definition Documentation

◆ CHSCANF_USE_FLOAT

#define CHSCANF_USE_FLOAT   FALSE

Float type support.

Definition at line 40 of file chscanf.h.

Function Documentation

◆ chvscanf()

int chvscanf ( BaseBufferedStream chp,
const char *  fmt,
va_list  ap 
)

System formatted input function.

This function implements a minimal vscanf()-like functionality with input on a BaseSequentialStream. The general parameters format is: %[*][width][l|L]p The following parameter types (p) are supported:

  • x hexadecimal integer.
  • X hexadecimal long.
  • o octal integer.
  • O octal long.
  • d decimal signed integer.
  • D decimal signed long.
  • u decimal unsigned integer.
  • U decimal unsigned long.
  • c character.
  • s string.
Parameters
[in]chppointer to a BufferedStream implementing object
[in]fmtformatting string
[in]aplist of parameters
Returns
The number parameters in ap that have been successfully filled. This does not conform to the standard in that if a failure (either matching or input) occurs before any parameters are assigned, the function will return 0.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 111 of file chscanf.c.

References streamGet.

Referenced by chscanf(), and chvsnscanf().

◆ chscanf()

int chscanf ( BaseBufferedStream chp,
const char *  fmt,
  ... 
)

System formatted input function.

This function implements a minimal scanf() like functionality with input from a BufferedStream. The general parameters format is: %[*][width][l|L]p The following parameter types (p) are supported:

  • x hexadecimal integer.
  • X hexadecimal long.
  • o octal integer.
  • O octal long.
  • d decimal signed integer.
  • D decimal signed long.
  • u decimal unsigned integer.
  • U decimal unsigned long.
  • c character.
  • s string.
Parameters
[in]chppointer to a BufferedStream implementing object
[in]fmtformatting string
Returns
The number parameters in ap that have been successfully filled. This does not conform to the standard in that if a failure (either matching or input) occurs before any parameters are assigned, the function will return 0.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 695 of file chscanf.c.

References chvscanf().

Here is the call graph for this function:

◆ chsnscanf()

int chsnscanf ( char *  str,
size_t  size,
const char *  fmt,
  ... 
)

System formatted input function.

This function implements a minimal snscanf()-like functionality. The general parameters format is: %[*][width][l|L]p The following parameter types (p) are supported:

  • x hexadecimal integer.
  • X hexadecimal long.
  • o octal integer.
  • O octal long.
  • d decimal signed integer.
  • D decimal signed long.
  • u decimal unsigned integer.
  • U decimal unsigned long.
  • c character.
  • s string.
Parameters
[in]strpointer to a buffer
[in]sizesize of the buffer
[in]fmtformatting string
Returns
The number parameters in ap that have been successfully filled. This does not conform to the standard in that if a failure (either matching or input) occurs before any parameters are assigned, the function will return 0.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 734 of file chscanf.c.

References chvsnscanf().

Here is the call graph for this function:

◆ chvsnscanf()

int chvsnscanf ( char *  str,
size_t  size,
const char *  fmt,
va_list  ap 
)

System formatted input function.

This function implements a minimal vsnscanf()-like functionality. The general parameters format is: %[*][width][l|L]p The following parameter types (p) are supported:

  • x hexadecimal integer.
  • X hexadecimal long.
  • o octal integer.
  • O octal long.
  • d decimal signed integer.
  • D decimal signed long.
  • u decimal unsigned integer.
  • U decimal unsigned long.
  • c character.
  • s string.
Parameters
[in]strpointer to a buffer
[in]sizesize of the buffer
[in]fmtformatting string
[in]aplist of parameters
Returns
The number parameters in ap that have been successfully filled. This does not conform to the standard in that if a failure (either matching or input) occurs before any parameters are assigned, the function will return 0.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 776 of file chscanf.c.

References chvscanf(), and msObjectInit().

Referenced by chsnscanf().

Here is the call graph for this function: