mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
libc/stream: Add support for lib_scanf
This commit adds support for the `lib_scanf` function, which is a stream-oriented version of the `scanf` function. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -1279,6 +1279,24 @@ int lib_vscanf(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lib_scanf
|
||||
****************************************************************************/
|
||||
|
||||
int lib_scanf(FAR struct lib_instream_s *stream, FAR int *lastc,
|
||||
FAR const IPTR char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int n;
|
||||
|
||||
/* Let lib_vscanf do the real work */
|
||||
|
||||
va_start(ap, fmt);
|
||||
n = lib_vscanf(stream, lastc, fmt, ap);
|
||||
va_end(ap);
|
||||
return n;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lib_bscanf
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user