summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* Spelling fixes.mpp2004-06-211-1/+1
|
* The third operand of the conditional operator should have type void too.stefanf2004-06-082-2/+2
| | | | Approved by: das (mentor)
* Rename cantwrite() to prepwrite(). The latter is less confusing,das2004-06-081-4/+1
| | | | | | since the macro isn't really a predicate, and it has side-effects. Also, don't set errno if prepwrite() fails, since this is done in prepwrite() now.
* Rename cantwrite() to prepwrite(). The latter is less confusing,das2004-06-084-5/+6
| | | | since the macro isn't really a predicate, and it has side-effects.
* Set errno to EBADF on attempts to write to a stream that is notdas2004-06-081-2/+5
| | | | | | | | | writable. Affected callers include fwrite(), put?(), and *printf(). The issue of whether this is the right errno for funopened streams is unresolved, but that's an obscure case, and some errno is better than no errno. Discussed with: bde, jkh
* Provide trivial macro implementations of getwc(), getwchar(), putwc() andtjr2004-05-254-0/+8
| | | | putwchar() to reduce function call overhead.
* Perform conversions straight from the stream buffer instead of scanningtjr2004-05-221-18/+19
| | | | | | | through byte by byte with mbrtowc(). In the usual case (buffer is big enough to contain the multibyte character, character does not straddle buffer boundary) this results in only one call to mbrtowc() for each wide character read.
* Associate a multibyte conversion state object with each stream. Reset ittjr2004-05-227-42/+24
| | | | | | | | | to the initial state when a stream is opened or seeked upon. Use the stream's conversion state object instead of a freshly-zeroed one in fgetwc(), fputwc() and ungetwc(). This is only a performance improvement for now, but it would also be required in order to support state-dependent encodings.
* Remove bogus FBSDID.obrien2004-05-021-3/+1
|
* Fix damaged FBSDID.obrien2004-05-021-3/+1
|
* Merge vfscanf.c, v1.37:das2004-05-021-8/+7
| | | | - s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/
* Merge vfprintf.c, v1.65:das2004-05-021-24/+17
| | | | | - s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/ - Remove HEXFLOAT
* - To make it easier to compile *printf() and *scanf() withoutdas2004-05-022-31/+21
| | | | | | | | | floating-point support, remove default definition of FLOATING_POINT from the source, and change the compile-time option to NO_FLOATING_POINT. - Remove the HEXFLOAT option. It saves an insignificant amount of space (<0.1% of the size of libc on i386) and complicates vfprintf() and checkfmt().
* Use the correct size to allocate, copy and clear argument type tablestjr2004-04-222-12/+18
| | | | | | | | | | after their change from an array of char to an array of enum. This fixes problems that occurred when using positional arguments in format strings, particularly with more than STATIC_ARG_TBL_SIZE (8) of them. PR: 65841 Submitted by: Steven Smith (mostly)
* Prepare to handle trivial state-dependent encodings. Full support fortjr2004-04-079-21/+61
| | | | | state-dependent encodings with locking shifts will come later if there is demand for it.
* Mention that funopen() uses fpos_t incorrectly in the BUGS section.tjr2004-03-201-1/+9
|
* Improve documentation for fgetpos() and fsetpos(), and discouragetjr2004-03-201-13/+21
| | | | users from assuming that fpos_t is an integral type.
* Do not redundantly set the stream orientation in getc(), putc(), andtjr2004-03-196-6/+12
| | | | related functions - __sgetc() and __sputc() will set it when necessary.
* Update list of macros defined in <stdio.h>.tjr2004-03-171-1/+17
|
* Re-add description of putc() macro (back out rev. 1.13.)tjr2004-03-171-2/+8
|
* Re-add text that says getc() is a macro (back out rev. 1.16.)tjr2004-03-171-1/+2
|
* Re-add macro versions of getc(), getchar(), putc(), putchar(), feof(),tjr2004-03-176-34/+12
| | | | | | | ferror(), fileno() and clearerr(), using the value of __isthreaded to decide between the fast inline single-threaded code and the more general function equivalent. This gives most of the performance benefits of the old unsafe macros while preserving thread safety.
* Refer to "wide characters" instead of "wide-characters".tjr2004-03-163-15/+15
|
* Set stream orientation in ungetc() instead of __ungetc(). This avoidstjr2004-03-101-2/+1
| | | | | setting it redundantly when called from ungetwc(), vfscanf() etc., which already set the orientation.
* Remove duplicate check for EOF from ungetc(); __ungetc() already checks.tjr2004-03-101-2/+0
|
* Call __sputc() directly in fputc() instead of taking an expensivetjr2004-03-101-1/+1
| | | | detour through putc().
* Call __sgetc() directly in getchar() instead of taking an expensivetjr2004-03-101-1/+1
| | | | detour through getc().
* Set the stream orientation explicitly in fgetln() instead of relying ontjr2004-03-101-0/+1
| | | | __srefill() to do it.
* Set stream orientation in puts().tjr2004-03-101-0/+2
|
* Backout the previous revision due to objections.jb2004-03-092-10/+4
|
* On 4.X it was possible for an application to initialise a local FILEjb2004-03-092-4/+10
| | | | | | | | | structure and call stdio functions. In 5.X this was broken when FILE locking was introduced into libc. This change makes most (relevant) stdio functions work again when the _extra file in FILE isn't initialised (and can't be without a libc function to do it since the __sFILEX structure is private to libc).
* If handed a file pointer we can't write to, set errno properly to EBADFjkh2004-03-021-1/+4
| | | | | | | in order to get SUSv2 conformant behavior in higher level calls like fputs() and puts(). Reviewed by: bde
* Document dependence of mktemp(3) on the non-reentrant arc4random(3).green2004-02-201-0/+7
|
* Merge vfscanf.c,v 1.35.das2004-01-311-4/+10
|
* Fix the handling of negative hexadecimal numbers in integer formats.das2004-01-311-3/+9
| | | | | | | Note that this bug is unrelated to recent work in this area; it seems to have been present since revision 1.1. Obtained from: NetBSD
* Merge vfprintf.c, v1.61 and 1.62. For compatibility with __hdtoa()das2004-01-231-19/+25
| | | | | | | and to reduce diffs between vfprintf.c and vfwprintf.c, declare xdigs* to be char arrays rather than wchar_t arrays. In collaboration with: tjr
* Bring the *printf(3) documentation up to date with the code:das2004-01-191-37/+24
| | | | | | | | | | | | | | | | | | | - Update and improve the documentation for %[aA] o Like %[eE], %[aA] may round the result if a precision is specified. o Grammar police: Fix a split infinitive. o The FreeBSD implementation does better than the minimum required by C99 (literal translation of the mantissa). The digit before the hexadecimal-point is never 0 unless the number itself is 0. o Clarify that the exponent field represents a decimal exponent of 2. o Discuss the fact that multiple valid representations are possible. o Remove the entry in the BUGS section claiming that %[aA] is not implemented. - Remove the entry in the BUGS section claiming that the ' flag for printing thousands separators is unimplemented for floating-point. - Remove the entry in the BUGS section claiming that the L modifier reduces the precision to "double" before conversion.
* Implement __hdtoa() and __hldtoa() and enable printf() support for %adas2004-01-181-5/+2
| | | | and %A, which print floating-point numbers in hexadecimal.
* Prototype __hdtoa() and __hldtoa().das2004-01-181-0/+2
|
* Fix some bugs affecting the %a and %A format specifiers. Sincedas2004-01-181-6/+16
| | | | | | | | | | | | | these are not fully implemented and ifdef'd out, the bugs have never manifested themselves. Specifically: - Fix a memory leak in the case where %a follows another floating-point format. - Make the %a/%A code behave like %e/%E with respect to precision. - It is no longer valid to assume that '-' and '0x' are mutually exclusive. - Address other minor issues.
* Make intentions explicit with additional parenthesis.nectar2004-01-062-8/+8
|
* Remove unused variables and function declarations. Add missing headers.nectar2004-01-061-2/+1
|
* Fix prototype for getchar_unlocked().tjr2003-12-071-1/+1
|
* Use __sfvwrite() instead of __sputc() via __fputwc() to write to faketjr2003-11-121-1/+30
| | | | | | | | string files (__SSTR flag set). This is necessary because __sputc() does not respect the __SALC flag, and crashes trying to flush the buffer instead of resizing it. PR: 59167
* Pass NULL instead of a pointer to a zeroed mbstate_t object.tjr2003-11-056-37/+17
|
* Pass mbrtowc() and wcrtomb() NULL instead of a pointer to a freshly zeroedtjr2003-11-043-9/+3
| | | | | | | mbstate_t object that they ignore. The zeroing is fairly expensive, and it will never be necessary in these functions; when we support state-dependent encodings, we will pass in a pointer to the file's mbstate_t object, and only zero it at the time the file gets opened.
* Fix a typo that caused the optimized single-byte locale path not to be taken.tjr2003-11-011-1/+1
|
* mdoc(7): Use the new feature of the .In macro.ru2003-09-082-3/+3
|
* Add more useful cross-references to the SEE ALSO section.tjr2003-07-051-2/+7
|
* Catch up with recent FP-related changes to scanf.3 and vfwscanf.c.tjr2003-07-051-31/+16
|
OpenPOWER on IntegriCloud