Commit Graph

9 Commits

Author SHA1 Message Date
Tim J. Robbins
ca99cfdd14 Add support for multibyte characters. The challenge here was to use
data structures that scale better with large character sets, instead of
arrays indexed by character value:
- Sets of characters to delete/squeeze are stored in a new "cset" structure,
which is implemented as a splay tree of extents. This structure has the
ability to store character classes (ala wctype(3)), but this is not
currently fully utilized.
- Mappings between characters are stored in a new "cmap" structure, which
is also a splay tree.
- The parser no longer builds arrays containing all the characters in a
particular class; instead, next() determines them on-the-fly using
nextwctype(3).
2004-07-09 02:08:07 +00:00
Andrey A. Chernov
30c1156451 No functional changes, just code reorganization from prev. commit, it
makes one malloc unneeded, removes two bzero's and makes code more readable.

"Bright ideas comes only _after_ commits."
2003-08-04 05:22:06 +00:00
Andrey A. Chernov
a508a04d43 POSIX requires 'c-c' must conform collate and be in collation order 2003-08-03 03:51:27 +00:00
Andrey A. Chernov
00611f0457 This patch address two problems.
1st one is relatively minor: according our own manpage, upper and lower
classes must be sorted, but currently not.

2nd one is serious:
	tr '[:lower:]' '[:upper:]'
	(and vice versa) currently works only if upper and lower classes
	have exact the same number of elements. When it is not true, like for
	many ISO8859-x locales which have bigger amount of lowercase letters,
	tr may do nasty things.

	See this page
	http://www.opengroup.org/onlinepubs/007908799/xcu/tr.html
	for detailed description of desired tr behaviour in such cases.
2003-08-03 02:23:39 +00:00
Tim J. Robbins
dc20d4b9d4 Move the #include and #define's to the top of the file. 2002-06-14 15:56:52 +00:00
Tim J. Robbins
4efc23dabf Bump the size of the equivalence set to NCHARS; this file was left out
of a previous commit implementing equivalence classes.
2002-06-14 15:53:38 +00:00
Warner Losh
3f330d7d1a remove __P 2002-03-22 01:42:45 +00:00
Philippe Charnier
af647767ed Use err(3) instead of local redefinition. Cosmetic in usage(). 1997-08-18 07:24:58 +00:00
Rodney W. Grimes
9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00