Commit Graph

481 Commits

Author SHA1 Message Date
ache
c44dc0d639 Add comment explaining __mb_sb_limit trick here. 2007-10-15 09:51:30 +00:00
ache
a5038f060d The problem is: currently our single byte ctype(3) functions are broken
for wide characters locales in the argument range >= 0x80 - they may
return false positives.

Example 1: for UTF-8 locale we currently have:
iswspace(0xA0)==1 and isspace(0xA0)==1
(because iswspace() and isspace() are the same code)
but must have
iswspace(0xA0)==1 and isspace(0xA0)==0
(because there is no such character and all others in the range
0x80..0xff for the UTF-8 locale, it keeps ASCII only in the single byte
range because our internal wchar_t representation for UTF-8 is UCS-4).

Example 2: for all wide character locales isalpha(arg) when arg > 0xFF may
return false positives (must be 0).
(because iswalpha() and isalpha() are the same code)

This change address this issue separating single byte and wide ctype
and also fix iswascii() (currently iswascii() is broken for
arguments > 0xFF).
This change is 100% binary compatible with old binaries.

Reviewied by: i18n@
2007-10-13 16:28:22 +00:00
gabor
b75fdc8954 - Fix typo
Approved by:	keramida (mentor)
MFC after:	3 days
2007-05-04 16:01:07 +00:00
deischen
2a7306fdc5 Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
imp
cd1f140ae4 Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.
2007-01-09 00:28:16 +00:00
ru
89970b0707 Add missing comma. 2006-10-13 16:11:12 +00:00
trhodes
dba9e095d4 Fix a bug where, for 6-byte sequences, the top 6 bits get compared to
111111 rather than the top 7 bits being compared against 1111110 causing
illegal bytes fe and ff being treated the same as legal bytes fc and fd.
2006-03-30 09:04:12 +00:00
deischen
c52b7e783b Add __collate_load_error and __collate_range_cmp to the list of
FBSDprivate locale symbols.  These functions are needed by
libcompat.

Add _cleanup to the list of stdio FBSDprivate symbols.  Some
third party applications use this.  This will be removed and
replaced by fcloseall() once libc version is bumped.

Add _res to the list of resolv symbols.

Found by:	portbuilder runs (thanks Kris!)
2006-03-30 04:37:08 +00:00
deischen
a0f6b0f1d0 Add each directory's symbol map file to SYM_MAPS. 2006-03-13 01:15:01 +00:00
deischen
138dd54357 Add symbol maps and initial symbol version definitions to libc.
Reviewed by:	davidxu
2006-03-13 00:53:21 +00:00
ru
928d297eeb -mdoc sweep. 2005-11-17 13:00:00 +00:00
stefanf
f9e069084c Include a couple of headers to ensure consistency between the prototype and
the function definition.
2005-09-12 19:52:42 +00:00
tjr
78e65e50fc Add HISTORY section. 2005-07-21 10:53:27 +00:00
tjr
6f4c9fc169 Add cross-reference to nextwctype(3). 2005-07-21 10:32:17 +00:00
tjr
13eae5695c Add COMPATIBILITY and HISTORY sections. Fix typo. 2005-07-21 10:27:45 +00:00
tjr
016c317723 Remove confusing "single C char locales" phrase; arguments to these
functions and must now be either an unsigned char or EOF, regardless of
locale.
2005-07-17 04:11:06 +00:00
tjr
111bf5f2ad Remove confusing "single C char locales" phrase; arguments to tolower()
and toupper() must now be either an unsigned char or EOF, regardless of
locale.
2005-07-17 03:37:00 +00:00
ru
86758e8895 Make <runefile.h> internal to libc.
Suggested by:	phantom
2005-05-16 09:32:41 +00:00
ru
f8ec83d904 Make the format of LC_COLLATE files architecture independent. 2005-02-27 20:31:13 +00:00
phantom
23d961a13f . Static'ize functions exported via function reference variables only.
. Replace inclusion of sys/param.h to sys/cdefs.h and sys/types.h where
  appropriate.
. move _*_init() prototypes to mblocal.h, and remove these prototypes
  from .c files
. use _none_init() in __setrunelocale() instead of duplicating code
. move __mb* variables from table.c to none.c allowing us to not to
  export _none_*() externs, and appropriately remove them from mblocal.h

Ok'ed by:	tjr
2005-02-27 15:11:09 +00:00
phantom
31651f25d8 ANSI'fy prototypes 2005-02-27 14:54:23 +00:00
ru
dff27cebe2 Make the format of LC_CTYPE files architecture independent by
introducing the disk formats for _RuneLocale and friends.

