mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +08:00
Squashed commit of the following:
Author: Gregory Nutt <gnutt@nuttx.org> TODO: Remove 'Missing fscanf()' bug Clean up remaining complaints for tools/nxstyle Apply tools/detab, rmcr, convert-comments, lowhex, and indent.sh to the new and highly modified files. Author: Johannes <nivus.entwicklung@gmail.com> - Move vscanf logic to lib_sscanf.c Switched to stream interface (tricky, because the old implementation used massive read ahead, which isn't suitable for streams, chars already read are gone). - Added scanf and fscanf - Added hh, h, and ll modifiers - Fixes for standard compliance in scanf - Fixes for standard compliance in strto... function family (don't consume single '-' or '+', allow sign in strotul(l))
This commit is contained in:
@@ -459,6 +459,19 @@ int lib_sprintf(FAR struct lib_outstream_s *obj,
|
||||
int lib_vsprintf(FAR struct lib_outstream_s *obj,
|
||||
FAR const IPTR char *src, va_list ap);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lib_sscanf and lib_vsscanf
|
||||
*
|
||||
* Description:
|
||||
* Stream-oriented versions of sscanf and vsscanf.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int lib_sscanf(FAR struct lib_instream_s *obj,
|
||||
FAR const IPTR char *fmt, ...);
|
||||
int lib_vsscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
|
||||
FAR const IPTR char *src, va_list ap);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
||||
+5
-1
@@ -168,6 +168,7 @@ FAR char *gets_s(FAR char *s, rsize_t n);
|
||||
void setbuf(FAR FILE *stream, FAR char *buf);
|
||||
int setvbuf(FAR FILE *stream, FAR char *buffer, int mode, size_t size);
|
||||
int ungetc(int c, FAR FILE *stream);
|
||||
int fscanf(FAR FILE *stream, FAR const IPTR char *format, ...);
|
||||
|
||||
/* Operations on the stdout stream, buffers, paths, and the whole printf-family */
|
||||
|
||||
@@ -178,7 +179,7 @@ int sprintf(FAR char *buf, FAR const IPTR char *format, ...);
|
||||
int asprintf (FAR char **ptr, FAR const IPTR char *fmt, ...);
|
||||
int snprintf(FAR char *buf, size_t size,
|
||||
FAR const IPTR char *format, ...);
|
||||
int sscanf(FAR const char *buf, FAR const char *fmt, ...);
|
||||
int sscanf(FAR const char *buf, FAR const IPTR char *fmt, ...);
|
||||
void perror(FAR const char *s);
|
||||
|
||||
int vprintf(FAR const IPTR FAR char *format, va_list ap);
|
||||
@@ -189,6 +190,9 @@ int vasprintf(FAR char **ptr, FAR const IPTR char *fmt, va_list ap);
|
||||
int vsnprintf(FAR char *buf, size_t size, FAR const IPTR char *format,
|
||||
va_list ap);
|
||||
int vsscanf(FAR const char *buf, FAR const char *s, va_list ap);
|
||||
int scanf(FAR const IPTR char *format, ...);
|
||||
int vfscanf(FAR FILE *stream, FAR const IPTR char *format,
|
||||
va_list ap);
|
||||
|
||||
/* Operations on file descriptors including:
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user