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
ru
6651f20e0d
Sort SEE ALSO references (in dictionary order, ignoring case).
2004-07-04 20:55:50 +00:00
ru
01548ace15
Mechanically kill hard sentence breaks.
2004-07-02 23:52:20 +00:00
ru
4b39413aeb
Removed trailing whitespace.
2004-07-02 19:07:33 +00:00
ru
95168a499a
Markup, grammar, and spelling fixes.
2004-06-30 20:09:10 +00:00
ru
6ad65dd7e0
Fixed a typo.
2004-06-30 19:32:41 +00:00
tjr
d04fd4700f
Prefix the names of members of _RuneLocale and its sub-structures
...
with ``__'' to avoid polluting the namespace. This doesn't change the
documented rune interface at all, but breaks applications that accessed
_RuneLocale directly.
2004-06-23 07:01:44 +00:00
mpp
98d43ce6f1
Spelling fixes.
2004-06-21 19:54:56 +00:00
tjr
fb60260f98
Buffer partial wide characters more efficiently: instead of storing the
...
multibyte representation in conversion state objects, store the
accumulated wide character, set number and number of bytes remaining
to avoid having to derive them every time mbrtowc() is called.
2004-05-27 10:54:34 +00:00
tjr
0efcf2d09b
Scan the source string for invalid wide characters in wcsrtombs()
...
in the dst == NULL case.
2004-05-25 10:45:24 +00:00
tjr
ea28a65744
Grab all the information we need about a character with one call to
...
__maskrune() instead of one direct call and one through iswprint().
2004-05-23 13:20:09 +00:00
tjr
aee8349a0c
Use conversion state objects to store the accumulated wide character,
...
low bound, and the number of bytes remaining instead of storing the
raw byte sequence and deriving them every time mbrtowc() is called.
This is much faster -- about twice as fast in some crude benchmarks.
2004-05-17 12:32:40 +00:00
tjr
b40b6a2d84
Use a simpler and faster buffering scheme for partial multibyte characters.
2004-05-17 11:16:14 +00:00
tjr
9e176d6b08
Use a simpler, faster buffering scheme for partial characters in mbrtowc().
2004-05-14 15:40:47 +00:00
tjr
3aa9288a48
Allow encoding modules to override the default implementations of
...
mbsrtowcs() and wcsrtombs(). Provide a fast implementation for the
trivial "NONE" encoding.
2004-05-13 11:20:27 +00:00
tjr
e442306798
Fix braino in previous: check that the second byte in the character
...
buffer is non-null when the character is two bytes long, not when
the buffer is two bytes long.
2004-05-13 03:08:28 +00:00
tjr
5ad27cd64f
Reduce overhead by calling internal versions of the multibyte conversion
...
functions directly wherever possible.
2004-05-12 14:26:54 +00:00
tjr
e3f042f4af
Move prototypes of various encoding-related functions into a new header
...
file to avoid extern'ing them all over the place.
2004-05-12 14:09:04 +00:00
tjr
d79e71957e
In the absence of proper validation, at least check that null bytes
...
do not appear as anything but the first byte of a multibyte character.
2004-05-11 14:08:22 +00:00
tjr
a8117b04ca
Use a binary search to find the range containing a character in
...
RuneRange arrays. This is much faster when there are hundreds of
ranges (as is the case in UTF-8 locales) and was inspired by a
similar change made by Apple in Darwin.
2004-05-09 13:04:49 +00:00
ache
a7c84134a6
Rewrite split_lines() to operate safely
...
PR: 62694
Submitted by: moulin p <moulin.p@calyopea.com>
2004-04-25 19:56:50 +00:00
tjr
8f8a2ad179
Perform some basic validation of multibyte conversion state objects.
2004-04-12 13:09:18 +00:00
tjr
e26da574d5
Remove a nonsensical remark about byte order markers in UTF-8 streams.
2004-04-12 12:58:41 +00:00
tjr
e768e0d54f
Document the meaning of the zero return value.
2004-04-11 05:19:19 +00:00
davidxu
289170412b
Fix a typo. I was locked out for two days from my machine.
2004-04-10 14:36:57 +00:00
tjr
17077e5ae6
Don't cast away const qualifiers.
...
Spotted by: bde
2004-04-10 00:27:52 +00:00
tjr
0ca2900d48
Update manual pages for change to C99 mbrtowc() semantics.
2004-04-08 09:59:02 +00:00
tjr
54a18fa1d6
Allow partial multibyte characters to accumulate in conversion state
...
objects passed to mbrtowc(), mbsrtowcs(), and mbrlen(), as required
by C99.
2004-04-07 10:48:19 +00:00
tjr
226e976dd7
Begin conversions for sgetrune() and sputrune() in the initial
...
conversion state.
2004-04-07 09:49:10 +00:00
tjr
47b6d3f343
Prepare to handle state-dependent encodings. This mainly involves not
...
taking shortcuts when it comes to storing and passing around conversion
states.
2004-04-07 09:47:56 +00:00
tjr
c3bbcd6ef6
Begin in the initial shift state in mbstowcs() and wcstombs().
...
(This change is non-functional since nothing uses states yet.)
2004-04-07 08:33:23 +00:00
tjr
4212f9711f
Prepare to handle state-dependent encodings. This mainly involves not
...
taking shortcuts when it comes to storing and passing around conversion
states.
2004-04-06 13:14:03 +00:00
tjr
5642b0bbf4
Remove support for emulating mbrtowc() and wcrtomb() in terms of the
...
old rune interface now that it is no longer needed.
2004-04-04 11:31:29 +00:00
tjr
d98eda520c
Reimplement the GB18030 encoding method using the new-style (mbrtowc()/
...
wcrtomb()) interface.
2004-04-04 11:00:42 +00:00
tjr
dd0763020d
Reimplement the deprecated UTF2 encoding method using the UTF-8 code
...
as a base. mbrtowc() and wcrtomb() are now implemented directly
instead of being emulatedi with sgetrune() and sputrune().
2004-04-04 10:49:45 +00:00
tjr
1a32baef3b
Add cross-references to isideogram(3), isphonogram(3), isrune(3),
...
isspecial(3) and wctype(3).
2004-03-30 08:11:57 +00:00
tjr
0e393613f2
Add basic manual pages for isideogram(), isphonogram(), isrune()
...
and isspecial().
2004-03-30 07:23:54 +00:00
tjr
94fd478493
Trim cross-references.
2004-03-30 07:19:35 +00:00
tjr
9d08058845
Document the isnumber() and ishexnumber() functions, and explain how they
...
differ (at least in theory) from isdigit() and isxdigit().
2004-03-30 07:02:04 +00:00
tjr
8aa9f6fafe
Remove duplicate MLINK.
2004-03-29 21:46:52 +00:00
tjr
9b0a927d71
Recognize the "rune" character class in wctype().
2004-03-27 08:59:21 +00:00
dds
02e13ba2ce
Make consistent with the better written wcsrtombs function:
...
- Fix syntax
- Remove the (slightly wrong) duplicate explanation of the error condition
- Change reference to invalid multibyte character into invalid wide character
2004-02-27 15:03:22 +00:00
ache
d0d398da1c
LC_ALL not always take priority over other LC_*
...
Obtained from: NetBSD
PR: 62047
2004-01-31 19:15:32 +00:00
ache
ab3e3b27cb
Add reference to environ(7)
2004-01-29 09:27:24 +00:00
nectar
c281d0e2ea
Remove unused variables and function declarations. Add missing headers.
2004-01-06 18:26:15 +00:00
ache
b89dd89c31
Properly advance "x/y/z" form slash-pointers in some rare cases
...
PR: 60539
2003-12-24 10:16:46 +00:00
ache
750b0b565d
First byte of GBK-like sequences is 0x81, not 0x80
2003-12-19 12:54:42 +00:00
tjr
f9c332bd6a
Set __mbrtowc and __wcrtomb correctly when changing to the C/POSIX locale.
...
Save __mbrtowc and __wcrtomb and restore them when changing back to
the cached locale.
Reported by: perky
2003-12-08 23:52:22 +00:00
tjr
11f17fd074
Split multibyte(3) into separate manual pages for each function.
...
Instead of just deleting it, turn the original page into a general
overview of the multibyte character conversion functions, somewhat
similar to stdio(3).
2003-12-07 06:33:52 +00:00
tjr
412df50614
Split the documentation for localeconv() off into a separate manual page.
2003-12-07 06:00:00 +00:00
tjr
37d23e2aba
Update cross references after utf2/euc move.
2003-11-15 02:26:04 +00:00
tjr
dd1aaef04b
Remove section 4 versions of these manual pages, they have been
...
moved into section 5.
2003-11-15 02:15:25 +00:00
tjr
a49a4faf80
Install the section 5 versions of EUC and UTF2 manual pages instead of
...
the section 4 versions.
2003-11-15 02:13:09 +00:00
tjr
21ec09f9ec
Update the EUC and UTF2 manual pages for their new home in section 5.
...
These have been repo-copied from euc.4 and utf2.4.
2003-11-15 01:54:46 +00:00
tjr
042225384f
Fix a typo that caused mbrtowc() to always return 0.
2003-11-11 07:25:05 +00:00
tjr
0ea91c92a7
Add one more cross-reference to gb2312(5).
2003-11-08 03:23:11 +00:00
tjr
43f8154f97
Add cross-references to new gb2312(5) manual page.
2003-11-08 03:07:56 +00:00
tjr
50e07efd60
Add a fairly simple manual page for the new GB2312 encoding.
2003-11-08 03:02:45 +00:00
tjr
866579d246
Remove unused #includes.
2003-11-08 02:58:37 +00:00
tjr
c48a892fd1
Use __inline instead of inline.
2003-11-08 02:56:03 +00:00
tjr
7f360419c4
Refer to wide characters instead of runes. Remove redundant example locale.
...
Catch up with renaming of "Japanese" to "ja_JP.eucJP". Comment out the
statement that EUC is provided for compatibility with UNIX-based systems;
this is not a very good opening paragraph.
2003-11-08 02:52:31 +00:00
tjr
3433ed9c17
Refer to wide characters instead of runes.
2003-11-08 02:46:02 +00:00
davidxu
a6e1effefa
Add gb2312 encoding.
2003-11-05 22:52:51 +00:00
tjr
bd6d8c9eef
Implement mbrtowc() and wcrtomb() directly (sync with big5.c).
2003-11-05 07:56:45 +00:00
tjr
1c3a3f7e26
Convert the Big5, EUC, MSKanji and UTF-8 encoding methods to implement
...
mbrtowc() and wcrtomb() directly. GB18030, GBK and UTF2 are left
unconverted; GB18030 will be done eventually, but GBK and UTF2 may just
be removed, as they are subsets of GB18030 and UTF-8 respectively.
2003-11-02 10:09:33 +00:00
tjr
cdb4de5776
Remove TODO comment about creating a macro version of towctrans().
...
Remove unnecessary inclusion of <ctype.h>.
2003-11-01 08:20:58 +00:00
tjr
3c1f1a199d
Allow mbrtowc() and wcrtomb() to be implemented directly, instead of
...
as wrappers around the deprecated 4.4BSD rune functions. This paves the
way for state-dependent encodings, which the rune API does not support.
- Add __emulated_sgetrune() and __emulated_sputrune(), which are
implementations of sgetrune() and sputrune() in terms of
mbrtowc() and wcrtomb().
- Rename the old rune-wrapper mbrtowc() and wcrtomb() functions to
__emulated_mbrtowc() and __emulated_wcrtomb().
- Add __mbrtowc and __wcrtomb function pointers, which point to the
current locale's conversion functions, or the __emulated versions.
- Implement mbrtowc() and wcrtomb() as calls to these function pointers.
- Make the "NONE" encoding implement mbrtowc() and wcrtomb() directly.
All of this emulation mess will be removed, together with rune support,
in FreeBSD 6.
2003-11-01 05:13:13 +00:00
tjr
44278bfe73
Don't bother passing a freshly-zeroed mbstate to mbsrtowcs() etc.
...
when the current implementation won't use it, anyway. Just pass NULL.
This will need to be changed when state-dependent encodings are
supported, but there's no need to take the performance hit
in the meantime.
2003-10-31 13:29:00 +00:00
tjr
1ace50578b
Implement fgetrune(), fungetrune() and fputrune() as wrappers around
...
fgetwc(), ungetwc() and fputwc().
2003-10-31 10:55:19 +00:00
tjr
8366c4708a
Remove incomplete support for running FreeBSD userland on old NetBSD kernels
...
lacking the issetugid() and utrace() syscalls.
2003-10-29 10:45:01 +00:00
ru
1c23ef339b
mdoc(7): Use the new feature of the .In macro.
2003-09-08 19:57:22 +00:00
tjr
b9a0be968f
Remove an unused and incorrect prototype for _none_init().
2003-09-05 09:01:31 +00:00
tjr
a356560e21
Fix the case of the encoding name in the ENCODING line. Names are
...
case-sensitive, and MSKANJI does not work.
2003-08-10 11:41:38 +00:00
tjr
79a1201577
Cross-reference gbk(5).
2003-08-10 11:38:28 +00:00
tjr
8e1b8c0cf9
Cross-reference gbk(5) now that it exists. Fix a copy & paste error:
...
one occurrence of GB 18030 should have been 11383.
2003-08-10 11:36:42 +00:00
tjr
ff610fe32a
Add a fairly minimal manual page for the GBK encoding.
2003-08-10 11:34:35 +00:00
tjr
b3b78c5227
Add a cross reference to Unicode 3.0.
2003-08-10 11:26:18 +00:00
tjr
843375b3a6
Add cross references to the new character encoding manual pages,
...
and to mbsinit(3) while I'm at it.
2003-08-10 09:25:52 +00:00
tjr
a29811f4a0
Add manual pages for the BIG5, GB18030 and MSKanji encodings. These may
...
need to be fleshed out a little, especially big5(5).
2003-08-10 09:23:51 +00:00
tjr
cbe12b7936
Implement mblen(s, n) as mbtowc(NULL, s, n) to avoid calling sgetrune()
...
and to simplify things. This is only valid until we start supporting
state-dependent encodings.
2003-08-07 09:34:51 +00:00
tjr
84d24ef340
Implement mbstowcs() as a wrapper around mbsrtowcs(), and wcstombs()
...
as a wrapper around wcsrtombs().
2003-08-07 08:04:01 +00:00
tjr
b88da9d9aa
Implement mbtowc() in terms of mbrtowc(), and wctomb() in terms of wcrtomb().
2003-08-07 07:59:36 +00:00
tjr
298b52ca87
Implement btowc() in terms of mbrtowc() instead of sgetrune(), and
...
wctob() in terms of wcrtomb() instead of sputrune(). There should be
no functional differences, but there may be a small performance hit
because we make an extra function call.
The aim here is to have as few functions as possible calling
s{get,put}rune() to make it easier to remove them in the future.
2003-08-07 07:45:35 +00:00
ache
0d040622bd
Restore including of "collate.h", for its own prototype (mis)match detection
2003-08-03 19:28:23 +00:00
ache
aed962b0e9
Remove commented out and never used code
2003-08-03 05:20:31 +00:00
ache
1dac9aa79d
Remove __collate_range_cmp() stabilization, it conflicts with ranges
2003-08-03 04:40:40 +00:00
ache
2ecc37e253
Add support for gb18030 encoding
...
PR: 51729
Submitted by: Kang Liu <liukang@bjpu.edu.cn>
2003-07-29 07:52:44 +00:00
ache
96bd0cba77
Add const to __setrunelocale prototype
2003-07-06 04:01:09 +00:00
ache
92006f3cfc
Reorganize wrapper around setrunelocale() to mark it as deprecated
...
in FreeBSD 6
2003-07-06 02:03:37 +00:00
phantom
cd4974c734
. style(9)
...
. fix/add comments (to cover changes done thru last 20 months)
. extend monetary testcase to cover int_* values
2003-06-26 10:46:16 +00:00
phantom
551d2ed557
Reduce code duplication by separating _PathLocle detection code into
...
internal helper function.
2003-06-25 22:42:33 +00:00
phantom
a30cd00d3a
Move _PathLocale declaration to more logical place (setlocale.c)
2003-06-25 22:34:13 +00:00
phantom
dabc26f3d3
Catch up with _PATH_LOCALE move from rune.h to paths.h
2003-06-25 22:31:42 +00:00
tjr
0d7349736c
Mark the following interfaces as OBSOLETE_IN_6:
...
fgetrune(), fputrune(), fungetrune(), mbrune(), mbrrune(), mbmb(),
setinvalidrune(), UTF2 encoding method.
These have been marked as being deprecated in their manual pages since 5.0,
and their use causes a linker warning.
2003-06-13 07:13:54 +00:00
jkh
56787fa7b1
Fixes to locale code to properly use indirect pointers in order to prevent
...
memory leaks (fixes bugs earlier purported to be fixed).
Submitted by: Ed Moy <emoy@apple.com>
Obtained from: Apple Computer, Inc.
MFC after: 2 weeks
2003-06-13 00:14:07 +00:00
ache
4b34a4e4b4
Remove transition period hack
2003-06-10 01:26:04 +00:00
ache
9952d232aa
Add GBK encoding
...
PR: 51504
Submitted by: Statue <statue@freebsd.sinica.edu.tw>
2003-06-01 15:30:56 +00:00
ru
9bcac8799e
Assorted mdoc(7) fixes.
...
Approved by: re (blanket)
2003-05-22 13:02:28 +00:00
nectar
0b64e1476b
Back out the `hiding' of strlcpy and strlcat. Several people
...
vocally objected to this safety belt.
2003-05-01 19:03:14 +00:00
nectar
e69967f534
`Hide' strlcpy and strlcat (using the namespace.h / __weak_reference
...
technique) so that we don't wind up calling into an application's
version if the application defines them.
Inspired by: qpopper's interfering and buggy version of strlcpy
2003-04-29 21:13:50 +00:00
tjr
00b5bfa4c1
When called with s == NULL, behave as if wc == L'\0' as required by the
...
standard.
2003-04-10 09:20:38 +00:00
ache
c8c804af5e
According to C99 decimal_point can't be the empty string, mention it.
2003-03-20 08:13:34 +00:00
ache
2876ad7e0d
decimal_point can't be "" according to C99, so set it to standard "."
...
in that case.
2003-03-20 08:05:20 +00:00
tjr
dc2fc01c02
MFp4: Implementations of the wcstof() and wcstold() functions.
2003-03-13 06:29:53 +00:00
tjr
7d13c2dbf3
Fix a bad free() call that would occur if some #if 0'd code was used.
2003-02-22 00:06:05 +00:00
nectar
e369901c4d
Whack 28 unused variables.
2003-02-18 13:39:52 +00:00
charnier
670dc7ec9e
The .Fn function
2003-02-06 11:04:47 +00:00
schweikh
d3367c5f5d
Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
...
especially in troff files.
2003-01-01 18:49:04 +00:00
ru
4979ab8d81
mdoc(7) police: Deal with self-xrefs.
2002-12-24 13:41:48 +00:00
ru
51fe7c1a88
mdoc(7) police: "The .Fa argument.".
2002-12-19 09:40:28 +00:00
ru
863465c1ab
mdoc(7) police: Fixed abuses of the .Ar and .Em macros.
2002-12-18 13:33:04 +00:00
ru
8746d263e1
mdoc(7) police: "The .Fn function".
2002-12-18 12:45:11 +00:00
ru
4b97577172
Capitalize ASCII code names.
...
Approved by: re
2002-12-05 08:50:00 +00:00
ru
ec73cae726
mdoc(7) police: sweep.
2002-11-29 17:35:09 +00:00
ru
ecf768b1cc
mdoc(7) police: sweep.
2002-11-29 16:42:23 +00:00
ru
40e2359f4b
libc_r wasn't so tied to libc for 22 months.
2002-11-18 09:50:57 +00:00
tjr
29fe4660c0
Add cross references to mbrtowc(3) and wcrtomb(3).
2002-11-10 11:14:58 +00:00
tjr
68886a9d65
Don't check whether the first byte of the buffer is a null byte when
...
the buffer has zero length (n == 0).
2002-11-10 10:49:14 +00:00
tjr
5401930441
Describe the n' and
ps' arguments to mbrlen().
2002-11-09 10:21:01 +00:00
tjr
266f7b288a
Typo: pointer to -> pointed to
2002-11-09 09:47:06 +00:00
tjr
6eb74185cd
Use wide character ctype functions directly instead of relying on
...
4.4BSD extensions to the single-byte ctype functions.
2002-11-09 05:19:08 +00:00
tjr
cbcd393990
Add a missing return statement for the pwcs == NULL case (XSI extension).
2002-11-09 04:13:26 +00:00
tjr
f84979c549
Add two additional references to the See Also section, which contain much
...
better descriptions of UTF-8 and related issues.
2002-10-30 11:49:05 +00:00
tjr
3c0cce1566
Remove unnecessary inclusion of <rune.h> to make it obvious that this file
...
does not use the deprecated rune system.
2002-10-29 09:03:57 +00:00
tjr
61b6263e81
Handle boundary cases more correctly; mblen(s, 0) and mbtowc(NULL, s, 0)
...
return -1 regardless of what s points to, mbtowc(&w, s, 1) sets w to a
null wide character when s points to a null byte. This seems to be closer
to what most other implementations do, but the C99 standard contradicts
itself for these cases.
2002-10-28 08:24:46 +00:00
wollman
f8a79b86e6
Do not include <sys/syslimits.h> directly; it is not intended for general
...
consumption.
2002-10-27 17:44:33 +00:00
tjr
dd9e331ae2
Style sweep.
2002-10-27 10:41:21 +00:00
tjr
035cd9e947
Use an internal buffer for the result when the first argument is NULL.
2002-10-25 13:24:45 +00:00
tjr
ccd9275d4e
Avoid truncating invalid wide characters that are outside the range of
...
'unsigned char'; signal an error instead.
2002-10-16 11:37:38 +00:00
tjr
bfd4cfc4dc
FA, FB and FC are lead bytes according to recent Microsoft documentation.
2002-10-14 01:50:45 +00:00
tjr
061d1d394f
Style changes. Mainly removing excessive whitespace and parens.
2002-10-14 01:46:18 +00:00
ache
6ee6cab0af
Cosmetic: use LCMONETARY_SIZE_{FULL,MIN} defines like in other places
2002-10-12 11:31:07 +00:00
tjr
d62abf19a3
Add a UTF-8 encoding method, which will eventually replace the antique
...
"UTF2" method. Although UTF-8 and the old UTF2 encoding are compatible
for 16-bit characters, the new UTF-8 implementation is much more strict
about rejecting malformed input and also handles the full 31 bit range
of characters.
2002-10-10 22:56:18 +00:00
tjr
c112e4d2cb
Add support for the 6 new C99 struct lconv members dealing with formatting
...
international monetary values: int_p_cs_precedes, int_n_cs_precedes,
int_p_sep_by_space, int_n_sep_by_space, int_p_sign_posn, int_n_sign_posn.
This should not break existing binaries or LC_MONETARY data files.
Reviewed by: ache
MFC after: 1 month
2002-10-09 09:19:28 +00:00
tjr
b5f0d0d8f2
Add a note to the Compatiblity section suggesting that these functions
...
only be used for byte values. Add cross-references to the wide-char
counterparts.
2002-10-06 10:15:38 +00:00
tjr
9e7f867aa7
Remove rants/whines about the rune interface being superior to the
...
ISO C interface.
2002-10-06 06:03:23 +00:00
tjr
b3e1209c7a
Remove a completely incorrect statement from the Return Values section.
...
Add cross-references to the restartable mulitybte functions (mbrlen(3) etc.)
2002-10-06 05:58:24 +00:00
tjr
064f96637b
Improve three instances of questionable or confusing grammar.
2002-10-03 14:09:06 +00:00
tjr
89d813cf15
Add an example.
2002-10-03 14:07:26 +00:00
tjr
e3f15214bf
Document towlower() and towupper() in separate manual pages instead of
...
trying to confusingly document both on the same page. The new manual pages
are based on tolower(3) and toupper(3) instead of the old towlower(3).
2002-10-03 11:23:06 +00:00
tjr
b9c5c09473
Point out that although toupper() and tolower() really accept rune_t's
...
and not just unsigned char's, callers should use towupper() and towlower()
instead when working with wide characters if portability is a concern.
2002-10-03 11:14:00 +00:00
tjr
915a8cf342
towlower() appeared twice in the synopsis; one of the occurrences should
...
have been towupper(). Add towupper() to the Name section while I'm at it.
Obtained from: NetBSD (junyoung)
2002-10-03 10:40:01 +00:00
tjr
f18ee8bb40
Add an Examples section with an example of how to use the functions.
2002-10-03 08:49:29 +00:00
tjr
2f81b61678
Warn when setinvalidrune() is referenced for consistency with the rest
...
of the rune functions (except sgetrune() and sputrune(), which are really
macros).
2002-09-24 09:25:37 +00:00
tjr
491569a0a7
Add the remaining C99 wide character string to integer conversion functions.
...
Restrict qualifiers were added to the existing prototypes in <inttypes.h>
and the typedef for wchar_t was removed.
2002-09-22 08:06:45 +00:00
tjr
397f4349cf
Deprecate the rest of the rune interface.
2002-09-18 06:19:12 +00:00
tjr
7eb8c7cf9a
Mark mbmb(), mbrune(), and mbrrune() as deprecated functions. We want to
...
get applications to move to the ISO C interfaces as well as have the
freedom to replace the rune interfaces with ones that support stateful
conversions some time in the future.
2002-09-18 06:11:21 +00:00
tjr
8569d04e14
Add wcstod() as a wrapper around strtod(). It does not handle any characters
...
that strtod() does not (alternate digit characters, etc. are not handled).
2002-09-15 08:38:51 +00:00
tjr
b2a34e6f87
Use the heap instead of the stack to store temporary multibyte string
...
buffers; this is slower but safer for threaded programs where threads
often have relatively low stack size limits.
2002-09-15 08:06:17 +00:00
tjr
4448ddb047
Correct type of second argument: it is wchar_t ** restrict,
...
not wchar_t * restrict.
2002-09-12 09:25:27 +00:00
tjr
5f5cd9d0b8
Add an implementation of wcsftime() (wide character version of strftime()).
2002-09-11 08:57:11 +00:00
tjr
7c848d9cfd
Add wcstol() and wcstoul(), based on strtol() and strtoul().
2002-09-08 13:27:26 +00:00
tjr
cd5ca96599
Style: One space between "restrict" qualifier and "*".
2002-09-06 11:24:06 +00:00
tjr
573a3e8e5e
Set errno to EILSEQ when invalid multibyte sequences are detected
...
(XSI extension to 1003.1-2001).
2002-09-03 01:09:47 +00:00
tjr
3c7d05d837
Typo: refer to MB_LEN_MAX instead of MB_CHAR_MAX (which does not exist).
2002-09-01 07:21:58 +00:00
tjr
2e5584e864
Add restrict qualifiers to the arguments of mbstowcs, mbtowc() and
...
wcstombs().
2002-09-01 07:08:22 +00:00
tjr
ca719015df
Implement the XSI extension which allows the destination string to be
...
NULL, and returns the number of bytes that would be required to store
the result of the conversion without storing anything.
PR: 17694
2002-08-31 14:16:12 +00:00
tjr
4a4fda0f86
Split ansi.c into a separate source file for each function.
2002-08-31 11:26:55 +00:00
ache
323528b137
Use ntohl() to read cnains number in new format
2002-08-31 01:05:39 +00:00
ache
cc37572108
Style fix
2002-08-30 20:39:53 +00:00
ache
1286c989d6
Prepare for switching to unlimited chains format.
...
Optimize chains lookup a bit.
2002-08-30 20:26:02 +00:00