Home | History | Annotate | Download | only in include
History log of /src/include/wchar.h
RevisionDateAuthorComments
 1.46  01-Nov-2024  nia libc: Expose some newly-standard C functions in POSIX.1-2024 mode
 1.45  31-Jul-2023  christos branches: 1.45.2;
new gdb needs wmempcpy, give it to it.
 1.44  20-Mar-2020  joerg Fix visibility of various C99 features, esp. for C++11.
 1.43  28-Dec-2018  maya Limit wcslcat, wcslcpy visibility to _NETBSD_SOURCE
wcswidth, wcwidth to POSIX.1-2001 or _NETBSD_SOURCE

Updated patch from kretschm in PR standards/39422
 1.42  15-Oct-2016  kamil branches: 1.42.8; 1.42.12; 1.42.14;
Import wcsnlen(3) to libc

The wcsnlen(3) function conforms to POSIX.1-2008 and is an addition to the
ISO C standard.

size_t wcsnlen(const wchar_t *s, size_t maxlen);

The wcsnlen(3) function computes the number of wide-characters in a wide-
-string to which s points, not including NULL terminating wide-character
code and checking no more than maxlen wide-characters. This function never
examines wide-characters beyond a wide-string of maxlen size.


This function is a safer version of wcslen(3):

size_t wcslen(const wchar_t *s);


Update STANDARDS section of wmemchr(3) describing wide-character functions.
 1.41  13-Oct-2014  christos branches: 1.41.2;
add open_{,w}memstream
 1.40  21-Nov-2013  degroote Expose properly vfwscanf and friends for POSIX_SOURCE >= 200112L
 1.39  19-Aug-2013  joerg Add nl_langinfo_l, catopen_l and wcsftime_l.
 1.38  28-May-2013  joerg Add mbsnrtowcs and wcsnrtombs. Approved by core.
 1.37  19-Apr-2013  joerg More __BEGIN_DECLS / __END_DECLS wrappers.
 1.36  19-Apr-2013  joerg Add scanf_l and wscanf_l families.
 1.35  19-Apr-2013  joerg Add explicit locale versions for the printf family. Replace asprintf,
snprintf and sprintf with simple wrappers around the corresponding
va_list functions to reduce code duplication.
 1.34  18-Apr-2013  joerg Add wcscoll_l, wcsxfrm_l, wcsncasecmp_l, wcscasecmp_l, btowc_l,
mbrlen_l, mbsinit_l, mbsrtowcs_l, wcrtomb_l, wcsrtombs_l and wctob_l.
 1.33  18-Apr-2013  joerg Add wcstof_l, wcstod_l and wcstold_l.
 1.32  16-Apr-2013  joerg Add support for wcstoimax_l and friends.
 1.31  16-Apr-2013  joerg Also add prototypes for wcwidth_l and wcswidth_l.
 1.30  17-Jul-2011  joerg branches: 1.30.2; 1.30.4; 1.30.8;
Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.29  27-Mar-2010  tnozaki 1. {wctype,wctrans,mbstate}_t: switch MD to MI like other
libc implementation (such as *BSD and glibc2).

2. don't typedef void * wc{type,trans}_t, suggested by soda@-san.
it may pass through compiler type check, it's harmful.
so i introduce dummy struct __tag_wc{type,trans}_t(iconv_t already does).

no ABI change was made.
 1.28  15-Nov-2009  christos branches: 1.28.2;
Don't define wchar_t for c++; it is native in the language. From Alexander
Nasonov
 1.27  28-Apr-2008  martin branches: 1.27.8; 1.27.10; 1.27.18;
Remove clause 3 and 4 from TNF licenses
 1.26  22-Aug-2006  christos branches: 1.26.16;
PR/34238: Aleksey Cheusov: add wcsdup, wcscasecmp and wcsncasecmp functions
 1.25  15-Apr-2006  tnozaki branches: 1.25.2;
add c99 wcstof(3) and wcstold(3).
requested by skrll AT netbsd DOT org, thanks.

