aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/locale/mbrtowc.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove "All Rights Reserved" from Foundation copyrightsEd Maste2023-09-251-1/+1
| | | | | | | | Sponsored by: The FreeBSD Foundation (cherry picked from commit 7fde0187cc443468561f0a30d589ff0cfe45eef5) (cherry picked from commit 560e22c8fe460e00d16e5268fe1fbb316ad81101) (cherry picked from commit 5b5fa75acff11d871d0c90045f8c1a58fed85365)
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in main: (cherry picked from commit 1d386b48a555)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-251-1/+1
| | | | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* Reset persistent mbstates when rune locale encoding changes.Yuri Pankov2018-11-091-1/+1
| | | | | | | | | | | | | | | | | | | This was shown to be a problem by side effect of now-enabled test case, which was going through C, en_US.UTF-8, ja_JP.SJIS, and ja_JP.eucJP, and failing eventually as data in mbrtowc's mbstate, that was perfectly correct for en_US.UTF-8 was treated as incorrect for ja_JP.SJIS, failing the entire test case. This makes the persistent mbstates to be per ctype-component, and not per-locale so we could easily reset the mbstates when only LC_CTYPE is changed. Reviewed by: bapt, pfg Approved by: kib (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D17796 Notes: svn path=/head/; revision=340276
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* Implement xlocale APIs from Darwin, mainly for use by libc++. This adds aDavid Chisnall2011-11-201-5/+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) Notes: svn path=/head/; revision=227753
* Move prototypes of various encoding-related functions into a new headerTim J. Robbins2004-05-121-3/+1
| | | | | | | file to avoid extern'ing them all over the place. Notes: svn path=/head/; revision=129153
* Prepare to handle state-dependent encodings. This mainly involves notTim J. Robbins2004-04-061-0/+3
| | | | | | | | taking shortcuts when it comes to storing and passing around conversion states. Notes: svn path=/head/; revision=127944
* Remove support for emulating mbrtowc() and wcrtomb() in terms of theTim J. Robbins2004-04-041-50/+1
| | | | | | | old rune interface now that it is no longer needed. Notes: svn path=/head/; revision=127835
* Allow mbrtowc() and wcrtomb() to be implemented directly, instead ofTim J. Robbins2003-11-011-3/+18
| | | | | | | | | | | | | | | | | | | | as wrappers around the deprecated 4.4BSD rune functions. This paves the way for state-dependent encodings, which the rune API does not support. - Add __emulated_sgetrune() and __emulated_sputrune(), which are implementations of sgetrune() and sputrune() in terms of mbrtowc() and wcrtomb(). - Rename the old rune-wrapper mbrtowc() and wcrtomb() functions to __emulated_mbrtowc() and __emulated_wcrtomb(). - Add __mbrtowc and __wcrtomb function pointers, which point to the current locale's conversion functions, or the __emulated versions. - Implement mbrtowc() and wcrtomb() as calls to these function pointers. - Make the "NONE" encoding implement mbrtowc() and wcrtomb() directly. All of this emulation mess will be removed, together with rune support, in FreeBSD 6. Notes: svn path=/head/; revision=121845
* Don't check whether the first byte of the buffer is a null byte whenTim J. Robbins2002-11-101-7/+1
| | | | | | | the buffer has zero length (n == 0). Notes: svn path=/head/; revision=106725
* Style: One space between "restrict" qualifier and "*".Tim J. Robbins2002-09-061-2/+2
| | | | Notes: svn path=/head/; revision=103012
* Implement the ISO C90 Amd.1 restartable wide and multibyte characterTim J. Robbins2002-08-181-0/+81
manipulation functions mbrlen(), mbrtowc(), mbsinit(), mbsrtowcs(), wcrtomb(), wcsrtombs(). Notes: svn path=/head/; revision=102050