The disk formats do not have (useless) pointers and have 32-bit
quantities instead of rune_t and long.  (htonl(3) only works
with 32-bit quantities, so there's no loss).

Bootstrap mklocale(1) when necessary.  (Bootstrapping from 4.x
would be trivial (verified), but we no longer provide pre-5.3
source upgrades and this is the first commit to actually break
it.)
2005-02-26 21:47:54 +00:00
stefanf
d5719e89ef Fix comparisons that test if an unsigned value is < 0.
Reviewed by:	tjr
2005-02-12 08:45:12 +00:00
ru
ed72feddcb Sort sections. 2005-01-20 09:17:07 +00:00
ru
c71a57d3ca Markup style. 2005-01-15 11:22:13 +00:00
ru
5384a04b6a Scheduled mdoc(7) sweep. 2005-01-11 20:50:51 +00:00
tjr
55ecebbe93 Implement rpmatch(), a semi-standard interface (as found on AIX, Tru64,
GNU) for determining whether a string is an affirmative or negative
response to a question according to the current locale. This is done
by matching the response against nl_langinfo(3) items YESEXPR and NOEXPR.
2005-01-09 03:55:13 +00:00
ache
bc82f1441b Remove setrunelocale() 2004-10-18 02:06:18 +00:00
tjr
3d89cd8c71 Remove the obsolete <rune.h> interface. 2004-10-17 06:51:50 +00:00
tjr
e40fa30ce6 Remove support for the obsolete UTF2 encoding. 2004-10-17 02:29:15 +00:00
stefanf
5b6654bdf6 Prefer C99's __func__ over GCC's __FUNCTION__. 2004-09-22 16:56:49 +00:00
tjr
9cf5fdf194 Re-word warning about the UTF2 encoding, taking care to use the word
"obsolete" instead of "deprecated".
2004-08-21 08:08:29 +00:00
tjr
7c805bebcd Bump document date for previous. 2004-08-21 08:03:18 +00:00
tjr
4fe778a081 Re-word warning about the rune interface, taking care to use the word
"obsolete" instead of "deprecated".
2004-08-21 08:00:31 +00:00
tjr
0950eb6cba Change "deprecated" in link-time warnings about various rune functions
to "obsolete".
2004-08-21 07:48:06 +00:00
tjr
a8cee78a82 Re-word compatibility section, taking care to use the word "obsolete" to
describe the 4.4BSD extension of accepting characters (runes) outside of
the range of unsigned char.
2004-08-21 07:37:08 +00:00
trhodes
05b6eacd90 /me kicks cvs update
Revert previous commit, tjr already fixed it and I was too stupid to
notice this fact.

Approved by:	re (to avoid failing cvs ci)
2004-08-17 04:56:03 +00:00
trhodes
d788381502 Fix incorrect code in an example. The previous example would produce
19 column positions wide in the first line and 20 in the rest of the lines.
This fixes the example to provide the correct output.

PR:		53454
Noticed by:	Kuang-che Wu <kcwu@kcwu.homeip.net>
Submitted by:	Marc Silver <marcs@draenor.org>
Approved by:	re (scottl)
2004-08-17 04:45:52 +00:00
tjr
a1081fe738 Fix example. 2004-08-12 12:32:14 +00:00
tjr
84b5d3520f Implement wcwidth() as an inline function. 2004-08-12 12:19:11 +00:00
tjr
24ab237a89 Re-word the COMPATIBILITY section, taking care to use the word "deprecated"
to describe the 4.4BSD extension of accepting arguments outside the range
of unsigned char. This gives us freedom to remove this extension when we
remove the <rune.h> interface in FreeBSD 6.
2004-07-29 23:32:41 +00:00
tjr
786e3d397c Remove unnecessary #include directives. 2004-07-29 06:18:40 +00:00
tjr
45e69ebea9 Prefer <runetype.h> to <rune.h>, since the latter is going away soon. 2004-07-29 06:16:19 +00:00
tjr
922ba3746b Remove useless checks for characters longer than INT_MAX bytes. 2004-07-29 06:08:31 +00:00
tjr
b9fa8ef024 Add UTF-8-specific implementations of mbsnrtowcs() and wcsnrtombs().
These convert plain ASCII characters in-line, making them only slightly
slower than the single-byte ("NONE" encoding) version when processing
ASCII strings.
2004-07-27 06:29:48 +00:00
tjr
7108a0ff8a Return the correct value when dst == NULL and conversion has stopped after
nwc dropping to zero.
2004-07-22 02:57:29 +00:00
tjr
5b4f25c6e9 Implement the GNU extensions of mbsnrtowcs() and wcsnrtombs(). These are
convenient when the source string isn't null-terminated.

Implement the other conversion functions (mbstowcs(), mbsrtowcs(), wcstombs(),
wcsrtombs()) in terms of these new functions.
2004-07-21 10:54:57 +00:00
tjr
0bea5c0108 Add fast paths for conversion of plain ASCII characters. 2004-07-09 15:46:06 +00:00
tjr
3a9d81b253 Add a function to iterate over all characters in a particular character
class. This is necessary in order to implement tr(1) efficiently in
multibyte locales, since the brute force method of finding all characters
in a class is infeasible with a 32-bit (or wider) wchar_t.
2004-07-08 06:43:37 +00:00
ru
b5e1c67f19 Markup nits. 2004-07-05 06:39:03 +00:00