bump libc minor 138 -> 139.
 1.24  15-May-2005  christos add t_putws
 1.23  14-May-2005  christos Wide stdio functions.
 1.22  30-Mar-2005  christos PR/29826: J. T. Conklin: Add wcsftime(3) (from FreeBSD)
 1.21  03-Feb-2005  perry branches: 1.21.2;
de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.
 1.20  08-May-2004  kleink C99: Provide WCHAR_{MAX,MIN} via <machine/wchar_limits.h> (we'll also
provide WINT_{MAX,MIN} along with it).
Fixes PR standards/24040 from Masao Uebayashi.
 1.19  08-Jul-2003  itojun prototype must not have variable name
 1.18  28-Apr-2003  bjh21 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
 1.17  11-Mar-2003  tshiozak add wcstoll, wcstoimax, wcstoull and wcstoumax. (lib/20656)
- these are defined in C99 (wcsto[ui]max) and SUSv3.
- these implementations are written by sigsegv@s25.xrea.com,
derived from NetBSD's wcstol/wcstoul.
- I just added some comments.
 1.16  07-Mar-2003  tshiozak add fgetws() and fputws() (lib/20576).

Note: fgetws.c, fgetws.3, fputws.c and fputws.3 are obtained from FreeBSD,
and fitted by sigsegv@infoseek.jp and me.
 1.15  05-Mar-2003  tshiozak changes related to lib/20576 and lib/20577.
- add wcstok() and wcswcs(),
- add wcstok(3),
- move btowc() and wctob() into each ctype modules,
- bump ctype interface ABI version,
- bump i18n modules' minor and
- update sets.
and fix a stupid bug in _RUNE_ISCACHED macro.
 1.14  03-Mar-2003  tshiozak - add wctob() function. (I forgot it at the last commit.)
- fix btowc(); I quite misunderstood about it.
 1.13  02-Mar-2003  tshiozak add some ISO C 1995 I18N functions and types:
btowc, wctrans, towctrans, wcscoll, wcsxfrm, wctype_t and wctrans_t.
 1.12  14-Mar-2002  yamt fix prototype of fputwc, putwc and putwchar.
 1.11  07-Dec-2001  yamt - make FILE structure extensible without breaking binary-compatibility.
- add fputwc, fgetwc, fwide and related functions.
- add hooks needed to maintain the orientation of file stream.
 1.10  27-Sep-2001  yamt add wcstod/wcstol/wcstoul.
 1.9  29-Dec-2000  kleink branches: 1.9.2;
Sprinkle some __restrict into <wchar.h>.
 1.8  22-Dec-2000  itojun wcwidth is outside of standard
 1.7  22-Dec-2000  itojun add wcsl{cat,cpy}
 1.6  21-Dec-2000  itojun first import of citrus LC_CTYPE locale. singlebyte only at this moment.
