Commit Graph

378 Commits

Author SHA1 Message Date
joerg
b90f380e16 Don't overalign _RuneStatePriv, it must share the alignment of mbstate_t
it aliased with. Assert that the alignment actually used reflects the
alignment required by existing implementation and for newly build
modules assert that it is at most the guaranteed alignment.
2020-06-02 01:30:31 +00:00
kamil
c5b83981a9 Add bunch of missing includes of namespace.h in libc
The NetBSD Standard C Library uses internally some of its functions with
a mangled symbol name, usually "_symbol". The internal functions shall not
use the global (public) symbols.

This change eliminates usage of the global changes of the following symbols:
 - strlcat -> _strlcat
 - sysconf -> __sysconf
 - closedir -> _closedir
 - fparseln -> _fparseln
 - kill -> _kill
 - mkstemp -> _mkstemp
 - reallocarr -> _reallocarr
 - strcasecmp -> _strcasecmp
 - strncasecmp -> _strncasecmp
 - strptime -> _strptime
 - strtok_r -> _strtok_r
 - sysctl -> _sysctl
 - dlopen -> __dlopen
 - dlclose -> __dlclose
 - dlsym -> __dlsym

Sponsored by <The NetBSD Foundation>
2018-01-04 20:57:28 +00:00
christos
87ad8af409 PR/52801: Kamil Rytarowski: Add missing weak aliases for wcsto{f,d,ld}_l
XXX: pullup-8
2017-12-09 22:48:00 +00:00
abhinav
fc4633c657 Add towupper to the NAME section as well. 2017-10-25 16:07:34 +00:00
wiz
01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
christos
46629f8e5f pacify lint. 2017-01-10 17:50:24 +00:00
abhinav
2ed9602dad Fix function prototype in the SYNOPSIS
Also, fix function name in the RETURN VALUES section.

