1 | /* $Id: fsw_strfunc.h 29125 2010-05-06 09:43:05Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * fsw_strfunc.h
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | /* fsw_strfunc.h generated by mk_fsw_strfunc.py */
|
---|
19 |
|
---|
20 | static int fsw_streq_ISO88591_UTF8(void *s1data, void *s2data, int len)
|
---|
21 | {
|
---|
22 | int i;
|
---|
23 | fsw_u8 *p1 = (fsw_u8 *)s1data;
|
---|
24 | fsw_u8 *p2 = (fsw_u8 *)s2data;
|
---|
25 | fsw_u32 c1, c2;
|
---|
26 |
|
---|
27 | for (i = 0; i < len; i++) {
|
---|
28 | c1 = *p1++;
|
---|
29 | c2 = *p2++;
|
---|
30 | if ((c2 & 0xe0) == 0xc0) {
|
---|
31 | c2 = ((c2 & 0x1f) << 6) | (*p2++ & 0x3f);
|
---|
32 | } else if ((c2 & 0xf0) == 0xe0) {
|
---|
33 | c2 = ((c2 & 0x0f) << 12) | ((*p2++ & 0x3f) << 6);
|
---|
34 | c2 |= (*p2++ & 0x3f);
|
---|
35 | } else if ((c2 & 0xf8) == 0xf0) {
|
---|
36 | c2 = ((c2 & 0x07) << 18) | ((*p2++ & 0x3f) << 12);
|
---|
37 | c2 |= ((*p2++ & 0x3f) << 6);
|
---|
38 | c2 |= (*p2++ & 0x3f);
|
---|
39 | }
|
---|
40 | if (c1 != c2)
|
---|
41 | return 0;
|
---|
42 | }
|
---|
43 | return 1;
|
---|
44 | }
|
---|
45 |
|
---|
46 | #ifndef HOST_EFI
|
---|
47 | static int fsw_streq_ISO88591_UTF16(void *s1data, void *s2data, int len)
|
---|
48 | {
|
---|
49 | int i;
|
---|
50 | fsw_u8 *p1 = (fsw_u8 *)s1data;
|
---|
51 | fsw_u16 *p2 = (fsw_u16 *)s2data;
|
---|
52 | fsw_u32 c1, c2;
|
---|
53 |
|
---|
54 | for (i = 0; i < len; i++) {
|
---|
55 | c1 = *p1++;
|
---|
56 | c2 = *p2++;
|
---|
57 | if (c1 != c2)
|
---|
58 | return 0;
|
---|
59 | }
|
---|
60 | return 1;
|
---|
61 | }
|
---|
62 | #endif
|
---|
63 |
|
---|
64 | static int fsw_streq_ISO88591_UTF16_SWAPPED(void *s1data, void *s2data, int len)
|
---|
65 | {
|
---|
66 | int i;
|
---|
67 | fsw_u8 *p1 = (fsw_u8 *)s1data;
|
---|
68 | fsw_u16 *p2 = (fsw_u16 *)s2data;
|
---|
69 | fsw_u32 c1, c2;
|
---|
70 |
|
---|
71 | for (i = 0; i < len; i++) {
|
---|
72 | c1 = *p1++;
|
---|
73 | c2 = *p2++; c2 = FSW_SWAPVALUE_U16(c2);
|
---|
74 | if (c1 != c2)
|
---|
75 | return 0;
|
---|
76 | }
|
---|
77 | return 1;
|
---|
78 | }
|
---|
79 |
|
---|
80 | static int fsw_streq_UTF8_UTF16(void *s1data, void *s2data, int len)
|
---|
81 | {
|
---|
82 | int i;
|
---|
83 | fsw_u8 *p1 = (fsw_u8 *)s1data;
|
---|
84 | fsw_u16 *p2 = (fsw_u16 *)s2data;
|
---|
85 | fsw_u32 c1, c2;
|
---|
86 |
|
---|
87 | for (i = 0; i < len; i++) {
|
---|
88 | c1 = *p1++;
|
---|
89 | if ((c1 & 0xe0) == 0xc0) {
|
---|
90 | c1 = ((c1 & 0x1f) << 6) | (*p1++ & 0x3f);
|
---|
91 | } else if ((c1 & 0xf0) == 0xe0) {
|
---|
92 | c1 = ((c1 & 0x0f) << 12) | ((*p1++ & 0x3f) << 6);
|
---|
93 | c1 |= (*p1++ & 0x3f);
|
---|
94 | } else if ((c1 & 0xf8) == 0xf0) {
|
---|
95 | c1 = ((c1 & 0x07) << 18) | ((*p1++ & 0x3f) << 12);
|
---|
96 | c1 |= ((*p1++ & 0x3f) << 6);
|
---|
97 | c1 |= (*p1++ & 0x3f);
|
---|
98 | }
|
---|
99 | c2 = *p2++;
|
---|
100 | if (c1 != c2)
|
---|
101 | return 0;
|
---|
102 | }
|
---|
103 | return 1;
|
---|
104 | }
|
---|
105 |
|
---|
106 | static int fsw_streq_UTF8_UTF16_SWAPPED(void *s1data, void *s2data, int len)
|
---|
107 | {
|
---|
108 | int i;
|
---|
109 | fsw_u8 *p1 = (fsw_u8 *)s1data;
|
---|
110 | fsw_u16 *p2 = (fsw_u16 *)s2data;
|
---|
111 | fsw_u32 c1, c2;
|
---|
112 |
|
---|
113 | for (i = 0; i < len; i++) {
|
---|
114 | c1 = *p1++;
|
---|
115 | if ((c1 & 0xe0) == 0xc0) {
|
---|
116 | c1 = ((c1 & 0x1f) << 6) | (*p1++ & 0x3f);
|
---|
117 | } else if ((c1 & 0xf0) == 0xe0) {
|
---|
118 | c1 = ((c1 & 0x0f) << 12) | ((*p1++ & 0x3f) << 6);
|
---|
119 | c1 |= (*p1++ & 0x3f);
|
---|
120 | } else if ((c1 & 0xf8) == 0xf0) {
|
---|
121 | c1 = ((c1 & 0x07) << 18) | ((*p1++ & 0x3f) << 12);
|
---|
122 | c1 |= ((*p1++ & 0x3f) << 6);
|
---|
123 | c1 |= (*p1++ & 0x3f);
|
---|
124 | }
|
---|
125 | c2 = *p2++; c2 = FSW_SWAPVALUE_U16(c2);
|
---|
126 | if (c1 != c2)
|
---|
127 | return 0;
|
---|
128 | }
|
---|
129 | return 1;
|
---|
130 | }
|
---|
131 |
|
---|
132 | static int fsw_streq_UTF16_UTF16_SWAPPED(void *s1data, void *s2data, int len)
|
---|
133 | {
|
---|
134 | int i;
|
---|
135 | fsw_u16 *p1 = (fsw_u16 *)s1data;
|
---|
136 | fsw_u16 *p2 = (fsw_u16 *)s2data;
|
---|
137 | fsw_u32 c1, c2;
|
---|
138 |
|
---|
139 | for (i = 0; i < len; i++) {
|
---|
140 | c1 = *p1++;
|
---|
141 | c2 = *p2++; c2 = FSW_SWAPVALUE_U16(c2);
|
---|
142 | if (c1 != c2)
|
---|
143 | return 0;
|
---|
144 | }
|
---|
145 | return 1;
|
---|
146 | }
|
---|
147 |
|
---|
148 | static fsw_status_t fsw_strcoerce_UTF8_ISO88591(void *srcdata, int srclen, struct fsw_string *dest)
|
---|
149 | {
|
---|
150 | fsw_status_t status;
|
---|
151 | int i;
|
---|
152 | fsw_u8 *sp;
|
---|
153 | fsw_u8 *dp;
|
---|
154 | fsw_u32 c;
|
---|
155 |
|
---|
156 | dest->type = FSW_STRING_TYPE_ISO88591;
|
---|
157 | dest->len = srclen;
|
---|
158 | dest->size = srclen * sizeof(fsw_u8);
|
---|
159 | status = fsw_alloc(dest->size, &dest->data);
|
---|
160 | if (status)
|
---|
161 | return status;
|
---|
162 |
|
---|
163 | sp = (fsw_u8 *)srcdata;
|
---|
164 | dp = (fsw_u8 *)dest->data;
|
---|
165 | for (i = 0; i < srclen; i++) {
|
---|
166 | c = *sp++;
|
---|
167 | if ((c & 0xe0) == 0xc0) {
|
---|
168 | c = ((c & 0x1f) << 6) | (*sp++ & 0x3f);
|
---|
169 | } else if ((c & 0xf0) == 0xe0) {
|
---|
170 | c = ((c & 0x0f) << 12) | ((*sp++ & 0x3f) << 6);
|
---|
171 | c |= (*sp++ & 0x3f);
|
---|
172 | } else if ((c & 0xf8) == 0xf0) {
|
---|
173 | c = ((c & 0x07) << 18) | ((*sp++ & 0x3f) << 12);
|
---|
174 | c |= ((*sp++ & 0x3f) << 6);
|
---|
175 | c |= (*sp++ & 0x3f);
|
---|
176 | }
|
---|
177 | *dp++ = (fsw_u8)c;
|
---|
178 | }
|
---|
179 | return FSW_SUCCESS;
|
---|
180 | }
|
---|
181 |
|
---|
182 | static fsw_status_t fsw_strcoerce_UTF16_ISO88591(void *srcdata, int srclen, struct fsw_string *dest)
|
---|
183 | {
|
---|
184 | fsw_status_t status;
|
---|
185 | int i;
|
---|
186 | fsw_u16 *sp;
|
---|
187 | fsw_u8 *dp;
|
---|
188 | fsw_u32 c;
|
---|
189 |
|
---|
190 | dest->type = FSW_STRING_TYPE_ISO88591;
|
---|
191 | dest->len = srclen;
|
---|
192 | dest->size = srclen * sizeof(fsw_u8);
|
---|
193 | status = fsw_alloc(dest->size, &dest->data);
|
---|
194 | if (status)
|
---|
195 | return status;
|
---|
196 |
|
---|
197 | sp = (fsw_u16 *)srcdata;
|
---|
198 | dp = (fsw_u8 *)dest->data;
|
---|
199 | for (i = 0; i < srclen; i++) {
|
---|
200 | c = *sp++;
|
---|
201 | *dp++ = (fsw_u8)c;
|
---|
202 | }
|
---|
203 | return FSW_SUCCESS;
|
---|
204 | }
|
---|
205 |
|
---|
206 | static fsw_status_t fsw_strcoerce_UTF16_SWAPPED_ISO88591(void *srcdata, int srclen, struct fsw_string *dest)
|
---|
207 | {
|
---|
208 | fsw_status_t status;
|
---|
209 | int i;
|
---|
210 | fsw_u16 *sp;
|
---|
211 | fsw_u8 *dp;
|
---|
212 | fsw_u32 c;
|
---|
213 |
|
---|
214 | dest->type = FSW_STRING_TYPE_ISO88591;
|
---|
215 | dest->len = srclen;
|
---|
216 | dest->size = srclen * sizeof(fsw_u8);
|
---|
217 | status = fsw_alloc(dest->size, &dest->data);
|
---|
218 | if (status)
|
---|
219 | return status;
|
---|
220 |
|
---|
221 | sp = (fsw_u16 *)srcdata;
|
---|
222 | dp = (fsw_u8 *)dest->data;
|
---|
223 | for (i = 0; i < srclen; i++) {
|
---|
224 | c = *sp++; c = FSW_SWAPVALUE_U16(c);
|
---|
225 | *dp++ = (fsw_u8)c;
|
---|
226 | }
|
---|
227 | return FSW_SUCCESS;
|
---|
228 | }
|
---|
229 |
|
---|
230 | static fsw_status_t fsw_strcoerce_ISO88591_UTF16(void *srcdata, int srclen, struct fsw_string *dest)
|
---|
231 | {
|
---|
232 | fsw_status_t status;
|
---|
233 | int i;
|
---|
234 | fsw_u8 *sp;
|
---|
235 | fsw_u16 *dp;
|
---|
236 | fsw_u32 c;
|
---|
237 |
|
---|
238 | dest->type = FSW_STRING_TYPE_UTF16;
|
---|
239 | dest->len = srclen;
|
---|
240 | dest->size = srclen * sizeof(fsw_u16);
|
---|
241 | status = fsw_alloc(dest->size, &dest->data);
|
---|
242 | if (status)
|
---|
243 | return status;
|
---|
244 |
|
---|
245 | sp = (fsw_u8 *)srcdata;
|
---|
246 | dp = (fsw_u16 *)dest->data;
|
---|
247 | for (i = 0; i < srclen; i++) {
|
---|
248 | c = *sp++;
|
---|
249 | *dp++ = (fsw_u16)c;
|
---|
250 | }
|
---|
251 | return FSW_SUCCESS;
|
---|
252 | }
|
---|
253 |
|
---|
254 | static fsw_status_t fsw_strcoerce_UTF8_UTF16(void *srcdata, int srclen, struct fsw_string *dest)
|
---|
255 | {
|
---|
256 | fsw_status_t status;
|
---|
257 | int i;
|
---|
258 | fsw_u8 *sp;
|
---|
259 | fsw_u16 *dp;
|
---|
260 | fsw_u32 c;
|
---|
261 |
|
---|
262 | dest->type = FSW_STRING_TYPE_UTF16;
|
---|
263 | dest->len = srclen;
|
---|
264 | dest->size = srclen * sizeof(fsw_u16);
|
---|
265 | status = fsw_alloc(dest->size, &dest->data);
|
---|
266 | if (status)
|
---|
267 | return status;
|
---|
268 |
|
---|
269 | sp = (fsw_u8 *)srcdata;
|
---|
270 | dp = (fsw_u16 *)dest->data;
|
---|
271 | for (i = 0; i < srclen; i++) {
|
---|
272 | c = *sp++;
|
---|
273 | if ((c & 0xe0) == 0xc0) {
|
---|
274 | c = ((c & 0x1f) << 6) | (*sp++ & 0x3f);
|
---|
275 | } else if ((c & 0xf0) == 0xe0) {
|
---|
276 | c = ((c & 0x0f) << 12) | ((*sp++ & 0x3f) << 6);
|
---|
277 | c |= (*sp++ & 0x3f);
|
---|
278 | } else if ((c & 0xf8) == 0xf0) {
|
---|
279 | c = ((c & 0x07) << 18) | ((*sp++ & 0x3f) << 12);
|
---|
280 | c |= ((*sp++ & 0x3f) << 6);
|
---|
281 | c |= (*sp++ & 0x3f);
|
---|
282 | }
|
---|
283 | *dp++ = (fsw_u16)c;
|
---|
284 | }
|
---|
285 | return FSW_SUCCESS;
|
---|
286 | }
|
---|
287 |
|
---|
288 | static fsw_status_t fsw_strcoerce_UTF16_SWAPPED_UTF16(void *srcdata, int srclen, struct fsw_string *dest)
|
---|
289 | {
|
---|
290 | fsw_status_t status;
|
---|
291 | int i;
|
---|
292 | fsw_u16 *sp;
|
---|
293 | fsw_u16 *dp;
|
---|
294 | fsw_u32 c;
|
---|
295 |
|
---|
296 | dest->type = FSW_STRING_TYPE_UTF16;
|
---|
297 | dest->len = srclen;
|
---|
298 | dest->size = srclen * sizeof(fsw_u16);
|
---|
299 | status = fsw_alloc(dest->size, &dest->data);
|
---|
300 | if (status)
|
---|
301 | return status;
|
---|
302 |
|
---|
303 | sp = (fsw_u16 *)srcdata;
|
---|
304 | dp = (fsw_u16 *)dest->data;
|
---|
305 | for (i = 0; i < srclen; i++) {
|
---|
306 | c = *sp++; c = FSW_SWAPVALUE_U16(c);
|
---|
307 | *dp++ = (fsw_u16)c;
|
---|
308 | }
|
---|
309 | return FSW_SUCCESS;
|
---|
310 | }
|
---|
311 |
|
---|
312 | static fsw_status_t fsw_strcoerce_ISO88591_UTF8(void *srcdata, int srclen, struct fsw_string *dest)
|
---|
313 | {
|
---|
314 | fsw_status_t status;
|
---|
315 | int i, destsize;
|
---|
316 | fsw_u8 *sp;
|
---|
317 | fsw_u8 *dp;
|
---|
318 | fsw_u32 c;
|
---|
319 |
|
---|
320 | sp = (fsw_u8 *)srcdata;
|
---|
321 | destsize = 0;
|
---|
322 | for (i = 0; i < srclen; i++) {
|
---|
323 | c = *sp++;
|
---|
324 |
|
---|
325 | if (c < 0x000080)
|
---|
326 | destsize++;
|
---|
327 | else if (c < 0x000800)
|
---|
328 | destsize += 2;
|
---|
329 | else if (c < 0x010000)
|
---|
330 | destsize += 3;
|
---|
331 | else
|
---|
332 | destsize += 4;
|
---|
333 | }
|
---|
334 |
|
---|
335 | dest->type = FSW_STRING_TYPE_UTF8;
|
---|
336 | dest->len = srclen;
|
---|
337 | dest->size = destsize;
|
---|
338 | status = fsw_alloc(dest->size, &dest->data);
|
---|
339 | if (status)
|
---|
340 | return status;
|
---|
341 |
|
---|
342 | sp = (fsw_u8 *)srcdata;
|
---|
343 | dp = (fsw_u8 *)dest->data;
|
---|
344 | for (i = 0; i < srclen; i++) {
|
---|
345 | c = *sp++;
|
---|
346 |
|
---|
347 | if (c < 0x000080) {
|
---|
348 | *dp++ = (fsw_u8)c;
|
---|
349 | } else if (c < 0x000800) {
|
---|
350 | *dp++ = (fsw_u8)(0xc0 | ((c >> 6) & 0x1f));
|
---|
351 | *dp++ = (fsw_u8)(0x80 | (c & 0x3f));
|
---|
352 | } else if (c < 0x010000) {
|
---|
353 | *dp++ = (fsw_u8)(0xe0 | ((c >> 12) & 0x0f));
|
---|
354 | *dp++ = (fsw_u8)(0x80 | ((c >> 6) & 0x3f));
|
---|
355 | *dp++ = (fsw_u8)(0x80 | (c & 0x3f));
|
---|
356 | } else {
|
---|
357 | *dp++ = (fsw_u8)(0xf0 | ((c >> 18) & 0x07));
|
---|
358 | *dp++ = (fsw_u8)(0x80 | ((c >> 12) & 0x3f));
|
---|
359 | *dp++ = (fsw_u8)(0x80 | ((c >> 6) & 0x3f));
|
---|
360 | *dp++ = (fsw_u8)(0x80 | (c & 0x3f));
|
---|
361 | }
|
---|
362 | }
|
---|
363 | return FSW_SUCCESS;
|
---|
364 | }
|
---|
365 |
|
---|
366 | static fsw_status_t fsw_strcoerce_UTF16_UTF8(void *srcdata, int srclen, struct fsw_string *dest)
|
---|
367 | {
|
---|
368 | fsw_status_t status;
|
---|
369 | int i, destsize;
|
---|
370 | fsw_u16 *sp;
|
---|
371 | fsw_u8 *dp;
|
---|
372 | fsw_u32 c;
|
---|
373 |
|
---|
374 | sp = (fsw_u16 *)srcdata;
|
---|
375 | destsize = 0;
|
---|
376 | for (i = 0; i < srclen; i++) {
|
---|
377 | c = *sp++;
|
---|
378 |
|
---|
379 | if (c < 0x000080)
|
---|
380 | destsize++;
|
---|
381 | else if (c < 0x000800)
|
---|
382 | destsize += 2;
|
---|
383 | else if (c < 0x010000)
|
---|
384 | destsize += 3;
|
---|
385 | else
|
---|
386 | destsize += 4;
|
---|
387 | }
|
---|
388 |
|
---|
389 | dest->type = FSW_STRING_TYPE_UTF8;
|
---|
390 | dest->len = srclen;
|
---|
391 | dest->size = destsize;
|
---|
392 | status = fsw_alloc(dest->size, &dest->data);
|
---|
393 | if (status)
|
---|
394 | return status;
|
---|
395 |
|
---|
396 | sp = (fsw_u16 *)srcdata;
|
---|
397 | dp = (fsw_u8 *)dest->data;
|
---|
398 | for (i = 0; i < srclen; i++) {
|
---|
399 | c = *sp++;
|
---|
400 |
|
---|
401 | if (c < 0x000080) {
|
---|
402 | *dp++ = (fsw_u8)c;
|
---|
403 | } else if (c < 0x000800) {
|
---|
404 | *dp++ = (fsw_u8)(0xc0 | ((c >> 6) & 0x1f));
|
---|
405 | *dp++ = (fsw_u8)(0x80 | (c & 0x3f));
|
---|
406 | } else if (c < 0x010000) {
|
---|
407 | *dp++ = (fsw_u8)(0xe0 | ((c >> 12) & 0x0f));
|
---|
408 | *dp++ = (fsw_u8)(0x80 | ((c >> 6) & 0x3f));
|
---|
409 | *dp++ = (fsw_u8)(0x80 | (c & 0x3f));
|
---|
410 | } else {
|
---|
411 | *dp++ = (fsw_u8)(0xf0 | ((c >> 18) & 0x07));
|
---|
412 | *dp++ = (fsw_u8)(0x80 | ((c >> 12) & 0x3f));
|
---|
413 | *dp++ = (fsw_u8)(0x80 | ((c >> 6) & 0x3f));
|
---|
414 | *dp++ = (fsw_u8)(0x80 | (c & 0x3f));
|
---|
415 | }
|
---|
416 | }
|
---|
417 | return FSW_SUCCESS;
|
---|
418 | }
|
---|
419 |
|
---|
420 | static fsw_status_t fsw_strcoerce_UTF16_SWAPPED_UTF8(void *srcdata, int srclen, struct fsw_string *dest)
|
---|
421 | {
|
---|
422 | fsw_status_t status;
|
---|
423 | int i, destsize;
|
---|
424 | fsw_u16 *sp;
|
---|
425 | fsw_u8 *dp;
|
---|
426 | fsw_u32 c;
|
---|
427 |
|
---|
428 | sp = (fsw_u16 *)srcdata;
|
---|
429 | destsize = 0;
|
---|
430 | for (i = 0; i < srclen; i++) {
|
---|
431 | c = *sp++; c = FSW_SWAPVALUE_U16(c);
|
---|
432 |
|
---|
433 | if (c < 0x000080)
|
---|
434 | destsize++;
|
---|
435 | else if (c < 0x000800)
|
---|
436 | destsize += 2;
|
---|
437 | else if (c < 0x010000)
|
---|
438 | destsize += 3;
|
---|
439 | else
|
---|
440 | destsize += 4;
|
---|
441 | }
|
---|
442 |
|
---|
443 | dest->type = FSW_STRING_TYPE_UTF8;
|
---|
444 | dest->len = srclen;
|
---|
445 | dest->size = destsize;
|
---|
446 | status = fsw_alloc(dest->size, &dest->data);
|
---|
447 | if (status)
|
---|
448 | return status;
|
---|
449 |
|
---|
450 | sp = (fsw_u16 *)srcdata;
|
---|
451 | dp = (fsw_u8 *)dest->data;
|
---|
452 | for (i = 0; i < srclen; i++) {
|
---|
453 | c = *sp++; c = FSW_SWAPVALUE_U16(c);
|
---|
454 |
|
---|
455 | if (c < 0x000080) {
|
---|
456 | *dp++ = (fsw_u8)c;
|
---|
457 | } else if (c < 0x000800) {
|
---|
458 | *dp++ = (fsw_u8)(0xc0 | ((c >> 6) & 0x1f));
|
---|
459 | *dp++ = (fsw_u8)(0x80 | (c & 0x3f));
|
---|
460 | } else if (c < 0x010000) {
|
---|
461 | *dp++ = (fsw_u8)(0xe0 | ((c >> 12) & 0x0f));
|
---|
462 | *dp++ = (fsw_u8)(0x80 | ((c >> 6) & 0x3f));
|
---|
463 | *dp++ = (fsw_u8)(0x80 | (c & 0x3f));
|
---|
464 | } else {
|
---|
465 | *dp++ = (fsw_u8)(0xf0 | ((c >> 18) & 0x07));
|
---|
466 | *dp++ = (fsw_u8)(0x80 | ((c >> 12) & 0x3f));
|
---|
467 | *dp++ = (fsw_u8)(0x80 | ((c >> 6) & 0x3f));
|
---|
468 | *dp++ = (fsw_u8)(0x80 | (c & 0x3f));
|
---|
469 | }
|
---|
470 | }
|
---|
471 | return FSW_SUCCESS;
|
---|
472 | }
|
---|