version 4, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
WCTOMB |
|
|
2 |
!!!WCTOMB |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
RETURN VALUE |
|
|
7 |
CONFORMING TO |
|
|
8 |
SEE ALSO |
|
|
9 |
NOTES |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
wctomb - convert a wide character to a multibyte sequence |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__#include |
|
|
19 |
__''s''__, wchar_t__ ''wc''__); |
|
|
20 |
__ |
|
|
21 |
!!DESCRIPTION |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
If ''s'' is not NULL, the __wctomb__ function converts |
|
|
25 |
the wide character ''wc'' to its multibyte representation |
|
|
26 |
and stores it at the beginning of the character array |
|
|
27 |
pointed to by ''s''. It updates the shift state, which is |
|
|
28 |
stored in a static anonymous variable only known to the |
|
|
29 |
wctomb function, and returns the length of said multibyte |
|
|
30 |
representation, i.e. the number of bytes written at |
|
|
31 |
''s''. |
|
|
32 |
|
|
|
33 |
|
|
|
34 |
The programmer must ensure that there is room for at least |
|
|
35 |
__MB_CUR_MAX__ bytes at ''s''. |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
If ''s'' is NULL, the __wctomb__ function resets the |
|
|
39 |
shift state, only known to this function, to the initial |
|
|
40 |
state, and returns non-zero if the encoding has non-trivial |
|
|
41 |
shift state, or zero if the encoding is |
|
|
42 |
stateless. |
|
|
43 |
!!RETURN VALUE |
|
|
44 |
|
|
|
45 |
|
|
|
46 |
If ''s'' is not NULL, the __wctomb__ function returns |
|
|
47 |
the number of bytes that have been written to the byte array |
|
|
48 |
at ''s''. If ''wc'' can not be represented as a |
|
|
49 |
multibyte sequence (according to the current locale), -1 is |
|
|
50 |
returned. |
|
|
51 |
|
|
|
52 |
|
|
|
53 |
If ''s'' is NULL, the __wctomb__ function returns |
|
|
54 |
non-zero if the encoding has non-trivial shift state, or |
|
|
55 |
zero if the encoding is stateless. |
|
|
56 |
!!CONFORMING TO |
|
|
57 |
|
|
|
58 |
|
|
|
59 |
ISO/ANSI C, UNIX98 |
|
|
60 |
!!SEE ALSO |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
wcrtomb(3), wcstombs(3), |
4 |
perry |
64 |
MB_CUR_MAX(3) |
1 |
perry |
65 |
!!NOTES |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
The behaviour of __wctomb__ depends on the LC_CTYPE |
|
|
69 |
category of the current locale. |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
This function is not multi-thread safe. The function |
|
|
73 |
__wcrtomb__ provides a better interface to the same |
|
|
74 |
functionality. |
|
|
75 |
---- |