summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* Add a cross reference to fgetwln(3).Tim J. Robbins2004-07-161-0/+1
| | | | Notes: svn path=/head/; revision=132243
* Add fgetwln(), a wide character version of fgetln().Tim J. Robbins2004-07-163-2/+192
| | | | Notes: svn path=/head/; revision=132242
* Rename slbexpand() to __slbexpand() and make it available outsideTim J. Robbins2004-07-162-4/+5
| | | | | | | of fgetln.c (non-static). Notes: svn path=/head/; revision=132241
* Slightly reorganize and simplify.Tim J. Robbins2004-07-091-24/+11
| | | | Notes: svn path=/head/; revision=131880
* Add commentary explaining why we return EBADF upon attempts to fflush() aColin Percival2004-07-041-0/+12
| | | | | | | | | read-only file. Discussed on: -current Notes: svn path=/head/; revision=131592
* Eliminate double whitespace.Ruslan Ermilov2004-07-031-2/+2
| | | | Notes: svn path=/head/; revision=131539
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-4/+8
| | | | Notes: svn path=/head/; revision=131504
* Markup, grammar, and spelling fixes.Ruslan Ermilov2004-06-301-4/+3
| | | | Notes: svn path=/head/; revision=131365
* Spelling fixes.Mike Pritchard2004-06-211-1/+1
| | | | Notes: svn path=/head/; revision=130869
* The third operand of the conditional operator should have type void too.Stefan Farfeleder2004-06-082-2/+2
| | | | | | | Approved by: das (mentor) Notes: svn path=/head/; revision=130242
* Rename cantwrite() to prepwrite(). The latter is less confusing,David Schultz2004-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. Notes: svn path=/head/; revision=130232
* Rename cantwrite() to prepwrite(). The latter is less confusing,David Schultz2004-06-084-5/+6
| | | | | | | since the macro isn't really a predicate, and it has side-effects. Notes: svn path=/head/; revision=130231
* Set errno to EBADF on attempts to write to a stream that is notDavid Schultz2004-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 Notes: svn path=/head/; revision=130230
* Provide trivial macro implementations of getwc(), getwchar(), putwc() andTim J. Robbins2004-05-254-0/+8
| | | | | | | putwchar() to reduce function call overhead. Notes: svn path=/head/; revision=129705
* Perform conversions straight from the stream buffer instead of scanningTim J. Robbins2004-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. Notes: svn path=/head/; revision=129584
* Associate a multibyte conversion state object with each stream. Reset itTim J. Robbins2004-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. Notes: svn path=/head/; revision=129583
* Remove bogus FBSDID.David E. O'Brien2004-05-021-3/+1
| | | | Notes: svn path=/head/; revision=128844
* Fix damaged FBSDID.David E. O'Brien2004-05-021-3/+1
| | | | Notes: svn path=/head/; revision=128843
* Merge vfscanf.c, v1.37:David Schultz2004-05-021-8/+7
| | | | | | | - s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/ Notes: svn path=/head/; revision=128822
* Merge vfprintf.c, v1.65:David Schultz2004-05-021-24/+17
| | | | | | | | - s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/ - Remove HEXFLOAT Notes: svn path=/head/; revision=128821
* - To make it easier to compile *printf() and *scanf() withoutDavid Schultz2004-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(). Notes: svn path=/head/; revision=128819
* Use the correct size to allocate, copy and clear argument type tablesTim J. Robbins2004-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) Notes: svn path=/head/; revision=128550
* Prepare to handle trivial state-dependent encodings. Full support forTim J. Robbins2004-04-079-21/+61
| | | | | | | | state-dependent encodings with locking shifts will come later if there is demand for it. Notes: svn path=/head/; revision=128002
* Mention that funopen() uses fpos_t incorrectly in the BUGS section.Tim J. Robbins2004-03-201-1/+9
| | | | Notes: svn path=/head/; revision=127227
* Improve documentation for fgetpos() and fsetpos(), and discourageTim J. Robbins2004-03-201-13/+21
| | | | | | | users from assuming that fpos_t is an integral type. Notes: svn path=/head/; revision=127225
* Do not redundantly set the stream orientation in getc(), putc(), andTim J. Robbins2004-03-196-6/+12
| | | | | | | related functions - __sgetc() and __sputc() will set it when necessary. Notes: svn path=/head/; revision=127198
* Update list of macros defined in <stdio.h>.Tim J. Robbins2004-03-171-1/+17
| | | | Notes: svn path=/head/; revision=127121
* Re-add description of putc() macro (back out rev. 1.13.)Tim J. Robbins2004-03-171-2/+8
| | | | Notes: svn path=/head/; revision=127120
* Re-add text that says getc() is a macro (back out rev. 1.16.)Tim J. Robbins2004-03-171-1/+2
| | | | Notes: svn path=/head/; revision=127119
* Re-add macro versions of getc(), getchar(), putc(), putchar(), feof(),Tim J. Robbins2004-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. Notes: svn path=/head/; revision=127100
* Refer to "wide characters" instead of "wide-characters".Tim J. Robbins2004-03-163-15/+15
| | | | Notes: svn path=/head/; revision=127073
* Set stream orientation in ungetc() instead of __ungetc(). This avoidsTim J. Robbins2004-03-101-2/+1
| | | | | | | | setting it redundantly when called from ungetwc(), vfscanf() etc., which already set the orientation. Notes: svn path=/head/; revision=126809
* Remove duplicate check for EOF from ungetc(); __ungetc() already checks.Tim J. Robbins2004-03-101-2/+0
| | | | Notes: svn path=/head/; revision=126808
* Call __sputc() directly in fputc() instead of taking an expensiveTim J. Robbins2004-03-101-1/+1
| | | | | | | detour through putc(). Notes: svn path=/head/; revision=126806
* Call __sgetc() directly in getchar() instead of taking an expensiveTim J. Robbins2004-03-101-1/+1
| | | | | | | detour through getc(). Notes: svn path=/head/; revision=126804
* Set the stream orientation explicitly in fgetln() instead of relying onTim J. Robbins2004-03-101-0/+1
| | | | | | | __srefill() to do it. Notes: svn path=/head/; revision=126802
* Set stream orientation in puts().Tim J. Robbins2004-03-101-0/+2
| | | | Notes: svn path=/head/; revision=126800
* Backout the previous revision due to objections.John Birrell2004-03-092-10/+4
| | | | Notes: svn path=/head/; revision=126765
* On 4.X it was possible for an application to initialise a local FILEJohn Birrell2004-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). Notes: svn path=/head/; revision=126760
* If handed a file pointer we can't write to, set errno properly to EBADFJordan K. Hubbard2004-03-021-1/+4
| | | | | | | | | | in order to get SUSv2 conformant behavior in higher level calls like fputs() and puts(). Reviewed by: bde Notes: svn path=/head/; revision=126506
* Document dependence of mktemp(3) on the non-reentrant arc4random(3).Brian Feldman2004-02-201-0/+7
| | | | Notes: svn path=/head/; revision=126034
* Merge vfscanf.c,v 1.35.David Schultz2004-01-311-4/+10
| | | | Notes: svn path=/head/; revision=125283
* Fix the handling of negative hexadecimal numbers in integer formats.David Schultz2004-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 Notes: svn path=/head/; revision=125282
* Merge vfprintf.c, v1.61 and 1.62. For compatibility with __hdtoa()David Schultz2004-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 Notes: svn path=/head/; revision=124887
* Bring the *printf(3) documentation up to date with the code:David Schultz2004-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. Notes: svn path=/head/; revision=124710
* Implement __hdtoa() and __hldtoa() and enable printf() support for %aDavid Schultz2004-01-181-5/+2
| | | | | | | and %A, which print floating-point numbers in hexadecimal. Notes: svn path=/head/; revision=124667
* Prototype __hdtoa() and __hldtoa().David Schultz2004-01-181-0/+2
| | | | Notes: svn path=/head/; revision=124658
* Fix some bugs affecting the %a and %A format specifiers. SinceDavid Schultz2004-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. Notes: svn path=/head/; revision=124657
* Make intentions explicit with additional parenthesis.Jacques Vidrine2004-01-062-8/+8
| | | | Notes: svn path=/head/; revision=124175
* Remove unused variables and function declarations. Add missing headers.Jacques Vidrine2004-01-061-2/+1
| | | | Notes: svn path=/head/; revision=124174