Commit Graph

59 Commits

Author SHA1 Message Date
tshiozak cf33db0f3a fix the problem about resetting the state of iconv().
iconv() was not conforming to the SUSv3 at this point.
reported by Bruno Haible.
2003-09-01 06:16:13 +00:00
agc eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
thorpej 31ede4a9e3 Pull in host-tool config.h, if necessary. 2003-07-21 07:10:28 +00:00
tshiozak 5e3e3850e3 correct boundary check in _citrus_db_lookup_string_by_string(). 2003-07-16 08:13:51 +00:00
itojun 2ec4a5905e use bounded string op 2003-07-16 08:05:27 +00:00
tshiozak 0e0aa0868c use NONIDENTICAL instead of ILSEQ if the reverse conversion of ISO646.
(fix for lib/22135)
2003-07-14 11:37:49 +00:00
tshiozak c1e771ab90 separate "nonidentical conversion" and "ilseq" under csmapper.
"nonidentical" means "the input character index is valid, but not
corresponding to the output codeset."
"ilseq" means "the input character index is invalid for the input codeset."
2003-07-12 15:39:19 +00:00
tshiozak 888aa165a5 add forgotten _CITRUS_HASH_REMOVE() at release_shared().
This hopefully fixes the PR pkg/22113.
2003-07-10 09:08:57 +00:00
tshiozak 8adfd9b778 make _DIAGNOSTIC happy. 2003-07-10 08:50:43 +00:00
tshiozak 918c07021f separate "close" process into two parts (with and without handling hash).
This change makes the code symmetrical and ensures the lock not to be
aquired recursively.
The problem that the lock is tried to be aquired recursively was
pointed out by Matthias Drochner.
2003-07-02 17:48:57 +00:00
tshiozak 58db2e99e2 add iconv_t cache.
- separate shared part and context part from iconv_t.
  - add cache of shared part.
and, bump shlib_version minor of i18n modules because iconv i/f is changed.
2003-07-01 09:42:15 +00:00
tshiozak 290f7cdee9 cosmetic change. 2003-07-01 08:34:03 +00:00
tshiozak b50ac1a74f fix lib/22023 - there were references to uninitialized variables. 2003-07-01 08:33:06 +00:00
christos 6363afb646 use __attribute__((__packed__)) instead of __packed. 2003-06-30 17:54:13 +00:00
tshiozak a8076e0474 add #include "config.h" when these files are built as parts of host tools. 2003-06-30 12:32:21 +00:00
tshiozak cba952da4e u_int*_t -> uint*_t.
I would like to use stdint.h, but it is too modern for the host tools.
u_int*_t are more popular under UNIX-like systems, although they are
not backed up with any standards.
(src/tools/compat/stdint.h is maybe necessary.)
2003-06-29 17:30:07 +00:00
tshiozak 82d5554eda sync with the last change for citrus_hash.h. 2003-06-27 17:53:31 +00:00
tshiozak 2aa99730ce make sure to use LIST_* macros defined in sys/queue.h.
pointed out by yamt@netbsd.
2003-06-27 17:43:15 +00:00
yamt d71154b0e4 in _citrus_ctype_btowc_fallback() and _citrus_ctype_wctob_fallback(),
use enough size byte arrays, instead of abusing mbstate_t.
just pedantic.  no functional change is involved.
2003-06-27 14:52:25 +00:00
yamt 8822a3e83e $NetBSD $ -> $NetBSD$ 2003-06-27 12:55:13 +00:00
itojun c7ca01fc7d i guess the original intent was this... 2003-06-27 08:58:18 +00:00
itojun 877654378b memset() after null check 2003-06-27 08:56:07 +00:00
itojun 29aff1f984 clear memory after malloc() 2003-06-27 08:50:47 +00:00
tshiozak f3995f1ad3 correct wcrtomb(3) - it is not conforming to standard on handling L'\0'.
This change also affects Citrus iconv engine.
2003-06-26 12:09:56 +00:00
tshiozak f77c39f209 make sure that key is case-insensitive. 2003-06-26 12:05:04 +00:00
tshiozak 04e58308a3 Citrus iconv support (1)
add core engine of Citrus iconv and some support routines.
  - iconv core (citrus_iconv)
  - coded character set mapper (csmapper)
  - encoding scheme database (esdb)
  - standard encoding scheme handler (stdenc)
  - basic character set manipulation utilities (bcs)
  - mmap based infrastructure (citrus_lookup/_mmap/_memstream/_db)
  - some source codes of new plugins (not built yet)
