safec 3.15
Safe C Library - ISO TR24731 Bounds Checking Interface
Loading...
Searching...
No Matches
vu8sscanf_s.c File Reference
#include "safe_u8_lib.h"
Include dependency graph for vu8sscanf_s.c:

Functions

EXPORT int vu8sscanf_s (const char8_t *restrict dest, const char *restrict fmt, va_list ap)
 The vu8sscanf_s function reads a formatted utf-8 string, and writes to a list of arguments.

Function Documentation

◆ vu8sscanf_s()

EXPORT int vu8sscanf_s ( const char8_t *restrict dest,
const char *restrict fmt,
va_list ap )

The vu8sscanf_s function reads a formatted utf-8 string, and writes to a list of arguments.

Like u8sscanf_s(), the c, s, and %[ conversion specifiers here require their Annex K companion rsize_t destination-size argument: it is always consumed and enforced.

Parameters
[in]destpointer to a NUL-terminated utf-8 string to read from
[in]fmtformat-control string.
[out]aparguments to write to; every c, s, and %[ is followed by an rsize_t giving the size of its destination array
Precondition
Neither dest nor fmt shall be a null pointer.
dest shall not contain an illegal or truncated UTF-8 sequence.
c, s, and %[ conversion specifiers each expect two arguments (the usual pointer and a value of type rsize_t indicating the size of the receiving array, which may be 1 when reading with a c into a single character).
Returns
Number of receiving arguments successfully assigned, or EOF if read failure occurs before the first receiving argument was assigned or if there is a runtime constraint violation.
Return values
>0 on success, the number of arguments assigned
EOFon error, or when dest contains illegal UTF-8 or a c/s/%[ destination is too small (errno set to EILSEQ resp. ESNOSPC)
See also
u8sscanf_s(), vsscanf_s()