From Henning Petersen in PR lib/51284
2016-06-27 08:18:34 +00:00
joerg
5d45063308 Go back to just using normal visibility for the locale symbols. Without
an actual specifier like dllimport, protected visibility is unusable.
2016-04-29 16:26:48 +00:00
christos
3ae9c71097 undo the dso protected for clang 2016-03-17 17:38:14 +00:00
christos
2ebf0c7f4d Undo the __dso_protected hackery. 2016-03-08 04:00:11 +00:00
christos
bcffc9ad49 disable dso protected to work around binutils bug. 2016-01-29 15:18:08 +00:00
joerg
bdfde3da9a Redo the locale cache to be constant. It now contains the localeconv()
data and which LC_MONETARY and LC_NUMERIC values it is derived from.
In newlocale(3) and setlocale(3), check for the existing entries and on
miss, create a new entry. This is currently not using a lock for the
list as the worst case is a small memory leak.
2013-09-13 13:13:32 +00:00
joerg
52b1859854 Extract the data for nl_langinfo directly from the corresponding
part implementation using a category/offset table.
2013-08-20 19:58:30 +00:00
joerg
a5358f3607 Remove most LC_CTYPE specific parts of locale.cache. 2013-08-19 22:43:28 +00:00
joerg
8b770def41 Missing locale specific change. 2013-08-19 20:41:15 +00:00
joerg
325fca1539 Shut up lint. 2013-08-19 09:12:58 +00:00
joerg
9c11b12444 Add nl_langinfo_l, catopen_l and wcsftime_l. 2013-08-19 08:03:33 +00:00
joerg
2933c53464 Rename fixup to update_global to better reflect the purpose.
Remove the various Current pointers, they are implementation internals
that shouldn't be leaked. Remove _CATEGORY_DEFAULT related handling and
directly pick the implemenation pointer from the C locale.
Merge the C locale data into global_locale.c with the exception of
_DefaultRuneLocale. Mark that one hidden. Move _RUNE_LOCALE and
_CITRUS_CTYPE into multibyte.h and pick up the correct rl_citrus_ctype
for non-default locales.
2013-08-18 20:03:48 +00:00
joerg
8c3abf72ef Remove empty file. 2013-08-17 18:48:01 +00:00
joerg
85a67e61f7 Add mbsnrtowcs and wcsnrtombs. Approved by core. 2013-05-28 16:57:56 +00:00
joerg
e0ac190e1e Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
2013-05-17 12:55:56 +00:00
joerg
81d0329e8d Make that to process PATH_LOCALE the first time _find_category is
called. Use this to implement newlocale and provide duplocale/freelocale
as well. Based on patches by Takehiko Nozaki with simplications and fix
for the init order by myself.
2013-04-30 00:45:04 +00:00
joerg
99fac95b50 Store time-specific locale data directly in the locale.
Ad dstrftime_l, strftime_lz and strptime_l.
2013-04-21 17:45:46 +00:00
joerg
3c1c8515c7 Add MB_CUR_MAX_L. 2013-04-19 14:35:31 +00:00
joerg
10e0e4a06b Add wcscoll_l, wcsxfrm_l, wcsncasecmp_l, wcscasecmp_l, btowc_l,
mbrlen_l, mbsinit_l, mbsrtowcs_l, wcrtomb_l, wcsrtombs_l and wctob_l.
2013-04-18 23:24:26 +00:00
joerg
9a7fa6ff3c Add wcstof_l, wcstod_l and wcstold_l. 2013-04-18 22:23:17 +00:00
joerg
ceb51ddcad Add mblen_l, mbstowcs_l, wctomb_l, mbtowc_l and wcstombs_l. 2013-04-18 22:22:20 +00:00
joerg
6ffcdd8d70 Add localeconv_l. 2013-04-17 20:40:13 +00:00
joerg
444e318434 Add support for wcstoimax_l and friends. 2013-04-16 16:52:13 +00:00
joerg
b7970e3b60 Add wcwidth_l, wcswidth_l and the wctype.h family of *_l functions. 2013-04-16 11:39:13 +00:00
joerg
a952f5938e Provide a const copy of global_locale for libc-internal use.
This will be used by *_l when a NULL pointer is given.
2013-04-14 23:44:53 +00:00
joerg
14b179f1c9 Rename struct _locale_impl_t to struct _locale, since it will end up as
locale_t later.
2013-04-14 23:30:15 +00:00
joerg
e8fa8f4db7 Extend ctype classification table to 16bit. Based on patch by
Takehiko Nozaki, with changes to compile fail when using the old names
and to exploit __BUILD_LEGACY
2013-04-13 10:21:20 +00:00
wiz
6c95282a11 Restore RCS Id lost in previous. 2012-08-08 20:16:50 +00:00
tnozaki
277ab1b54d fix PR lib/46781 statically compiled bash makes locale loading fail.
analyzed and  patch provided by enami@ nonaka@ obache@ soda@, thanks.
patch modified by me.
2012-08-08 18:37:26 +00:00
abs
9e66e6d75e Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
2012-06-25 22:32:43 +00:00
christos
3d365e7447 fix old style definitions; XXX: gcc should have picked them up but it did not. 2012-06-24 15:26:02 +00:00
christos
56a2b6ea32 cast CHAR_MAX to (char) for unsigned character machines 2012-03-21 14:11:24 +00:00
matt
504f867176 Use C89 Prototypes.
Remove use of __P
2012-03-20 17:44:17 +00:00
tnozaki
2f142eb3e0 don't use __link_set_* stuff for locale implementation.
patch reviewed by matt@, thanks.
2012-03-04 21:14:55 +00:00
joerg
0f5f511fae Remove code for CITRUS!=yes. 2012-01-20 16:31:29 +00:00
joerg
726d8a62b9 _runetype_from_ctype is unused 2012-01-18 14:22:27 +00:00
christos
9292cfb210 close on exec fixes:
- open + fcntl -> open O_CLOEXEC
- configuration database file descriptors that can stay open are now opened
  fopen(db, "re")
2011-10-15 23:00:01 +00:00
christos
a9157d7432 annotate that some functions use non-literal format strings. 2011-08-14 09:07:37 +00:00
jruoho
ff8dfca355 Xref tm(3). 2011-04-14 05:50:49 +00:00
joerg
6c7179c5fb Remove support for the old BSDCTYPE format. 2011-03-25 00:45:24 +00:00
mbalmer
7d564f115e Crosslink wcstombs(3) and mbstowcs(3). 2011-03-16 09:32:12 +00:00
wiz
3d3c5d42cb Observe the following spelling:
- wide character (noun)
- wide-character (adjective)

Inspired by jmc@OpenBSD.
2010-12-16 17:42:25 +00:00
joerg
674a655551 Prefix ctype bitmask macros with _CTYPE 2010-12-14 02:28:57 +00:00
tnozaki
96bcb898d4 variable must to be nul terminated before "CODESET=foo".
ISO2022 module doesn't understand this and may fail setlocale(3).
2010-11-30 15:25:05 +00:00