2003-06-25 09:51:26 +00:00
petrov cc36666171 No need in default label if default case is not processed. 2003-05-08 20:42:39 +00:00
tshiozak c2cadb8a46 add support for zh_CN.GB18030 locale.
(lib/20835 by sigsegv at s25 dot xrea dot com)
XXX: charclass for GBK compatible area is not supported.
2003-03-25 18:26:51 +00:00
tshiozak d0db871d32 fix the problem if EILSEQ is caused in mbrtowc(3) under *.UTF-8 locales.
(lib/20873 by khym at azeotrope dot org)
2003-03-25 17:35:36 +00:00
tshiozak 326ed36874 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.
2003-03-05 20:18:14 +00:00
yamt a7e4d902d4 - handle s==NULL case of wcrtomb.
- add a comment about it.

fix rest of PR 18269 by wurlitzer.
2003-01-01 15:57:12 +00:00
yamt 6a7521b053 - add missing _CEI_TO_EI/_TO_CEI.
- don't use 'cl' before assert it's non NULL.
2003-01-01 15:25:54 +00:00
yamt 13820b1f52 - add missing _CEI_TO_EI/_TO_CEI.
- add missing _STATE_NEEDS_EXPLICIT_INIT checks.
- more comment.
2003-01-01 15:04:01 +00:00
yamt 26baecb89a in _RESTART_BEGIN macro, don't use external variable directly. 2003-01-01 14:45:13 +00:00
yamt 1e35b17a10 when s==0, wctomb should initialize its internal state and return if
encodings have state dependency or not.

a patch provided with PR 18269 by wurlitzer.
modified by me.

fix part of PR 18269.
2003-01-01 14:34:27 +00:00
yamt dec2654840 mbsrtowcs_priv template:
n == 0 is not an error. it's a valid input.
_citrus_NONE_ctype_mbsrtowcs:
	fix a typo that causes SEGV.

while i'm here, make them similar each other.

fix PR 19620.
2003-01-01 13:29:45 +00:00
uebayasi 1e0907fb9a Typos in comments. 2002-12-26 07:58:19 +00:00
lukem 91d06a031b More use of ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path 2002-08-19 13:35:05 +00:00
thorpej 967ae659f1 Add some casts to quiet a "discards qualifier from pointer target type"
warning from gcc 3.2 (experimental) (which is complaining about the loss
of __restrict).

Reviewed and approved by tshiozak@astec.co.jp.
2002-05-24 04:04:30 +00:00
yamt ab015054f8 - fix a.out case. (pointed by an anonymous person)
- use __ELF__ to determine if we're using elf.
2002-04-20 05:55:47 +00:00
yamt 27563a14f1 - move _TO_CEI to template from each module/*.c.
- nuke _TO_EI and _TO_STATE.
- convert _TO_EI(cl) to _CEI_TO_EI(_TO_CEI(cl)).
- wrap long lines.
2002-03-28 10:53:48 +00:00
yamt 0f59b7f0ae fix comments.
(_TO_INTERNAL_STATE -> _CEI_TO_STATE)
2002-03-28 10:38:52 +00:00
yamt 3daba72ae9 introduce new macro _STATE_NEEDS_EXPLICIT_INIT.
and use it for encodings that needs explicit
init_state in addition to zero-fill.
2002-03-28 10:29:11 +00:00
yamt 6854a8c8c8 drop __packed__ attribute from _ISO2022State. 2002-03-28 01:59:50 +00:00
yamt 7b15929c54 fix wcstombs: convertion should always begin with
an initial shift state. and nuke s_wcstombs.
2002-03-27 17:54:40 +00:00
yamt 097394b63d fix state backup.
XXX this should be move into wcrtomb_priv.
2002-03-27 17:18:41 +00:00
yamt f0ab6c6443 - change _ENCODING_MB_CUR_MAX to take a pointer to encoding info.
- don't use MB_CUR_MAX here since it's depend on current locale.
  use _ENCODING_MB_CUR_MAX instead.
2002-03-27 15:01:16 +00:00
yamt 9e8142572a fix wcsrtombs to restart correctly. 2002-03-26 07:53:38 +00:00
yamt c89607bec7 wcsrtombs: handle dst == 0 case correctly. 2002-03-25 20:47:02 +00:00
yamt e274c8a885 - handle the case that buffer size == 0 for wcsrtombs.
- add a XXX comment.
2002-03-25 20:29:30 +00:00