Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/sscanf.c')
-rw-r--r--newlib/libc/stdio/sscanf.c82
1 files changed, 34 insertions, 48 deletions
diff --git a/newlib/libc/stdio/sscanf.c b/newlib/libc/stdio/sscanf.c
index 5ad39d8b7..7cf897c5b 100644
--- a/newlib/libc/stdio/sscanf.c
+++ b/newlib/libc/stdio/sscanf.c
@@ -16,8 +16,9 @@
*/
/*
+
FUNCTION
-<<scanf>>, <<fscanf>>, <<sscanf>>---scan and format input
+ <<scanf>>, <<fscanf>>, <<sscanf>>---scan and format input
INDEX
scanf
@@ -34,12 +35,10 @@ ANSI_SYNOPSIS
int sscanf(const char *<[str]>, const char *<[format]>
[, <[arg]>, ...]);
- int _scanf_r(struct _reent *<[ptr]>, const char *<[format]>
- [, <[arg]>, ...]);
- int _fscanf_r(struct _reent *<[ptr]>, FILE *<[fd]>, const char *<[format]>
- [, <[arg]>, ...]);
- int _sscanf_r(struct _reent *<[ptr]>, const char *<[str]>,
- const char *<[format]> [, <[arg]>, ...]);
+ int _scanf_r(struct _reent *<[ptr]>, const char *<[format]> [, <[arg]>, ...]);
+ int _fscanf_r(struct _reent *<[ptr]>, FILE *<[fd]>, const char *<[format]> [, <[arg]>, ...]);
+ int _sscanf_r(struct _reent *<[ptr]>, const char *<[str]>, const char *<[format]>
+ [, <[arg]>, ...]);
TRAD_SYNOPSIS
@@ -153,31 +152,22 @@ DESCRIPTION
.Modifier Type(s)
-. hh d, i, o, u, x, n convert input to char,
-. store in char object
-.
-. h d, i, o, u, x, n convert input to short,
+. h d, i, o, u, x convert input to short,
. store in short object
.
. h D, I, O, U, X no effect
-. e, f, c, s, p
+. e, f, c, s, n, p
.
-. l d, i, o, u, x, n convert input to long,
+. l d, i, o, u, x convert input to long,
. store in long object
.
. l e, f, g convert input to double
. store in a double object
.
. l D, I, O, U, X no effect
-. c, s, p
-.
-. ll d, i, o, u, x, n convert to long long,
-. store in long long
-.
-. L d, i, o, u, x, n convert to long long,
-. store in long long
+. c, s, n, p
.
-. L e, f, g, E, G convert to long double,
+. L d, i, o, u, x convert to long double,
. store in long double
.
. L all others no effect
@@ -235,11 +225,11 @@ DESCRIPTION
<<(int *arg)>>.
o e, f, g
- Read a floating-point number into the corresponding <[arg]>:
+ Read a floating point number into the corresponding <[arg]>:
<<(float *arg)>>.
o E, F, G
- Read a floating-point number into the corresponding <[arg]>:
+ Read a floating point number into the corresponding <[arg]>:
<<(double *arg)>>.
o i
@@ -376,11 +366,12 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
/* | ARGSUSED */
/*SUPPRESS 590*/
-static _READ_WRITE_RETURN_TYPE
-_DEFUN(eofread, (cookie, buf, len),
- _PTR cookie _AND
- char *buf _AND
- int len)
+static
+_READ_WRITE_RETURN_TYPE
+eofread (cookie, buf, len)
+ _PTR cookie;
+ char *buf;
+ int len;
{
return 0;
}
@@ -389,28 +380,26 @@ _DEFUN(eofread, (cookie, buf, len),
#ifdef _HAVE_STDC
int
-_DEFUN(sscanf, (str, fmt),
- _CONST char *str _AND
- _CONST char *fmt _DOTS)
+_DEFUN (sscanf, (str, fmt), _CONST char *str _AND _CONST char *fmt _DOTS)
#else
int
-sscanf(str, fmt, va_alist)
- _CONST char *str;
- _CONST char *fmt;
- va_dcl
+sscanf (str, fmt, va_alist)
+ _CONST char *str;
+ _CONST char *fmt;
+ va_dcl
#endif
{
int ret;
va_list ap;
FILE f;
- f._flags = __SRD | __SSTR;
+ f._flags = __SRD;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = strlen (str);
f._read = eofread;
f._ub._base = NULL;
f._lb._base = NULL;
- f._file = -1; /* No file. */
+ f._data = _REENT;
#ifdef _HAVE_STDC
va_start (ap, fmt);
#else
@@ -425,30 +414,27 @@ sscanf(str, fmt, va_alist)
#ifdef _HAVE_STDC
int
-_DEFUN(_sscanf_r, (ptr, str, fmt),
- struct _reent *ptr _AND
- _CONST char *str _AND
- _CONST char *fmt _DOTS)
+_DEFUN (_sscanf_r, (ptr, str, fmt), struct _reent *ptr _AND _CONST char *str _AND _CONST char *fmt _DOTS)
#else
int
-_sscanf_r(ptr, str, fmt, va_alist)
- struct _reent *ptr;
- _CONST char *str;
- _CONST char *fmt;
- va_dcl
+_sscanf_r (ptr, str, fmt, va_alist)
+ struct _reent *ptr;
+ _CONST char *str;
+ _CONST char *fmt;
+ va_dcl
#endif
{
int ret;
va_list ap;
FILE f;
- f._flags = __SRD | __SSTR;
+ f._flags = __SRD;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = strlen (str);
f._read = eofread;
f._ub._base = NULL;
f._lb._base = NULL;
- f._file = -1; /* No file. */
+ f._data = _REENT;
#ifdef _HAVE_STDC
va_start (ap, fmt);
#else