History log of /freebsd-10-stable/lib/libc/stdio/fputwc.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 321074 17-Jul-2017 kib

MFC r320472,r320508,r320509:
Make stdio deferred cancel-safe.

Requested by: eugen


# 304893 27-Aug-2016 ache

MFC r304607,r304641,r304819,r304811

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


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 227753 20-Nov-2011 theraven

Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a
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)


# 178287 17-Apr-2008 jhb

Next stage of stdio cleanup: Retire __sFILEX and merge the fields back into
__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


# 132442 20-Jul-2004 tjr

Call __mbrtowc() and __wcrtomb() directly instead of taking detours
through mbrtowc() and wcrtomb().


# 129583 22-May-2004 tjr

Associate a multibyte conversion state object with each stream. Reset it
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.


# 128002 07-Apr-2004 tjr

Prepare to handle trivial state-dependent encodings. Full support for
state-dependent encodings with locking shifts will come later if there
is demand for it.


# 122042 04-Nov-2003 tjr

Pass mbrtowc() and wcrtomb() NULL instead of a pointer to a freshly zeroed
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.


# 121851 01-Nov-2003 tjr

Fix a typo that caused the optimized single-byte locale path not to be taken.


# 105234 16-Oct-2002 tjr

Set the error bit on the stream if an encoding error occurs. Improve
handling of multibyte sequences representing null wide characters.


# 103676 20-Sep-2002 tjr

Introduce unlocked versions of fputwc() and fgetwc() called __fputwc()
and __fgetwc() which can be used when we know the file is locked.


# 103539 18-Sep-2002 tjr

Optimise the common case where no special encoding is in use (LC_CTYPE is "C"
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.


# 103523 18-Sep-2002 tjr

Reimplement the functionality of fgetrune(), fputrune(), and fungetrune()
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.


# 101776 13-Aug-2002 tjr

Basic support for wide character I/O: getwc(), fgetwc(), getwchar(),
putwc(), fputwc(), putwchar(), ungetwc(), fwide().