1 '\" te
2 .\"
3 .\" This file and its contents are supplied under the terms of the
4 .\" Common Development and Distribution License ("CDDL"), version 1.0.
5 .\" You may only use this file in accordance with the terms of version
6 .\" 1.0 of the CDDL.
7 .\"
8 .\" A full copy of the text of the CDDL should have accompanied this
9 .\" source. A copy of the CDDL is also available via the Internet at
10 .\" http://www.illumos.org/license/CDDL.
11 .\"
12 .\"
13 .\" Copyright (c) 2014 Joyent, Inc. All rights reserved.
14 .\"
15 .TH WCTRANS 3C "Jun 11, 2014"
16
17 .SH NAME
18
19 towctrans, towctrans_l, wctrans, wctrans_l \- define and perform transliteration mappings
20
21 .SH SYNOPSIS
22
23 .LP
24 .nf
25 #include <wctype.h>
26
27 .BI "wint_t towctrans(wint_t " wc ", wctrans_t " desc );
28 .BI "wint_t towctrans_l(wint_t " wc ", wctrans_t " desc ", locale_t " loc );
29
30 .BI "wctrans_t wctrans(const char *" class );
31 .BI "wctrans_t wctrans_l(const char *" class, " locale_t " loc );
32
33 .SH DESCRIPTION
34
35 The function
36 .B wctrans
37 is used to obtain a handle to a mapping table that maps one set of wide
38 characters to another. It returns an object of type
39 .I wctrans_t
40 which can be used with the functions
41 .B towctrans()
42 and
43 .BR towctrans_l() .
44 The valid set of classes that are available depends on the locale.
45 Regardless of what locale is being used, the following names are always
46 valid:
47
48 .na
49 .in +2
50 .I tolower
51 .in -2
52 .fi
53
54 .na
55 .in +2
56 .I toupper
57 .in -2
58 .fi
59 .sp
60 .LP
61 The
62 .B towctrans()
63 function converts the wide character
64 .IR wc
65 based on the conversion table
66 specified by
67 .IR desc .
68
69
70 .LP
71 The functions
72 .B towctrans_l
73 and
74 .B wctrans_l
75 are equivalent to the functions
76 .B towctrans
77 and
78 .BR wctrans ,
79 but instead of operating in the current environemnt, they operate on the
80 environment specified by
81 .IR loc .
82
83 .SH RETURN VALUES
84
85 On successful completion,
86 .B towctrans()
87 and
88 .B towctrans_l()
89 functions return the character that corresponds to the argument passed
90 through the mapping table described by
91 .IR desc .
92 Otherwise, it returns the character unchanged and sets
93 .BR errno .
94
95 On successful completion,
96 .B wctrans()
97 and
98 .B wctrans_l()
99 functions return a non-zero identifier for
100 .IR class .
101 On failure, they return zero and set
102 .BR errno .
103
104
105 .SH ERRORS
106 .LP
107 The
108 .B wctrans()
109 and
110 .B wctrans_l()
111 functions will fail if:
112 .sp
113 .ne 2
114 .na
115 .B EINAVL
116 .ad
117 .RS 10n
118 The mapping class specified by
119 .I class
120 does not exist or is invalid.
121 .RE
122
123 .LP
124 The
125 .B towctrans()
126 and
127 .B towctrans_l()
128 functions will fail if:
129 .sp
130 .ne 2
131 .na
132 .B EINAVL
133 .ad
134 .RS 10n
135 The mapping class specified by
136 .I desc
137 is invalid.
138 .RE
139
140 .SH ATTRIBUTES
141 .sp
142 .TS
143 box;
144 c | c
145 l | l .
146 ATTRIBUTE TYPE ATTRIBUTE VALUE
147 _
148 Interface Stability Standard
149 _
150 MT-Level Safe, with exceptions
151 .TE
152
153 .SH SEE ALSO
154 .BR duplocale (3C),
155 .BR newlocale (3C),
156 .BR setlocale (3C),
157 .BR towlower (3C),
158 .BR towupper (3C),
159 .BR environ (5),
160 .BR locale (5)
161
162 .SH NOTES
163
164 The functions
165 .B towctrans()
166 and
167 .B wctrans()
168 are thread-safe as long as
169 the thread is emplying a per-thread locale as set per
170 .B uselocale(3C)
171 or
172 .B setlocale(3C)
173 is not called by another thread while these functions are running.
174 Both
175 .B towctrans_l()
176 and
177 .B wctrans_l()
178 are MT-safe.
|
1 '\" te
2 .\"
3 .\" This file and its contents are supplied under the terms of the
4 .\" Common Development and Distribution License ("CDDL"), version 1.0.
5 .\" You may only use this file in accordance with the terms of version
6 .\" 1.0 of the CDDL.
7 .\"
8 .\" A full copy of the text of the CDDL should have accompanied this
9 .\" source. A copy of the CDDL is also available via the Internet at
10 .\" http://www.illumos.org/license/CDDL.
11 .\"
12 .\"
13 .\" Copyright (c) 2014 Joyent, Inc. All rights reserved.
14 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
15 .\"
16 .TH WCTRANS 3C "Jun 25, 2014"
17
18 .SH NAME
19 towctrans, towctrans_l, wctrans, wctrans_l \- define and perform transliteration mappings
20 .SH SYNOPSIS
21 .LP
22 .nf
23 #include <wctype.h>
24
25 \fBwint_t\fR \fBtowctrans\fR(\fBwint_t\fR \fIwc\fR, \fBwctrans_t\fR \fIdesc\fR);
26 .fi
27 .LP
28 .nf
29 \fBwint_t\fR \fBtowctrans_l\fR(\fBwint_t\fR \fIwc\fR, \fBwctrans_t\fR \fIdesc\fR, \fBlocale_t\fR \fIloc\fR);
30 .fi
31 .LP
32 .nf
33 \fBwctrans_t\fR \fBwctrans\fR(\fBconst char *\fR \fItranclass\fR);
34 .fi
35 .LP
36 .nf
37 \fBwctrans_t\fR \fBwctrans_l\fR(\fBconst char *\fR \fItranclass\fR, \fBlocale_t\fR \fIloc\fR);
38 .fi
39 .SH DESCRIPTION
40 .LP
41 The functions
42 .B wctrans()
43 and
44 .B wctrans_l()
45 are used to obtain a handle to a table that maps one set of wide
46 characters to another. They return an object of type
47 .I wctrans_t
48 which can be used with the functions
49 .B towctrans()
50 and
51 .BR towctrans_l() .
52 The valid set of classes that are available depends on the locale.
53 The following names are valid in all locales:
54 .TP
55 "tolower"
56 Conversion from upper case to lower case characters.
57 .TP
58 "toupper"
59 Conversion from lower case to upper case characters.
60 .LP
61 The
62 .B towctrans()
63 and
64 .B towctrans_l()
65 functions convert the wide character
66 .IR wc
67 based on the conversion table specified by
68 .IR desc .
69 .LP
70 The functions
71 .B towctrans_l()
72 and
73 .B wctrans_l()
74 are equivalent to the functions
75 .B towctrans()
76 and
77 .BR wctrans() ,
78 but instead of operating in the current locale, they operate on the
79 locale specified by
80 .IR loc .
81 .SH RETURN VALUES
82 On successful completion,
83 .B towctrans()
84 and
85 .B towctrans_l()
86 functions return the character that corresponds to the argument passed
87 through the mapping table described by
88 .IR desc .
89 Otherwise, they return the character unchanged and set
90 .BR errno .
91 On successful completion,
92 .B wctrans()
93 and
94 .B wctrans_l()
95 functions return a non-zero identifier for
96 .IR tranclass .
97 On failure, they return zero and set
98 .BR errno .
99 .SH ERRORS
100 .LP
101 The
102 .B wctrans()
103 and
104 .B wctrans_l()
105 functions will fail if:
106 .TP
107 .B EINVAL
108 The mapping class specified by
109 .I tranclass
110 does not exist or is invalid.
111 .LP
112 The
113 .B towctrans()
114 and
115 .B towctrans_l()
116 functions will fail if:
117 .TP
118 .B EINVAL
119 The mapping class specified by
120 .I desc
121 is invalid.
122 .SH ATTRIBUTES
123 .TS
124 box;
125 c | c
126 l | l .
127 ATTRIBUTE TYPE ATTRIBUTE VALUE
128 _
129 Interface Stability Standard
130 _
131 MT-Level MT-Safe
132 .TE
133
134 .SH SEE ALSO
135 .BR newlocale (3C),
136 .BR setlocale (3C),
137 .BR towlower (3C),
138 .BR towupper (3C),
139 .BR environ (5),
140 .BR locale (5)
|