summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fputwc.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r304607,r304641,r304819,r304811ache2016-08-271-13/+3
| | | | | | | | | | | | | | | | | 1) Don't forget to set __SERR on __slbexpand() error. 2) Remove "Fast path" from fgetwc()/fputwc() since it can't detect encoding errors and ignores them all. One of affected encoding example: US-ASCII 3) Original fgetln() from 44lite return success for line tail errors, i.e. partial line, but set __SERR and errno in the same time, which is inconsistent. Now both OpenBSD and NetBSD return failure, i.e. no line and set error indicators for such case, so make our fgetln() and fgetwln() (as its wide version) compatible with the rest of *BSD. PR: 212033
* Implement xlocale APIs from Darwin, mainly for use by libc++. This adds atheraven2011-11-201-4/+16
| | | | | | | | | | | | 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)
* Next stage of stdio cleanup: Retire __sFILEX and merge the fields back intojhb2008-04-171-2/+1
| | | | | | | | | | | | | | | | | | | __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
* Call __mbrtowc() and __wcrtomb() directly instead of taking detourstjr2004-07-201-1/+2
| | | | through mbrtowc() and wcrtomb().
* Associate a multibyte conversion state object with each stream. Reset ittjr2004-05-221-5/+3
| | | | | | | | | 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.
* Prepare to handle trivial state-dependent encodings. Full support fortjr2004-04-071-1/+4
| | | | | state-dependent encodings with locking shifts will come later if there is demand for it.
* Pass mbrtowc() and wcrtomb() NULL instead of a pointer to a freshly zeroedtjr2003-11-041-3/+1
| | | | | | | 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
|
* Set the error bit on the stream if an encoding error occurs. Improvetjr2002-10-161-1/+3
| | | | handling of multibyte sequences representing null wide characters.
* Introduce unlocked versions of fputwc() and fgetwc() called __fputwc()tjr2002-09-201-11/+21
| | | | and __fgetwc() which can be used when we know the file is locked.
* Optimise the common case where no special encoding is in use (LC_CTYPE is "C"tjr2002-09-181-5/+23
| | | | | | or "POSIX", other European locales). Use __sgetc() and __sputc() where possible to avoid a wasteful lock and unlock for each byte and to avoid function call overhead.
* Reimplement the functionality of fgetrune(), fputrune(), and fungetrune()tjr2002-09-181-2/+13
| | | | | | 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.
* Basic support for wide character I/O: getwc(), fgetwc(), getwchar(),tjr2002-08-131-0/+46
putwc(), fputwc(), putwchar(), ungetwc(), fwide().
OpenPOWER on IntegriCloud