summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fgetws.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r320472,r320508,r320509:kib2017-07-171-6/+8
| | | | | | Make stdio deferred cancel-safe. Requested by: eugen
* MFC r305406,r305409,r305412ache2016-09-081-9/+25
| | | | | | | | | | | | | 1) Fix errors handling. 2) Prevent out of bounds access to ws[-1] (passed buffer) which happens when the first mb sequence is incomplete and there are not enougn chars in the read buffer. ws[-1] may lead to memory faults or false results, in case the memory here contains '\n'. 3) Fix n == 1 case. Here should be no physical read (fill buffer) attempt (we read n - 1 chars with the room for NUL, see fgets()), and no NULL return.
* Implement xlocale APIs from Darwin, mainly for use by libc++. This adds atheraven2011-11-201-3/+15
| | | | | | | | | | | | load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit locale parameter. Also adds support for per-thread locales. This work was funded by the FreeBSD Foundation. Please test any code you have that uses the C standard locale functions! Reviewed by: das (gdtoa changes) Approved by: dim (mentor)
* Eliminate more dead stores.wollman2009-11-251-1/+1
| | | | | Found by: Clang static analyzer MFC after: 7 days
* Next stage of stdio cleanup: Retire __sFILEX and merge the fields back intojhb2008-04-171-2/+2
| | | | | | | | | | | | | | | | | | | __sFILE. This was supposed to be done in 6.0. Some notes: - Where possible I restored the various lines to their pre-__sFILEX state. - Retire INITEXTRA() and just initialize the wchar bits (orientation and mbstate) explicitly instead. The various places that used INITEXTRA didn't need the locking fields or _up initialized. (Some places needed _up to exist and not be off the end of a NULL or garbage pointer, but they didn't require it to be initialized to a specific value.) - For now, stdio.h "knows" that pthread_t is a 'struct pthread *' to avoid namespace pollution of including all the pthread types in stdio.h. Once we remove all the inlines and make __sFILE private it can go back to using pthread_t, etc. - This does not remove any of the inlines currently and does not change any of the public ABI of 'FILE'. MFC after: 1 month Reviewed by: peter
* Don't add integers to void pointers.stefanf2004-10-031-1/+2
|
* Read directly from the stdio buffer using the new __mbsnrtowcs() interfacetjr2004-07-211-14/+38
| | | | instead of making repeated calls to __fgetwc().
* Lock the file once per call and use the unlocked fgetwc()/fputwc() variants.tjr2002-09-201-6/+14
|
* Reimplement the functionality of fgetrune(), fputrune(), and fungetrune()tjr2002-09-181-8/+5
| | | | | | here in terms of mbrtowc(), wcrtomb(), and the single-byte I/O functions. The rune I/O functions are about to become deprecated in favour of the ones provided by ISO C90 Amd. 1 and C99.
* Style: One space between "restrict" qualifier and "*".tjr2002-09-061-1/+1
|
* Basic support for wide character I/O: getwc(), fgetwc(), getwchar(),tjr2002-08-131-0/+70
putwc(), fputwc(), putwchar(), ungetwc(), fwide().
OpenPOWER on IntegriCloud