Commit Graph

200 Commits

Author SHA1 Message Date
christos
4fd46030a6 look in the right place for the modules of compat binaries 2013-09-19 21:19:13 +00:00
joerg
db0a20e19e GC put16.
XXX Use sys/endian.h
2013-09-14 13:05:51 +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
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
5f5c1f0096 Fix header guard, courtesy of clang. 2013-06-24 17:28:35 +00:00
joerg
85a67e61f7 Add mbsnrtowcs and wcsnrtombs. Approved by core. 2013-05-28 16:57:56 +00:00
joerg
323be87542 Restore standalone strtol/strtoul for citrus for now. 2013-04-26 21:20:47 +00:00
joerg
a67fde0356 Add strtol_l and friends. Switch _citrus_bcs_strtol to use plain
strtol_l unless in tools mode. Add note to retire the BCS code on the
next libc major bump.
2013-04-16 21:44:06 +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
msaitoh
2d0deef114 -Wstrict-overflow 2012-10-15 22:22:01 +00:00
martin
5d7ba3d813 Henning Petersen in PR lib/46560: fix memory leak in error path 2012-06-08 07:49:42 +00:00
joerg
1ffe43311f Do not depend on failing malloc to set errno 2012-05-04 16:45:05 +00:00
christos
c5e820cae4 PR/45989: Martin Husemann: lint invocation does include -w only on i386
- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
  would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
  builds)

approved by core@
2012-03-13 21:13:30 +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
wiz
6234e98d3f Remove unused variables. From cppcheck via Henning Petersen in PR 45997. 2012-02-12 13:51:29 +00:00
tnozaki
1c5f19ca24 add comment about r1.6 -> r1.7 change. 2011-11-20 07:43:52 +00:00
tnozaki
7119b42a87 fix memory leak, pointed by nonaka-san(again^3). 2011-11-19 18:48:39 +00:00
tnozaki
c0a2d6e78c remove useless free(), pointed by nonaka-san(again^2). 2011-11-19 18:43:40 +00:00
tnozaki
25c06e6322 return EINVAL when module validation failed, pointed by nonaka-san(again). 2011-11-19 18:34:21 +00:00
tnozaki
a750734d28 remove unused variable, pointed by nonaka-san, thanks. 2011-11-19 18:20:13 +00:00
wiz
60025aa86f Use boolean AND instead of bitwise one in _DIAGASSERT.
From Henning Petersen in PR 45518.
2011-10-30 21:48: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
tnozaki
6b58a1b843 revert r1.21, still problem exists for posix2008 mbsnrtowcs(not yet commited),
but i have no time to investigate t_mbrtowc failure.
2011-10-10 22:45:45 +00:00
tnozaki
9f0b22ed7d update string pointer when input is partial escape sequence or multibyte. 2011-10-07 18:59:13 +00:00
joerg
998c5d780f Make intermediate size variable size_t like the rest to avoid
unnecessary casting.
2011-05-23 14:53:46 +00:00
joerg
04d16b5c6d Use C99-style init in _CITRUS_PROP_HINT_END to avoid warnings for
uninitialised type field.
2011-05-23 14:52:32 +00:00
joerg
939ab48f97 Actually return something deterministic 2011-05-23 14:45:44 +00:00
jruoho
29a43bf561 From Henning Petersen in PR # 44641: C99 primitive type 'bool' used
as a variable name. Also small KNF, as in FreeBSD.
2011-03-30 08:22:01 +00:00
joerg
e325eedcc1 Remove tautology. 2010-12-07 22:01:45 +00:00
joerg
aaf356760f Mark function as static and give it an explicit return type. 2010-12-07 22:01:22 +00:00
tnozaki
3cc4120729 1. refactoring new locale-db(RuneCT10) loading method with mmap(2).
2. remove unused field from _RuneLocale.
3. localeio(CITRUS=no) can read new locale-db(RuneCT10) now.
2010-06-19 13:26:51 +00:00
tnozaki
2a7af30c36 1. split runetype_local.h -> runetype_file.h
and remove renameing _Rune* -> _NBRune* namespace protection.

   FreeBSD traditionaly exposes struct _Rune* in runetype.h
   which included by ctype.h. it may cause conflicting type error
   in our cross build process, former we use renaming namespace
   to avoid this problem, now i reworked more resonable way.

2. merge rune_local.h to runetype_local.h, and remove it.
3. split bsdctype.h -> bsdctype_{file,local}.h
2010-06-13 04:14:56 +00:00
tnozaki
9efec5bce3 1. MB_LEN_MAX switch MD to MI.
2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32
   so we have to add more setlocale(3) __RENAME func, __setlocale50.
3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/*
   prepareing for next libc major crunk.
4. bump libc minor version.
2010-06-07 13:52:28 +00:00
tnozaki
9a35d7972b more split ctype.h -> sys/ctype_inline.h, sys/ctype_bits.h 2010-06-01 13:52:07 +00:00
tnozaki
cd71bcf609 1. fix build problem CITRUS=no
2. make CITRUS={yes,no} knob friendly with libc/compat.
2010-05-30 08:28:53 +00:00
tnozaki
32cc8c2e5f rune.h is not public, so merge with rune_local.h. 2010-05-22 08:13:18 +00:00
tnozaki
5ad520e6d1 _locale_cache_t: change ldata and items to pointer for future binary compatibility. 2010-03-27 15:25:21 +00:00
tnozaki
56bf19aaea fix byte order mark related bug introduced by previous commit,
reported by Sverre Froyen via current-user, thanks!
2010-03-20 18:15:32 +00:00
tnozaki
36a8b8869c 1. fix wrong byte order mark of utf-16, reported by NARUSE Yui -san.
patch provided by tshiozak@ -san.

2. don't eat 0xfeff/0xfffe if they don't appear at the first of bytestream.
noticed y tshiozak@ -san, patch provied by me.

thanks a lot.
2010-03-15 15:00:58 +00:00
dholland
9af4cd75f3 Add parentheses around a misleading string constant concatenation,
from (my own, very old) PR 36064.
2009-09-05 06:44:27 +00:00
lukem
83f6c8b3a4 fix -Wcast-qual issue 2009-04-12 14:20:19 +00:00
tnozaki
5f8a9fb1ee fix typo, don't overwrite LC_TIME's t_fmt_ampm by t_fmt. 2009-02-09 14:39:48 +00:00
lukem
a99197aa1c sign-compare fix 2009-02-03 04:58:38 +00:00
tnozaki
db74109901 PR lib/40411, nuke wctrans_init(). lazy initialization is not good idea.
statically initialized _DefaultRuneLocale.rl_wctrans field.
so we can re-const-ify _DefaultRuneLocale.

pkgsrc/shells/standalone-tcsh should be rebuild,
because it's staticaly linked binary.
2009-01-18 22:03:19 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
dogcow
441204832d move nbtool_config.h include to top. 2009-01-05 03:10:02 +00:00
tnozaki
52ed7b035f Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES} db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).

[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
  new locale-db implementation using citrus_db backend,
  see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
  internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].

[tools]
- mklocale(1): add new option ``-t'' that generates new style
  LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().

[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
    en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
    zh_CN.eucCN -> zh_CN.GB18030
    and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
  for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
  i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<

old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
2009-01-02 00:20:18 +00:00
christos
674681d3c0 fix gcc warnings from Alexander Shishkin 2008-07-25 14:05:25 +00:00