]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - crypto/heimdal/doc/doxyout/wind/man/man3/wind.3
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / crypto / heimdal / doc / doxyout / wind / man / man3 / wind.3
1 .TH "Heimdal wind library" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalwindlibrary" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 Heimdal wind library \- 
6 .SS "Functions"
7
8 .in +1c
9 .ti -1c
10 .RI "int \fBwind_punycode_label_toascii\fP (const uint32_t *in, size_t in_len, char *out, size_t *out_len)"
11 .br
12 .ti -1c
13 .RI "int \fBwind_stringprep\fP (const uint32_t *in, size_t in_len, uint32_t *out, size_t *out_len, wind_profile_flags flags)"
14 .br
15 .ti -1c
16 .RI "int \fBwind_profile\fP (const char *name, wind_profile_flags *flags)"
17 .br
18 .ti -1c
19 .RI "int \fBwind_utf8ucs4\fP (const char *in, uint32_t *out, size_t *out_len)"
20 .br
21 .ti -1c
22 .RI "int \fBwind_utf8ucs4_length\fP (const char *in, size_t *out_len)"
23 .br
24 .ti -1c
25 .RI "int \fBwind_ucs4utf8\fP (const uint32_t *in, size_t in_len, char *out, size_t *out_len)"
26 .br
27 .ti -1c
28 .RI "int \fBwind_ucs4utf8_length\fP (const uint32_t *in, size_t in_len, size_t *out_len)"
29 .br
30 .ti -1c
31 .RI "int \fBwind_ucs2read\fP (const void *ptr, size_t len, unsigned int *flags, uint16_t *out, size_t *out_len)"
32 .br
33 .ti -1c
34 .RI "int \fBwind_ucs2write\fP (const uint16_t *in, size_t in_len, unsigned int *flags, void *ptr, size_t *out_len)"
35 .br
36 .ti -1c
37 .RI "int \fBwind_utf8ucs2\fP (const char *in, uint16_t *out, size_t *out_len)"
38 .br
39 .ti -1c
40 .RI "int \fBwind_utf8ucs2_length\fP (const char *in, size_t *out_len)"
41 .br
42 .ti -1c
43 .RI "int \fBwind_ucs2utf8\fP (const uint16_t *in, size_t in_len, char *out, size_t *out_len)"
44 .br
45 .ti -1c
46 .RI "int \fBwind_ucs2utf8_length\fP (const uint16_t *in, size_t in_len, size_t *out_len)"
47 .br
48 .in -1c
49 .SH "Detailed Description"
50 .PP 
51
52 .SH "Function Documentation"
53 .PP 
54 .SS "int wind_profile (const char * name, wind_profile_flags * flags)"
55 .PP
56 Try to find the profile given a name.
57 .PP
58 \fBParameters:\fP
59 .RS 4
60 \fIname\fP name of the profile. 
61 .br
62 \fIflags\fP the resulting profile.
63 .RE
64 .PP
65 \fBReturns:\fP
66 .RS 4
67 returns 0 on success, an wind error code otherwise 
68 .RE
69 .PP
70
71 .SS "int wind_punycode_label_toascii (const uint32_t * in, size_t in_len, char * out, size_t * out_len)"
72 .PP
73 Convert an UCS4 string to a puny-coded DNS label string suitable when combined with delimiters and other labels for DNS lookup.
74 .PP
75 \fBParameters:\fP
76 .RS 4
77 \fIin\fP an UCS4 string to convert 
78 .br
79 \fIin_len\fP the length of in. 
80 .br
81 \fIout\fP the resulting puny-coded string. The string is not NUL terminatied. 
82 .br
83 \fIout_len\fP before processing out_len should be the length of the out variable, after processing it will be the length of the out string.
84 .RE
85 .PP
86 \fBReturns:\fP
87 .RS 4
88 returns 0 on success, an wind error code otherwise 
89 .RE
90 .PP
91
92 .SS "int wind_stringprep (const uint32_t * in, size_t in_len, uint32_t * out, size_t * out_len, wind_profile_flags flags)"
93 .PP
94 Process a input UCS4 string according a string-prep profile.
95 .PP
96 \fBParameters:\fP
97 .RS 4
98 \fIin\fP input UCS4 string to process 
99 .br
100 \fIin_len\fP length of the input string 
101 .br
102 \fIout\fP output UCS4 string 
103 .br
104 \fIout_len\fP length of the output string. 
105 .br
106 \fIflags\fP stringprep profile.
107 .RE
108 .PP
109 \fBReturns:\fP
110 .RS 4
111 returns 0 on success, an wind error code otherwise 
112 .RE
113 .PP
114
115 .SS "int wind_ucs2read (const void * ptr, size_t len, unsigned int * flags, uint16_t * out, size_t * out_len)"
116 .PP
117 Read in an UCS2 from a buffer.
118 .PP
119 \fBParameters:\fP
120 .RS 4
121 \fIptr\fP The input buffer to read from. 
122 .br
123 \fIlen\fP the length of the input buffer. 
124 .br
125 \fIflags\fP Flags to control the behavior of the function. 
126 .br
127 \fIout\fP the output UCS2, the array must be at least out/2 long. 
128 .br
129 \fIout_len\fP the output length
130 .RE
131 .PP
132 \fBReturns:\fP
133 .RS 4
134 returns 0 on success, an wind error code otherwise. 
135 .RE
136 .PP
137
138 .PP
139 if len is zero, flags are unchanged
140 .PP
141 if len is odd, WIND_ERR_LENGTH_NOT_MOD2 is returned
142 .PP
143 If the flags WIND_RW_BOM is set, check for BOM. If not BOM is found, check is LE/BE flag is already and use that otherwise fail with WIND_ERR_NO_BOM. When done, clear WIND_RW_BOM and the LE/BE flag and set the resulting LE/BE flag. 
144 .SS "int wind_ucs2utf8 (const uint16_t * in, size_t in_len, char * out, size_t * out_len)"
145 .PP
146 Convert an UCS2 string to a UTF-8 string.
147 .PP
148 \fBParameters:\fP
149 .RS 4
150 \fIin\fP an UCS2 string to convert. 
151 .br
152 \fIin_len\fP the length of the in UCS2 string. 
153 .br
154 \fIout\fP the resulting UTF-8 strint, must be at least \fBwind_ucs2utf8_length()\fP long. If out is NULL, the function will calculate the needed space for the out variable (just like \fBwind_ucs2utf8_length()\fP). 
155 .br
156 \fIout_len\fP before processing out_len should be the length of the out variable, after processing it will be the length of the out string.
157 .RE
158 .PP
159 \fBReturns:\fP
160 .RS 4
161 returns 0 on success, an wind error code otherwise 
162 .RE
163 .PP
164
165 .SS "int wind_ucs2utf8_length (const uint16_t * in, size_t in_len, size_t * out_len)"
166 .PP
167 Calculate the length of from converting a UCS2 string to an UTF-8 string.
168 .PP
169 \fBParameters:\fP
170 .RS 4
171 \fIin\fP an UCS2 string to convert. 
172 .br
173 \fIin_len\fP an UCS2 string length to convert. 
174 .br
175 \fIout_len\fP the length of the resulting UTF-8 string.
176 .RE
177 .PP
178 \fBReturns:\fP
179 .RS 4
180 returns 0 on success, an wind error code otherwise 
181 .RE
182 .PP
183
184 .SS "int wind_ucs2write (const uint16_t * in, size_t in_len, unsigned int * flags, void * ptr, size_t * out_len)"
185 .PP
186 Write an UCS2 string to a buffer.
187 .PP
188 \fBParameters:\fP
189 .RS 4
190 \fIin\fP The input UCS2 string. 
191 .br
192 \fIin_len\fP the length of the input buffer. 
193 .br
194 \fIflags\fP Flags to control the behavior of the function. 
195 .br
196 \fIptr\fP The input buffer to write to, the array must be at least (in + 1) * 2 bytes long. 
197 .br
198 \fIout_len\fP the output length
199 .RE
200 .PP
201 \fBReturns:\fP
202 .RS 4
203 returns 0 on success, an wind error code otherwise. 
204 .RE
205 .PP
206
207 .PP
208 If in buffer is not of length be mod 2, WIND_ERR_LENGTH_NOT_MOD2 is returned
209 .PP
210 On zero input length, flags are preserved
211 .PP
212 If flags have WIND_RW_BOM set, the byte order mark is written first to the output data
213 .PP
214 If the output wont fit into out_len, WIND_ERR_OVERRUN is returned 
215 .SS "int wind_ucs4utf8 (const uint32_t * in, size_t in_len, char * out, size_t * out_len)"
216 .PP
217 Convert an UCS4 string to a UTF-8 string.
218 .PP
219 \fBParameters:\fP
220 .RS 4
221 \fIin\fP an UCS4 string to convert. 
222 .br
223 \fIin_len\fP the length input array.
224 .br
225 \fIout\fP the resulting UTF-8 strint, must be at least \fBwind_ucs4utf8_length()\fP + 1 long (the extra char for the NUL). If out is NULL, the function will calculate the needed space for the out variable (just like \fBwind_ucs4utf8_length()\fP).
226 .br
227 \fIout_len\fP before processing out_len should be the length of the out variable, after processing it will be the length of the out string.
228 .RE
229 .PP
230 \fBReturns:\fP
231 .RS 4
232 returns 0 on success, an wind error code otherwise 
233 .RE
234 .PP
235
236 .SS "int wind_ucs4utf8_length (const uint32_t * in, size_t in_len, size_t * out_len)"
237 .PP
238 Calculate the length of from converting a UCS4 string to an UTF-8 string.
239 .PP
240 \fBParameters:\fP
241 .RS 4
242 \fIin\fP an UCS4 string to convert. 
243 .br
244 \fIin_len\fP the length of UCS4 string to convert. 
245 .br
246 \fIout_len\fP the length of the resulting UTF-8 string.
247 .RE
248 .PP
249 \fBReturns:\fP
250 .RS 4
251 returns 0 on success, an wind error code otherwise 
252 .RE
253 .PP
254
255 .SS "int wind_utf8ucs2 (const char * in, uint16_t * out, size_t * out_len)"
256 .PP
257 Convert an UTF-8 string to an UCS2 string.
258 .PP
259 \fBParameters:\fP
260 .RS 4
261 \fIin\fP an UTF-8 string to convert. 
262 .br
263 \fIout\fP the resulting UCS2 strint, must be at least \fBwind_utf8ucs2_length()\fP long. If out is NULL, the function will calculate the needed space for the out variable (just like \fBwind_utf8ucs2_length()\fP). 
264 .br
265 \fIout_len\fP before processing out_len should be the length of the out variable, after processing it will be the length of the out string.
266 .RE
267 .PP
268 \fBReturns:\fP
269 .RS 4
270 returns 0 on success, an wind error code otherwise 
271 .RE
272 .PP
273
274 .SS "int wind_utf8ucs2_length (const char * in, size_t * out_len)"
275 .PP
276 Calculate the length of from converting a UTF-8 string to a UCS2 string.
277 .PP
278 \fBParameters:\fP
279 .RS 4
280 \fIin\fP an UTF-8 string to convert. 
281 .br
282 \fIout_len\fP the length of the resulting UCS4 string.
283 .RE
284 .PP
285 \fBReturns:\fP
286 .RS 4
287 returns 0 on success, an wind error code otherwise 
288 .RE
289 .PP
290
291 .SS "int wind_utf8ucs4 (const char * in, uint32_t * out, size_t * out_len)"
292 .PP
293 Convert an UTF-8 string to an UCS4 string.
294 .PP
295 \fBParameters:\fP
296 .RS 4
297 \fIin\fP an UTF-8 string to convert. 
298 .br
299 \fIout\fP the resulting UCS4 strint, must be at least \fBwind_utf8ucs4_length()\fP long. If out is NULL, the function will calculate the needed space for the out variable (just like \fBwind_utf8ucs4_length()\fP). 
300 .br
301 \fIout_len\fP before processing out_len should be the length of the out variable, after processing it will be the length of the out string.
302 .RE
303 .PP
304 \fBReturns:\fP
305 .RS 4
306 returns 0 on success, an wind error code otherwise 
307 .RE
308 .PP
309
310 .SS "int wind_utf8ucs4_length (const char * in, size_t * out_len)"
311 .PP
312 Calculate the length of from converting a UTF-8 string to a UCS4 string.
313 .PP
314 \fBParameters:\fP
315 .RS 4
316 \fIin\fP an UTF-8 string to convert. 
317 .br
318 \fIout_len\fP the length of the resulting UCS4 string.
319 .RE
320 .PP
321 \fBReturns:\fP
322 .RS 4
323 returns 0 on success, an wind error code otherwise 
324 .RE
325 .PP
326