summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* Arrange for text mode on stdin, stdout and stderr.Kaz Kylheku2016-09-171-4/+6
| | | | | | * newlib/libc/stdio/findfp.c (__sinit): Add the Cygwin-specific __SCLE (stream convert line endings) flag when calling the std function to initializing the reent structure's _stdin, _stdout and _stderr members.
* Default stdio streams to text mode.Kaz Kylheku2016-07-121-2/+2
| | | | | | | | * newlib/libc/stdio/flags.c (__sflags): Enable for Cygwin the piece of code which adds the O_TEXT mode if O_BINARY is not present. And, also, fix that piece of code's incorrect use of the | operator to test a flag instead of &.
* Feature test macros overhaul: stdio.hYaakov Selkowitz2016-03-171-0/+1
| | | | | | | | | | | | | | Throughout, remove references to __STRICT_ANSI__ and use the proper internal macros and versions for C99, POSIX, ATFILE for the various *at functions, or LARGEFILE for fseeko and ftello. [v]asprintf are GNU extensions, but the *iprintf, *iscanf, and *asnprintf functions are unique to newlib. getw and putw were removed from POSIX.1-2001. funopen is BSD, and fopencookie is GNU. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* setvbuf: Drop setting reent->__cleanupCorinna Vinschen2016-03-131-1/+0
| | | | | | | | The __sinit call added with 1eb6db6 already sets reent->__cleanup. * libc/stdio/setvbuf.c (setvbuf): Drop setting reent->__cleanup. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Update setvbuf to latest OpenBSD implementationCorinna Vinschen2016-03-121-42/+75
| | | | | | | | | | | | | | | | | | Newlib's setvbuf function is very old and has two bugs: - It sets the SRD/SWR flags incorrectly in case of files opened for reading and writing. See https://cygwin.com/ml/cygwin/2016-03/msg00180.html for a desription of the effect. - It always sets the buffer size to BUFSIZ if it's not provided by the application, independent of the optimal blocksize for the underlying IO device. Update setvbuf to latest code from OpenBSD to fix both problems. * libc/stdio/setvbuf.c (setvbuf): Import latest OpenBSD implementation. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add __swhatbuf function from OpenBSDCorinna Vinschen2016-03-122-49/+60
| | | | | | | | | | | To fix a long-standing setvbuf bug, import __swhatbuf function from OpenBSD and only slightly rearrange for newlib. * libc/stdio/local.h (__swhatbuf_r): Declare. * libc/stdio/makebuf (__smakebuf_r): New function. (__smakebuf_r): Drop file handling code and call __smakebuf_r. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* printf(3): Handle multibyte decimal point in field size computationCorinna Vinschen2016-02-081-7/+9
| | | | | | | | | | | This patch fixes the problem reported in https://cygwin.com/ml/cygwin/2016-02/msg00014.html The 2009 changes to handle multibyte decimal point and thousands separator missed to take the length of a multibyte decimal point into account when computing the field size. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* * newlib/libc/stdio/nano-vfscanf.c: Fix '%X' specifier procesingIgor Venevtsev2016-02-081-0/+1
|
* * newlib/libc/stdio/nano-vfscanf.c: Fix '%F', '%G' and '%E' specifiers ↵Igor Venevtsev2016-02-081-3/+3
| | | | processing
* Add missing checks for __SNLK flagCorinna Vinschen2015-12-083-10/+20
| | | | | | | | | | | * libc/stdio/fclose.c (_fclose_r): Make _flockfile/_funlockfile calls dependent on __SNLK flag. * libc/stdio/findfp.c (__fp_lock): Ditto. (__fp_unlock): Ditto. * libc/stdio/freopen.c (_freopen_r): Ditto. * libc/stdio64/freopen64.c (_freopen64_r): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix re-initialization of FILE flags and mbstate in freopenCorinna Vinschen2015-12-081-1/+1
| | | | | | | | * libc/stdio/freopen.c (_freopen_r): Only reset __SWID bit per SUSv4. * libc/stdio64/freopen64.c (_freopen64_r): Add missing resetting of flag values and _mbstate. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Import correctly working strtold from David M. Gay.Corinna Vinschen2015-11-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libc/stdlib/Makefile.am (GENERAL_SOURCES): Add strtodg.c and strtorx.c. * libc/stdlib/Makefile.in: Regenerate. * libc/stdlib/strtodg.c: New file implementing generic string to long double conversion. * libc/stdlib/strtorx.c: New file, implementing IEEE format string to long double conversion. * libc/stdlib/mprec.h (_strtodg_r): Declare. (_strtorx_r): Declare. * libc/stdlib/gdtoa.h (__UShort): Define. * libc/stdlib/strtold.c (__flt_rounds): Define for i386 and x86_64 target. (FLT_ROUNDS): Define, as 0 on platforms missing a __flt_rounds function. (_strtold_r): Converted from strtold. Call _strtorx_r on targets supporting distinct long doubles. (strtold): Just call _strtold_r. * libc/include/stdlib.h (_strtold_r): Declare. * libc/stdlib/ldtoa.c (_strtold): Comment out. Explain why. * libc/stdio/vfscanf.c (__SVFSCANF_R): Call _strtold_r instead of _strtold. * libc/machine/powerpc/vfscanf.c (__svfscanf_r): Ditto. * common.din (strtold): Drop redirection to _strtold. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Simplify the markup for sprintf and swprintf documentationJon Turney2015-11-192-64/+71
| | | | | | | | | | | | - move the description of the alternative form produced with the # flag from a nested table to an additional table 2015-11-12 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdio/sprintf.c: Simplify documentation markup. * libc/stdio/swprintf.c: Ditto. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* Improve markup of sscanf and swscanf documentationJon Turney2015-11-192-114/+237
| | | | | | | | | | | | | | | | | | | - use bullet points to separate width, size and type sections, rather than using rows in an enormous table, for consistency with sprintf and swprintf. - use code markup for size bullet point for consistency - use a texinfo multitable for description of the size flags, rather than some preformatted text - tidy up some whitespace so type flags are all aligned 2015-11-12 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdio/sscanf.c: Improve documentation markup. * libc/stdio/swscanf.c: Ditto. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* Move duplicated documentation rules to Makefile.sharedJeff Johnston2015-11-022-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Also, harmonize libm to use CHEWOUT_FILES like libc, rather than chobj. Update documentation appropriately. * HOWTO: Update. * Makefile.shared: Move documentation rules to here... * libc/argz/Makefile.am: ... from here ... * libc/ctype/Makefile.am: ... and here. * libc/errno/Makefile.am: Ditto. * libc/iconv/Makefile.am: Ditto. * libc/iconv/ccs/Makefile.am : Ditto. * libc/iconv/ces/Makefile.am: Ditto. * libc/iconv/lib/Makefile.am: Ditto. * libc/locale/Makefile.am: Ditto. * libc/misc/Makefile.am: Ditto. * libc/posix/Makefile.am: Ditto. * libc/reent/Makefile.am: Ditto. * libc/search/Makefile.am: Ditto. * libc/stdio/Makefile.am: Ditto. * libc/stdio64/Makefile.am: Ditto. * libc/stdlib/Makefile.am : Ditto. * libc/string/Makefile.am: Ditto. * libc/syscalls/Makefile.am: Ditto. * libc/time/Makefile.am : Ditto. * libc/unix/Makefile.am: Ditto. * libc/xdr/Makefile.am: Ditto. * libm/common/Makefile.am: Ditto. * libm/complex/Makefile.am: Ditto. * libm/math/Makefile.am: Ditto. * libm/mathfp/Makefile.am: Ditto.
* Add missing semicolons to prototypes.Jeff Johnston2015-11-022-12/+12
| | | | | | | | | | | | | * libc/stdio/fseek.c: Add missing semicolons to prototypes in SYNOPSIS. * libc/stdio/fwide.c: Ditto. * libc/stdio64/fseeko64.c: Ditto. * libc/string/strtok.c: Ditto. * libc/string/wcstok.c: Ditto. * libm/math/w_cosh.c: Ditto. * libm/math/w_fmod.c: Ditto. * libm/mathfp/s_cosh.c: Ditto. * libm/mathfp/s_fmod.c: Ditto.
* Fix wscanf family positional parameter handling in %lc, %ls, %l[]Shoichi Sakon2015-08-031-7/+9
| | | | | | | | * libc/stdio/vfwscanf.c (__SVFWSCANF_R): Convert wrong usage of va_arg to GET_ARG in %lc, %ls nad %l[] cases. Fix unterminated string in %l[] case. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Prevent use of uninitialized file lockSebastian Huber2015-07-022-4/+10
| | | | | | | | | | | | | | | The CHECK_INIT() is necessary before the _newlib_flockfile_start() since this would use otherwise acquire an uninitialized lock which gets initialized after this leading to a corrupt release. newlib/ChangeLog 2015-07-01 Sebastian Huber <sebastian.huber@embedded-brains.de> libc/stdio/fputs.c (_puts_r): Add missing CHECK_INIT(). libc/stdio/gets.c (_gets_r): Add missing _REENT_SMALL_CHECK_INIT() and CHECK_INIT(). Use _stdin_r() to get the file pointer instead of stdin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Regenerate Makefile.inJon TURNEY2015-06-291-2/+0
| | | | | | | | | | | | | | | Regenerate Makefile.in with changes in commits 153385d8 and 433aad91 2015-06-29 Jon Turney <jon.turney@dronecode.org.uk> * libc/ctype/Makefile.in: Regenerate. * libc/posix/Makefile.in: Ditto. * libc/stdio/Makefile.in: Ditto. * libc/stdio64/Makefile.in: Ditto. * libc/stdlib/Makefile.in: Ditto. * libc/string/Makefile.in: Ditto. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Don't chew files which contain no documentation markupJon TURNEY2015-06-241-2/+0
| | | | | | | | | | | | | | | Don't chew files which contain no documentation markup. Neither of the alternatives for MALLOCR (mallocr.c or nano-mallocr.c) contain any documentation markup. 2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdlib/Makefile.am (CHEWOUT_FILES): Remove $(MALLOCR).def. * libc/stdio/Makefile.am (CHEWOUT_FILES): Remove getwc.def and putwc.def. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix mismatched parentheses in documentation.Jon TURNEY2015-06-241-1/+1
| | | | | | | | | | | 2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/locale/locale.c: Fix mismatched parentheses in documentation. * libc/locale/locale.tex: Ditto. * libc/stdio/fgetwc.c: Ditto. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix an inconsistent use of '.' in FUNCTIONJon TURNEY2015-06-231-1/+1
| | | | | | | | | | | | Fix an inconsistent use of '.' to separate function names in FUNCTION. ',' is used everywhere else. 2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdio/fread.c: Fix inconsistent use of '.' to separate function names in FUNCTION mark up. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Correct a non-ANSI prototype in SYNOPSISJon TURNEY2015-06-231-1/+1
| | | | | | | | 2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/stdio/getchar_u.c: Fix a non-ANSI prototype in SYNOPSIS. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Fix makedoc markup used in texinfo sourceJon TURNEY2015-06-231-1/+1
| | | | | | | | | 2015-06-23 Jon Turney <jon.turney@dronecode.org.uk> * libc/signal/signal.tex: Use texinfo not makedoc markup. * libc/stdio/stdio.tex: Ditto. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* Implement BSD/GNU unlocked stdio extensions.Yaakov Selkowitz2014-12-1839-75/+1738
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libc/include/stdio.h (clearerr_unlocked, feof_unlocked, ferror_unlocked, fflush_unlocked, fgetc_unlocked, fgets_unlocked, fileno_unlocked, fputc_unlocked, fputs_unlocked, fread_unlocked, fwrite_unlocked): Declare. * libc/include/wchar.h (fgetwc_unlocked, fgetws_unlocked, fputwc_unlocked, fputws_unlocked, getwc_unlocked, getwchar_unlocked, putwc_unlocked, putwchar_unlocked): Declare. * libc/stdio/Makefile.am (ELIX_4_SOURCES): Add clearerr_u.c, feof_u.c, ferror_u.c, fflush_u.c, fgetc_u.c, fgets_u.c, fgetwc_u.c, fgetws_u.c, fileno_u.c, fputc_u.c, fputs_u.c, fputwc_u.c, fputws_u.c, fread_u.c, fwrite_u.c, getwc_u.c, getwchar_u.c, putwc_u.c, putwchar_u.c. Add necessary dependencies. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/clearerr.c: Document unlocked variant. * libc/stdio/clearerr_u.c: New file. * libc/stdio/feof.c: Document unlocked variant. * libc/stdio/feof_u.c: New file. * libc/stdio/ferror.c: Document unlocked variant. * libc/stdio/ferror_u.c: New file. * libc/stdio/fflush.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fflush_u.c: New file. * libc/stdio/fgetc.c: Document unlocked variants. * libc/stdio/fgetc_u.c: New file. * libc/stdio/fgets.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fgets_u.c: New file. * libc/stdio/fgetwc.c: Document unlocked variants. (__fgetwc): Make non-static. * libc/stdio/fgetwc_u.c: New file. * libc/stdio/fgetws.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fgetws_u.c: New file. * libc/stdio/fileno.c: Document unlocked variant. * libc/stdio/fileno_u.c: New file. * libc/stdio/fputc.c: Document unlocked variants. * libc/stdio/fputc_u.c: New file. * libc/stdio/fputs.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fputs_u.c: New file. * libc/stdio/fputwc.c: Document unlocked variants. (__fputwc): Make non-static. * libc/stdio/fputwc_u.c: New file. * libc/stdio/fputws.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fputws_u.c: New file. * libc/stdio/fread.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fread_u.c: New file. * libc/stdio/fwrite.c: Add __IMPL_UNLOCKED__ overrides. Document unlocked variants. * libc/stdio/fwrite_u.c: New file. * libc/stdio/getwc_u.c: New file. * libc/stdio/getwchar.c: Document unlocked variants. * libc/stdio/getwchar_u.c: New file. * libc/stdio/local.h: Define locking macros as empty ifdef __IMPL_UNLOCKED__. (__fgetwc, __fputwc): Declare. * libc/stdio/putwc_u.c: New file. * libc/stdio/putwchar.c: Document unlocked variants. * libc/stdio/putwchar_u.c: New file.
* * stdio.tex: Add menu entries for __fsetlocking and stdio_ext.Corinna Vinschen2014-12-182-1/+3
| | | | * stdio_ext.c: Add "stdio_ext" to synopsis.
* * libc/include/stdio.h (__SNLK): Define.Yaakov Selkowitz2014-12-155-7/+129
| | | | | | | | | | | | | | | * libc/include/stdio_ext.h (FSETLOCKING_QUERY, FSETLOCKING_INTERNAL, FSETLOCKING_BYCALLER): Define. (__fsetlocking): Declare. * libc/stdio/Makefile.am: Build fsetlocking.c. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/fsetlocking.c: New file. * libc/stdio/local.h (_newlib_flockfile_start): Make _flockfile call dependent on __SNLK flag. (_newlib_flockfile_exit, _newlib_flockfile_end): Ditto for _funlockfile calls. Define all locking macros as empty if __SINGLE_THREAD__. * libc/stdio/stdio.tex: Include fsetlocking.def.
* * libc/include/stdio_ext.h: Rename __fwriteable to __fwritable.Yaakov Selkowitz2014-12-114-0/+128
| | | | | | | | | | [!__GNUC__]: Declare real functions for the macros, and make the macros conditional on !__cplusplus. * libc/stdio/Makefile.am (ELIX_4_SOURCES): Add stdio_ext.c. (CHEWOUT_FILES): Add stdio_ext.def. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/stdio.tex: Include stdio_ext.def. * libc/stdio/stdio_ext.c: New file.
* * libc/stdio/nano-vfprintf_i.c (_printf_i): Use LONGINT when void* isCorinna Vinschen2014-11-201-1/+3
| | | | larger than an int.
* * libc/stdio/nano-vfprintf_i.c (_printf_i): Use Newlib approach toCorinna Vinschen2014-11-061-9/+9
| | | | | handle string that might be not nul-terminated. * testsuite/newlib.stdio/nulprintf.c: New test.
* * libc/stdio/vfprintf.c (_VFPRINTF_R): Remove unnecessary comparison.Corinna Vinschen2014-10-291-4/+2
|
* * libc/stdio/findfp.c (_cleanup_r): Call _fflush_r when configurationCorinna Vinschen2014-09-051-4/+9
| | | | option "--enable-lite-exit" is in effect. Refactor the code.
* * libc/stdio/fwalk.c (_fwalk_reent): Remove redundant test.Corinna Vinschen2014-09-051-5/+2
|
* * libc/stdio/findfp.c (std): Don't inline when optimizing for code size.Corinna Vinschen2014-08-141-0/+4
|
* 2014-07-04 Bin Cheng <bin.cheng@arm.com>Jeff Johnston2014-07-0428-221/+3386
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * README (--enable-newlib-nano-formatted-io): Describe. * acconfig.h (_NANO_FORMATTED_IO): Undef. * newlib.hin (_NANO_FORMATTED_IO): Undef. * configure.in (--enable-newlib-nano-formatted-io): New option. * configure: Regenerated. * libc/configure.in (--enable-newlib-nano-formatted-io): New option. * libc/configure: Regenerated. * libc/stdio/Makefile.am (NEWLIB_NANO_FORMATTED_IO): Support new configuration option. * libc/stdio/Makefile.in: Regenerated. * libc/stdio/asnprintf.c (_asniprintf_r, asniprintf): Use _NANO_FORMATTED_IO to declare alias prototypes. * libc/stdio/asprintf.c (_asiprintf_r, asiprintf): Ditto. * libc/stdio/dprintf.c (_diprintf_r, diprintf): Ditto. * libc/stdio/fprintf.c (_fiprintf_r, fiprintf): Ditto. * libc/stdio/fscanf.c (fiscanf, _fiscanf_r): Ditto. * libc/stdio/printf.c (_iprintf_r, iprintf): Ditto. * libc/stdio/scanf.c (iscanf, _iscanf_r): Ditto. * libc/stdio/snprintf.c (_sniprintf_r, sniprintf): Ditto. * libc/stdio/sprintf.c (_siprintf_r, siprintf): Ditto. * libc/stdio/sscanf.c (siscanf, _siscanf_r): Ditto. * libc/stdio/vasnprintf.c (_vasniprintf_r, vasniprintf): Ditto. * libc/stdio/vasprintf.c (vasiprintf, _vasiprintf_r): Ditto. * libc/stdio/vdprintf.c (_vdiprintf_r, vdiprintf): Ditto. * libc/stdio/vprintf.c (viprintf, _viprintf_r): Ditto. * libc/stdio/vscanf.c (viscanf, _viscanf_r): Ditto. * libc/stdio/vsnprintf.c (vsniprintf, _vsniprintf_r): Ditto. * libc/stdio/vsprintf.c (vsiprintf, _vsiprintf_r): Ditto. * libc/stdio/vsscanf.c (vsiscanf, _vsiscanf_r): Ditto. * libc/stdio/nano-vfprintf.c: New file. * libc/stdio/nano-vfprintf_float.c: New file. * libc/stdio/nano-vfprintf_i.c: New file. * libc/stdio/nano-vfprintf_local.h: New file. * libc/stdio/nano-vfscanf.c: New file. * libc/stdio/nano-vfscanf_float.c: New file. * libc/stdio/nano-vfscanf_i.c: New file. * libc/stdio/nano-vfscanf_local.h: New file.
* 2014-04-04 Ashish Kapania <akapania@ti.com>Jeff Johnston2014-04-041-1/+1
| | | | | | | | | | | * configure.host (sys_dir, newlib_cflags): Set sys_dir to tirtos and use -D__DYNAMIC_REENT__ and -DMALLOC_PROVIDED compiler options for TIRTOS target. * libc/stdio/local.h (_STDIO_CLOSE_PER_REENT_STD_STREAMS): Change #ifdef to not define this macro when __tirtos__ is defined. * libc/sys/tirtos : Add support for TIRTOS. * libc/sys/tirtos/Makefile.am, libc/sys/tirtos/lock.c: New files. * libc/sys/tirtos/configure.in, libc/sys/tirtos/include/sys/lock.h: Ditto.
* * libc/stdio/open_memstream.c (internal_open_memstream_r): InitializeCorinna Vinschen2014-02-201-0/+1
| | | | c->pos to 0.
* Introduce _STDIO_BSD_SEMANTICS flag to switch fclose/exit file flushingCorinna Vinschen2014-01-174-6/+36
| | | | | | | | | | | | | | semantics from POSIX to BSD. * libc/stdio/fclose.c (_fclose_r): Conditionalize file flushing on _STDIO_BSD_SEMANTICS. Call __sflush_r rather than _fflush_r. Add comment. * libc/stdio/fflush.c (__sflushw_r): New function, only available if _STDIO_BSD_SEMANTICS is defined. * libc/stdio/findfp.c (_cleanup_r): Call _fwalk_reent rather than _fwalk. Conditionalize cleanup function call on _STDIO_BSD_SEMANTICS. Add comments. Add FIXME. * libc/stdio/local.h (__sflushw_r): Declare if _STDIO_BSD_SEMANTICS is defined.
* * libc/stdio/vfwscanf.c (__SVFWSCANF_R): Fix fetching decimal_point inCorinna Vinschen2013-12-191-5/+6
| | | | !_MB_CAPABLE as well as in !__HAVE_LOCALE_INFO_EXTENDED__ case.
* * vfscanf.c (BUF): Change definition to take multibyte decimal pointCorinna Vinschen2013-12-182-21/+86
| | | | | | | into account. (__SVFSCANF_R): Handle radix char language-dependent per POSIX. (__SVFWSCANF_R): Ditto.
* 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com>Joel Sherrill2013-11-2614-56/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *libc/include/wchar.h: Add restrict keyword. *libc/stdio/fgetws.c (fgetws): ditto. *libc/stdio/fputws.c (fputws): ditto. *libc/stdio/fwprintf.c (fwprintf): ditto. *libc/stdio/fwscanf.c (fwscanf): ditto. *libc/stdio/swprintf.c (swprintf): ditto. *libc/stdio/swscanf.c (swscanf): ditto. *libc/stdio/vfwprintf.c (vfwprintf): ditto. *libc/stdio/vfwscanf.c (vfwscanf): ditto. *libc/stdio/vswprintf.c (vswprintf): ditto. *libc/stdio/vswscanf.c (vswscanf): ditto. *libc/stdio/vwprintf.c (vwprintf): ditto. *libc/stdio/vwscanf.c (vwscanf): ditto. *libc/stdio/wprintf.c (wprintf): ditto. *libc/stdio/wscanf.c (wscanf): ditto. *libc/stdlib/mbrlen.c (mbrlen): ditto. *libc/stdlib/mbrtowc.c (mbrtowc): ditto. *libc/stdlib/mbsnrtowcs.c (mbsnrtowcs): ditto. *libc/stdlib/mbsrtowcs.c (mbsrtowcs): ditto. *libc/stdlib/wcrtomb.c (wcrtomb): ditto. *libc/stdlib/wcsnrtombs.c (wcsnrtombs): ditto. *libc/stdlib/wcsrtombs.c (wcsrtombs): ditto. *libc/stdlib/wcstod.c (wcstod): ditto. *libc/stdlib/wcstol.c (wcstol): ditto. *libc/stdlib/wcstold.c (wcstold): ditto. *libc/stdlib/wcstoll.c (wcstoll): ditto. *libc/stdlib/wcstoul.c (wcstoul): ditto. *libc/stdlib/wcstoull.c (cstoull): ditto. *libc/string/wcpcpy.c (wcpcpy): ditto. *libc/string/wcpncpy.c (wcpncpy): ditto. *libc/string/wcscat.c (wcscat): ditto. *libc/string/wcscpy.c (wcscpy): ditto. *libc/string/wcsncat.c (wcsncat): ditto. *libc/string/wcsncpy.c (wcsncpy): ditto. *libc/string/wcsstr.c (wcsstr): ditto. *libc/string/wcstok.c (wcstok): ditto. *libc/string/wcsxfrm.c (wcsxfrm): ditto. *libc/string/wmemcpy.c (wmemcpy): ditto.
* 2013-11-18 Sahil Patnayakuni <sahilp@oarcorp.com>Joel Sherrill2013-11-1825-133/+134
| | | | | | | | | | | | | | | | | | | | | | | * libc/include/stdio.h, libc/machine/powerpc/vfscanf.c, libc/machine/spu/fgetpos.c, libc/machine/spu/fgets.c, libc/machine/spu/fopen.c, libc/machine/spu/fputs.c, libc/machine/spu/fread.c, libc/machine/spu/freopen.c, libc/machine/spu/fwrite.c, libc/machine/spu/setbuf.c, libc/machine/spu/vfprintf.c, libc/machine/spu/vfscanf.c, libc/machine/spu/vsnprintf.c, libc/machine/spu/vsprintf.c, libc/machine/spu/vsscanf.c, libc/stdio/asnprintf.c, libc/stdio/asprintf.c, libc/stdio/dprintf.c, libc/stdio/fgetpos.c, libc/stdio/fgets.c, libc/stdio/fmemopen.c, libc/stdio/fopen.c, libc/stdio/fprintf.c, libc/stdio/fputs.c, libc/stdio/fread.c, libc/stdio/freopen.c, libc/stdio/fscanf.c, libc/stdio/fwrite.c, libc/stdio/printf.c, libc/stdio/scanf.c, libc/stdio/setbuf.c, libc/stdio/snprintf.c, libc/stdio/sprintf.c, libc/stdio/sscanf.c, libc/stdio/vdprintf.c, libc/stdio/vprintf.c, libc/stdio/vscanf.c, libc/stdio/vsnprintf.c, libc/stdio/vsprintf.c, libc/stdio/vsscanf.c: Add restrict keyword.
* * libc/stdio/fvwrite.c: Allow writing in larger chunks for fullyCorinna Vinschen2013-11-041-15/+12
| | | | buffered and unbuffered files, to improve write performance.
* * libc/stdio/fvwrite.h: change type of uio_resid from int to size_t toCorinna Vinschen2013-10-311-1/+1
| | | | fix fwrite() of > 2GByte buffers.
* * libc/include/stdio.h (funopen): Change prototype ofCorinna Vinschen2013-10-238-23/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __readfn and __writefn parameter to match new definition of FILE's _read and _write methods. (_funopen_r): Ditto. (funopen): Ditto. (_funopen_r): Ditto. * libc/include/sys/config.h (_READ_WRITE_BUFSIZE_TYPE) Define as type int if not already defined. Add comment to explain. * libc/include/sys/reent.h: Include stddef.h. (struct __sFILE): Change type of last parameter in declaration of _read and _write methods to _READ_WRITE_BUFSIZE_TYPE. (struct __sFILE64): Ditto. * libc/stdio/local.h (__sread): Declare with last parameter set to _READ_WRITE_BUFSIZE_TYPE. (__seofread): Ditto. (__swrite): Ditto. (__swrite64): Ditto. * libc/stdio/fvwrite.c (__sfvwrite_r): Change type of local variables w and s to _READ_WRITE_RETURN_TYPE. * libc/stdio/fflush.c (__sflush_r): Change type of local variables n and t to _READ_WRITE_BUFSIZE_TYPE and _READ_WRITE_RETURN_TYPE. Add local variables flags to keep _flags value. * libc/stdio/fmemopen.c (fmemreader): Align to above change. (fmemwriter): Ditto. * libc/stdio/fopencookie.c (fcreader): Ditto. (fcwriter): Ditto. * libc/stdio/funopen.c (funread): Ditto. (funwrite): Ditto. (funreader): Ditto. (funwriter): Ditto. * libc/stdio/open_memstream.c (memwriter): Ditto. * libc/stdio/stdio.c (__sread): Ditto. (__seofread): Ditto. (__swrite): Ditto. * libc/stdio64/stdio64.c (__swrite64): Ditto.
* * libc/configure.in (--enable-newlib-wchar-orient): Remove.Corinna Vinschen2013-08-122-183/+133
| | | | | | * libc/configure: Regenerated. * libc/stdio/Makefile.am (NEWLIB_WIDE_ORIENT): Remove. * libc/stdio/Makefile.in: Regenerated.
* * libc/stdio/fwalk.c (_fwalk): Remove redundant test.Corinna Vinschen2013-07-091-5/+2
|
* * acconfig.h (_UNBUF_STREAM_OPT): Undefine.Corinna Vinschen2013-06-192-0/+8
| | | | | | | | | | | | | | | | | * newlib.hin (_UNBUF_STREAM_OPT): Undefine. * configure.in (--enable-newlib-unbuf-stream-opt): New option. * configure: Regenerate. * libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on unbuffered stream files. * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise. * README: Add description about the option. * newlib.hin (_UNBUF_STREAM_OPT): Undefine. * configure.in (--enable-newlib-unbuf-stream-opt): New option. * configure: Regenerate. * libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on unbuffered stream files. * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise. * README: Add description about the option.
* 2013-04-29 Sebastian Huber <sebastian.huber@embedded-brains.de>Jeff Johnston2013-04-2923-67/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libc/stdio/local.h (CHECK_INIT): Evaluate argument only once. (CHECK_STD_INIT): Likewise. * libc/stdio/fgetc.c (fgetc): Use local variable for _REENT. * libc/stdio/fgetwc.c (fwgetc): Likewise. * libc/stdio/fgetws.c (fgetws): Likewise. * libc/stdio/fputc.c (fputc): Likewise. * libc/stdio/fputwc.c (fputwc): Likewise. * libc/stdio/fputws.c (fputws): Likewise. * libc/stdio/getc.c (getc): Likewise. * libc/stdio/getchar.c (_getchar_r): Likewise. * libc/stdio/putc.c (putc): Likewise. * libc/stdio/putchar.c (putchar): Likewise. * libc/stdio/scanf.c (scanf): Likewise. * libc/stdio/setvbuf.c (setvbuf): Likewise. * libc/stdio/ungetwc.c (ungetwc): Likewise. * libc/stdio/vfscanf.c (VFSCANF): Likewise. * libc/stdio/vfwscanf.c (VFWSCANF): Likewise. * libc/stdio/viprintf.c (viprintf): Likewise. * libc/stdio/viscanf.c (viscanf): Likewise. * libc/stdio/vprintf.c (vprintf): Likewise. * libc/stdio/vscanf.c (vscanf): Likewise. * libc/stdio/vwprintf.c (vwprintf): Likewise. * libc/stdio/vwscanf.c (vwscanf): Likewise. * libc/stdio/wscanf.c (wscanf): Likewise. * libc/stdlib/ecvtbuf.c (fcvtbuf): Likewise. (fcvtbuf): Likewise. (ecvtbuf): Likewise. (ecvtbuf): Likewise. * libc/stdlib/mblen.c (mblen): Likewise. * libc/stdlib/mbrlen.c (mbrlen): Likewise. * libc/stdlib/mbrtowc.c (mbrtowc): Likewise. * libc/stdlib/mbtowc.c (mbtowc): Likewise. * libc/stdlib/rand.c (srand): Likewise. (rand): Likewise. * libc/stdlib/wcrtomb.c (wcrtomb): Likewise. * libc/stdlib/wctob.c (wctob): Likewise. * libc/stdlib/wctomb.c (wctomb): Likewise. * libc/string/strtok.c (strtok): Likewise. * libc/time/asctime.c (asctime): Likewise. * libc/time/gmtime.c (gmtime): Likewise. * libc/time/lcltime.c (lcltime): Likewise.
* 2013-04-25 Sebastian Huber <sebastian.huber@embedded-brains.de>Joel Sherrill2013-04-252-0/+14
| | | | | * libc/stdio/local.h (_STDIO_CLOSE_PER_REENT_STD_STREAMS): New define. * libc/stdio/findfp.c (_STDIO_CLOSE_PER_REENT_STD_STREAMS): Use define.