shot-term TODO:
- enable multibyte locales. this includes loadable locale modules
(#ifdef DLRUNE).
- populate LC_CTYPE definition files.
- other functions such as iconv()
- make libc functions more friendly with multibyte.
- multilingualize other LC_xx
- torture tests

XXX don't forget to "make depend" when you rebuild libc, multibyte.c is
moved from lib/libc/stdlib to lib/libc/locale.
 1.5  21-Dec-2000  itojun add dummy wcwidth() and wcswidth(). wcwidth() will be updated later.
 1.4  21-Dec-2000  itojun add wcs* functions. consier it as part of libc minor crank 68 -> 69.
add decl of WEOF into wchar.h. ISO/IEC 9899:1999(E)..
 1.3  20-Dec-2000  itojun ISO 9899-1990: #include <wchar.h> should pull definition for "NULL" in.
checked with Norihiro Kumagai <kuma@oasis.sharplabs.com>
 1.2  20-Dec-2000  itojun add wmem* functions, from citrus. bump libc shlib minor.
 1.1  20-Apr-2000  kleink branches: 1.1.2;
* Move <wchar.h> from libcurses to include (for the missing functionality
is to be provided by libc).
* Define wint_t and size_t in <wchar.h> as well.
 1.1.2.1  28-May-2000  minoura Citrus Project XPG4DL, an implementation of I18N (locale) framework,
is imported.
 1.9.2.4  22-Mar-2002  nathanw Catch up to -current.
 1.9.2.3  28-Jan-2002  nathanw Catch up to -current.
 1.9.2.2  14-Jan-2002  nathanw Catch up to -current.
 1.9.2.1  08-Oct-2001  nathanw Catch up to -current.
 1.21.2.1  06-Apr-2005  tron Pull up revision 1.22 (requested by christos in ticket #102):
PR/29826: J. T. Conklin: Add wcsftime(3) (from FreeBSD)
 1.25.2.1  27-Aug-2006  riz Pull up following revision(s) (requested by tron in ticket #64):
lib/libc/include/namespace.h: revision 1.119
lib/libc/string/wcsdup.c: revision 1.1
lib/libc/string/wcscasecmp.c: revision 1.1
lib/libc/include/namespace.h: revision 1.120
distrib/sets/lists/base/shl.mi: revision 1.366
lib/libc/shlib_version: revision 1.182
include/wchar.h: revision 1.26
lib/libc/string/Makefile.inc: revision 1.62
lib/libc/string/Makefile.inc: revision 1.63
lib/libc/string/wcsncasecmp.c: revision 1.1
PR/34238: Aleksey Cheusov: add wcsdup, wcscasecmp and wcsncasecmp functions
libc 147 for wcsdup and wcs{n,}casecmp
include one more new file.
add wcsdup, wcscasecmp and wcsncasecmp. fixes build problems..
I think we want both wcs{c,n}casecmp weak.
 1.26.16.1  18-May-2008  yamt sync with head.
 1.27.18.1  20-May-2011  bouyer Pull up following revision(s) (requested by joerg in ticket #1611):
include/inttypes.h: revision 1.7
include/stddef.h: revision 1.16
include/wchar.h: revision 1.28
include/stdlib.h: revision 1.90
Don't define wchar_t for c++; it is native in the language. From Alexander
Nasonov
 1.27.10.2  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.27.10.1  28-Apr-2008  martin file wchar.h was added on branch christos-time_t on 2008-04-28 20:22:55 +0000
 1.27.8.2  26-Feb-2015  snj Apply patch (requested by christos in ticket #1943):
Properly expose wcsto{f,ld,ll,ull} and v{fw,sw,ws}scanf when
_POSIX_C_SOURCE >= 200112L and _XOPEN_SOURCE >= 600.
 1.27.8.1  20-May-2011  bouyer Pull up following revision(s) (requested by joerg in ticket #1611):
include/inttypes.h: revision 1.7
include/stddef.h: revision 1.16
include/wchar.h: revision 1.28
include/stdlib.h: revision 1.90
Don't define wchar_t for c++; it is native in the language. From Alexander
Nasonov
 1.28.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.30.8.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.30.8.1  23-Jun-2013  tls resync from head
 1.30.4.1  16-Jan-2015  martin Pull up following revision(s) (requested by christos in ticket #1231):
include/wchar.h: revision 1.40
Expose properly vfwscanf and friends for POSIX_SOURCE >= 200112L
 1.30.2.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.41.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.42.14.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.42.14.1  10-Jun-2019  christos Sync with HEAD
 1.42.12.1  18-Jan-2019  pgoyette Synch with HEAD
 1.42.8.2  20-Jan-2018  perseant Use multilevel tables (tries) to convert kuten <-> unicode.
Get rid of dchains, replace with chain/rchain conversions through keys
allocated from the PUA.
 1.42.8.1  14-Jul-2017  perseant Initial commit of a mostly-working implementation of __STDC_ISO_10646__,
with collation support using the Unicode Collation Algorithm.

The conversion from men/ku/ten form to Unicode is a gross hack at present.
Fixing this, and fleshing out the LC_COLLATE locale component, are next
on the agenda.
 1.45.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed