Home | History | Annotate | Download | only in stdio
History log of /src/lib/libc/stdio/vfscanf.c
RevisionDateAuthorComments
 1.47  24-May-2022  andvar fix various typos in comments, docs and log messages.
 1.46  19-Apr-2022  rillig lib: remove CONSTCOND comment

Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.
 1.45  17-May-2013  joerg Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
 1.44  19-Apr-2013  joerg Add scanf_l and wscanf_l families.
 1.43  15-Mar-2012  christos branches: 1.43.2;
- ansify, knf.
- no functional changes
 1.42  13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.41  16-Dec-2010  wiz branches: 1.41.6;
Observe the following spelling:
- wide character (noun)
- wide-character (adjective)

Inspired by jmc@OpenBSD.
 1.40  30-Jan-2009  lukem sign-compare fix
 1.39  28-Aug-2008  christos branches: 1.39.6;
Ignore whitespace in format string from Andy Shevchenko
 1.38  01-Apr-2007  christos branches: 1.38.12;
bring in FreeBSD's vfscanf() to gain multi-byte/collation support.
Unfortunately it is too difficult to make vfwscanf and this share
the same code like I did with printf, because for string parsing
the code is too different.
 1.37  16-Feb-2006  christos branches: 1.37.4;
- s/notyet/WIDE_DOUBLE/
- Add a little more glue for WIDE_DOUBLE; not done yet.
- s/def FLOATING_POINT/ndef NO_FLOATING_POINT/ to reduce diffs with FreeBSD.
- fix memory leak where each double formatted leaked 24 by calling __freedtoa()
appropriately. the new gdtoa keeps a list of memory chunks allocated by
malloc(), and it must maintained properly by calling __freedtoa() on the
results of __dtoa() Hi Klaus!
- in vfwprintf() make cvt return char * and convert it using __mbsconv(),
instead of having it return wchar_t *.

This should fix the memory leaks people have been reporting (eg. in top etc.)
 1.36  30-Dec-2003  martin Add support for scanf "hh" format modifiers - we use it in int_fmtio.h
for SCNd8 and friends - so we should support it properly (and not only
by pure luck on alignment blind little endian archs - it used the
"h" code path, storing a 16bit int via a byte pointer).

This makes sparc64 pass regress/lib/libc/int_fmtio.
 1.35  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.34  27-May-2003  thorpej Fix handing of -ve hexadecimal numbers in the %i format. Fixes
PR lib/21691. Patch from Simon Burge.
 1.33  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.32  26-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.31  24-May-2002  thorpej * Move the prototype of __svfscanf from <stdio.h> to libc/stdio/local.h.
* Add prototype for vfscanf to <stdio.h>.
* Remove #define of vfscanf to __svfscanf from <stdio.h>.
* Include local.h in libc files which need __svfscanf.
* Add vfscanf weak alias to __svfscanf.

Fixes standards/16997.

NOTE: libc minor not bumped -- ride on the bump to 12.84 made by
itojun today.
 1.30  07-Dec-2001  yamt branches: 1.30.2;
- make FILE structure extensible without breaking binary-compatibility.
- add fputwc, fgetwc, fwide and related functions.
- add hooks needed to maintain the orientation of file stream.
 1.29  02-Dec-2001  kleink C99: Recognize %F here, too.
 1.28  28-Apr-2001  kleink * Move definitions of exact-width integer types from <machine/types.h>
to <sys/types.h> and <sys/stdint.h>.
* Add a new C99 <stdint.h> header, which provides integer types of
explicit width, related limits and integer constant macros.
* Extend <inttypes.h> to provide <stdint.h> definitions and format
macros for printf() and scanf().
* Add C99 strtoimax() and strtoumax() functions.
* Use the latter within scanf().
* Add C99 %j, %t and %z printf()/scanf() conversions for
intmax_t, pointer-type and size_t arguments.
 1.27  08-Mar-2000  kleink branches: 1.27.6;
Replace internal use of strto{,u}q() with strto{,u}ll().
 1.26  21-Jan-2000  wrstuden Need to include "reentrant.h" for FLOCKFILE macros.
 1.25  21-Jan-2000  mycroft Do file locking.
 1.24  20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.23  16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.22  15-Nov-1998  christos delint
 1.21  25-Oct-1998  kleink Don't return immediately if EOF encountered while matching format string white
space in the input stream since there may be `conversion' specifiers following
the (format string) white space that do not operate on the input stream,
i.e. %n; from Chris Torek.
 1.20  27-Jul-1998  mycroft Delint (partially).
 1.19  26-Jul-1998  mycroft const poisoning.
 1.18  03-Feb-1998  perry remove obsolete register declarations
 1.17  19-Dec-1997  kleink Change several functions to return -1 instead of EOF, which was semantically
wrong.
 1.16  13-Jul-1997  christos branches: 1.16.2;
Fix RCSID's
Fix gcc warnings.
Add prototypes for functions that were declared in more than one place
to local.h or extern.h and use that instead.
 1.15  29-Mar-1996  jtc branches: 1.15.2;
Add explict function return types
 1.14  22-Mar-1995  jtc Added "long long" support %ll{d,x,o,i}.
 1.13  25-Feb-1995  cgd when you have a quad and want to assign to a pointer, you must say:
ptr = (ptr_type)(long)quad;
to quiet the compiler.
 1.12  02-Feb-1995  jtc branches: 1.12.2;
Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
 1.11  30-Jan-1995  jtc Handle long doubles.

Like Plauger's implementation in "The Standard C Library", we use strtod(),
which will limit the range of values that can be converter properly if
long double has greater precision or range than double.

We will need a string to long double function to handle this properly, but
this change is better than the previous behavior of ignoring the existance
of long doubles.
 1.10  27-Jan-1995  jtc Added support for quad_t and u_quad_t's with the 'q' flag.
 1.9  26-Jan-1995  jtc Removed conflicting "backwards compatibility" code to make scanf
ANSI compliant.
 1.8  19-Sep-1994  mycroft Move FLOATING_POINT definition into Makefile.inc.
 1.7  22-May-1994  cgd _VA_LIST_ -> _BSD_VA_LIST_
 1.6  26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.5  01-Aug-1993  mycroft Add RCS identifiers.
 1.4  12-Jul-1993  mycroft Make declarations match prototypes.
 1.3  09-Jul-1993  cgd update for better FP routines, from AT&T & elsewhere
 1.2  18-Apr-1993  mycroft Make arguments match prototypes.
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  02-Feb-1995  jtc imported from 44lite
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.12.2.1  17-Feb-1995  jtc Make namespace safe by using "namespace.h".
 1.15.2.1  16-Sep-1996  jtc snapshot namespace cleanup
 1.16.2.1  06-Nov-1998  cgd pull up rev 1.21 from trunk (kleink)
 1.27.6.5  21-Jun-2002  nathanw Catch up to -current.
 1.27.6.4  02-May-2002  nathanw Remove calls to FLOCKFILE() and FUNLOCKFILE() from vfprintf() and __svfscanf(),
rename those routines to vfprintf_unlocked() and __svfscanf_unlocked(),
and implement vfprintf() and __svfscanf() as small routines that do
FLOCKFILE()/foo_unlocked()/FUNLOCKFILE().
 1.27.6.3  06-Feb-2002  nathanw #include "reentrant.h" before "local.h" so that the thread types used
in fileext.h are avaliable.
 1.27.6.2  28-Jan-2002  nathanw Catch up to -current.
 1.27.6.1  08-Oct-2001  nathanw Catch up to -current.
 1.30.2.1  19-Jun-2003  grant Pull up revision 1.34 (requested by thorpej in ticket #1298):

Fix handing of -ve hexadecimal numbers in the %i format. Fixes
PR lib/21691. Patch from Simon Burge.
 1.37.4.1  07-May-2007  pavel Pull up following revision(s) (requested by manu in ticket #607):
lib/libc/arch/i386/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoa.c: revision 1.2-1.3
lib/libc/arch/x86_64/gen/isnanl.c: revision 1.6
lib/libc/gdtoa/gdtoaimp.h: revision 1.6
sys/arch/m68k/include/ieee.h: revision 1.13
usr.bin/xlint/lint1/scan.l: revision 1.36-1.37
lib/libc/stdio/snprintf_ss.c: revision 1.4
lib/libc/arch/i386/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfscanf.c: revision 1.38
sys/arch/sparc/include/ieee.h: revision 1.11-1.12
lib/libc/gdtoa/dtoa.c: revision 1.4
lib/libc/stdio/Makefile.inc: revision 1.35
lib/libc/stdio/fvwrite.c: revision 1.17
lib/libc/arch/m68k/gen/fpclassifyl.c: revision 1.2
lib/libc/arch/i386/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isinfl.c: revision 1.6
lib/libc/arch/x86_64/gen/isfinitel.c: revision 1.2
lib/libc/stdio/vfprintf.c: revision 1.55-1.57
lib/libc/stdio/vsnprintf_ss.c: revision 1.3
lib/libc/stdio/vfwprintf.c: revision 1.10
sys/arch/x86/include/ieee.h: revision 1.10
lib/libc/gdtoa/dmisc.c: revision 1.3
lib/libc/gdtoa/Makefile.inc: revision 1.5
sys/arch/hppa/include/ieee.h: revision 1.10
lib/libc/arch/x86_64/gen/fpclassifyl.c: revision 1.3
lib/libc/arch/i386/gen/fpclassifyl.c: revision 1.2
sys/sys/ieee754.h: revision 1.7
lib/libc/gdtoa/gdtoa.h: revision 1.7
include/stdio.h: revision 1.67-1.68
lib/libc/gdtoa/hdtoa.c: revision 1.1-1.4
lib/libc/gdtoa/ldtoa.c: revision 1.1-1.4
defined(_NETBSD_SOURCE) is equivalent to (!defined(_ANSI_SOURCE) &&
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)), so there's no
need to check both of them.
Fix for issue reported in PR lib/35401 as well as related overflow bugs.
deal with hex doubles.
Instead of abusing stdio to get a signal-safe version of sprintf, provide one.
remove __SAFE
add long double and hex double support from freebsd.
make this compile.
add new prototypes.
add the new files to the build. Note I am not bumping libc now, because
these are not used yet.
Merge the int bit with the high fraction bit. Add constants/macros
needed by gdtoa.
add constants used by gdtoa
since the int bit is merged, do the explicit math.
ext_int bit is no more.
ext_int bit is no more.
- merge change from freebsd
- add support for building as vfprintf.c
- XXX: we strdup to simplify the freeing logic. This should be fixed for
efficiency in the vfprintf case.
use vfwprintf.c
enable wide doubles.
some int -> size_t
deal with sparc64 that has 112 bits of mantissa.
make extended precision gdtoa friendly.
int/size_t changes
make this gdtoa friendly.
remove dup definition
use dtoa() instead of returning empty when we don't have extended precision
information.
Fix previous, add forgotten pointer dereference in the call to dtoa().
Add a cheesy workaround marked XXX for the situation where the
strtod() implementation available in the environment does not
handle hex floats.
Discussed with and suggested by christos
From Christos: gdtoa fixes for m68k. M68k ports should build now, but
printing extended precision is a little off.
vax does not have <machine/ieee.h> or long double
It would be nice if the compiler provided something like __IEEE_MATH__
bring in FreeBSD's vfscanf() to gain multi-byte/collation support.
Unfortunately it is too difficult to make vfwscanf and this share
the same code like I did with printf, because for string parsing
the code is too different.
 1.38.12.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.39.6.2  28-Aug-2008  christos Ignore whitespace in format string from Andy Shevchenko
 1.39.6.1  28-Aug-2008  christos file vfscanf.c was added on branch christos-time_t on 2008-08-28 16:41:22 +0000
 1.41.6.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.41.6.1  17-Apr-2012  yamt sync with head
 1.43.2.1  23-Jun-2013  tls resync from head

RSS XML Feed