Include sys/param.h. (RESOLVE_CONFLICT_FIND_MAP): Cast r_offset to ElfW(Addr).
[glibc.git] / iconvdata / cp1255.c
blobf8a769539959fb194718a4f7daec8664211e6257
1 /* Conversion from and to CP1255.
2 Copyright (C) 1998, 2001 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998,
5 and Bruno Haible <haible@clisp.cons.org>, 2001.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with the GNU C Library; if not, write to the Free
19 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307 USA. */
22 #include <dlfcn.h>
23 #include <stdint.h>
24 #include <assert.h>
26 #define NELEMS(arr) (sizeof (arr) / sizeof (arr[0]))
28 /* Definitions used in the body of the `gconv' function. */
29 #define CHARSET_NAME "CP1255//"
30 #define FROM_LOOP from_cp1255
31 #define TO_LOOP to_cp1255
32 #define DEFINE_INIT 1
33 #define DEFINE_FINI 1
34 #define MIN_NEEDED_FROM 1
35 #define MAX_NEEDED_FROM 1
36 #define MIN_NEEDED_TO 4
37 #define MAX_NEEDED_TO 4
38 #define PREPARE_LOOP \
39 int saved_state; \
40 int *statep = &data->__statep->__count;
41 #define EXTRA_LOOP_ARGS , statep
44 /* Since we might have to reset input pointer we must be able to save
45 and restore the state. */
46 #define SAVE_RESET_STATE(Save) \
47 if (Save) \
48 saved_state = *statep; \
49 else \
50 *statep = saved_state
53 /* During CP1255 to UCS4 conversion, the COUNT element of the state
54 contains the last UCS4 character, shifted by 3 bits. */
57 /* Since this is a stateful encoding we have to provide code which resets
58 the output state to the initial state. This has to be done during the
59 flushing. */
60 #define EMIT_SHIFT_TO_INIT \
61 if (data->__statep->__count != 0) \
62 { \
63 if (FROM_DIRECTION) \
64 { \
65 if (__builtin_expect (outbuf + 4 <= outend, 1)) \
66 { \
67 /* Write out the last character. */ \
68 *((uint32_t *) outbuf)++ = data->__statep->__count >> 3; \
69 data->__statep->__count = 0; \
70 } \
71 else \
72 /* We don't have enough room in the output buffer. */ \
73 status = __GCONV_FULL_OUTPUT; \
74 } \
75 else \
76 /* We don't use shift states in the TO_DIRECTION. */ \
77 data->__statep->__count = 0; \
81 /* First define the conversion function from CP1255 to UCS4. */
83 static const uint16_t to_ucs4[128] = {
84 /* 0x80 */
85 0x20AC, 0, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
86 0x02C6, 0x2030, 0, 0x2039, 0, 0, 0, 0,
87 /* 0x90 */
88 0, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
89 0x02DC, 0x2122, 0, 0x203A, 0, 0, 0, 0,
90 /* 0xA0 */
91 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AA, 0x00A5, 0x00A6, 0x00A7,
92 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
93 /* 0xB0 */
94 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
95 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
96 /* 0xC0 */
97 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7,
98 0x05B8, 0x05B9, 0, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF,
99 /* 0xD0 */
100 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3,
101 0x05F4, 0, 0, 0, 0, 0, 0, 0,
102 /* 0xE0 */
103 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7,
104 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
105 /* 0xF0 */
106 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
107 0x05E8, 0x05E9, 0x05EA, 0, 0, 0x200E, 0x200F, 0,
110 /* CP1255 contains eight combining characters:
111 0x05b4, 0x05b7, 0x05b8, 0x05b9, 0x05bc, 0x05bf, 0x05c1, 0x05c2. */
113 /* Composition tables for each of the relevant combining characters. */
114 static const struct {
115 uint16_t base;
116 uint16_t composed;
117 } comp_table_data[] = {
118 #define COMP_TABLE_IDX_05B4 0
119 #define COMP_TABLE_LEN_05B4 1
120 { 0x05D9, 0xFB1D },
121 #define COMP_TABLE_IDX_05B7 (COMP_TABLE_IDX_05B4 + COMP_TABLE_LEN_05B4)
122 #define COMP_TABLE_LEN_05B7 2
123 { 0x05D0, 0xFB2E },
124 { 0x05F2, 0xFB1F },
125 #define COMP_TABLE_IDX_05B8 (COMP_TABLE_IDX_05B7 + COMP_TABLE_LEN_05B7)
126 #define COMP_TABLE_LEN_05B8 1
127 { 0x05D0, 0xFB2F },
128 #define COMP_TABLE_IDX_05B9 (COMP_TABLE_IDX_05B8 + COMP_TABLE_LEN_05B8)
129 #define COMP_TABLE_LEN_05B9 1
130 { 0x05D5, 0xFB4B },
131 #define COMP_TABLE_IDX_05BC (COMP_TABLE_IDX_05B9 + COMP_TABLE_LEN_05B9)
132 #define COMP_TABLE_LEN_05BC 24
133 { 0x05D0, 0xFB30 },
134 { 0x05D1, 0xFB31 },
135 { 0x05D2, 0xFB32 },
136 { 0x05D3, 0xFB33 },
137 { 0x05D4, 0xFB34 },
138 { 0x05D5, 0xFB35 },
139 { 0x05D6, 0xFB36 },
140 { 0x05D8, 0xFB38 },
141 { 0x05D9, 0xFB39 },
142 { 0x05DA, 0xFB3A },
143 { 0x05DB, 0xFB3B },
144 { 0x05DC, 0xFB3C },
145 { 0x05DE, 0xFB3E },
146 { 0x05E0, 0xFB40 },
147 { 0x05E1, 0xFB41 },
148 { 0x05E3, 0xFB43 },
149 { 0x05E4, 0xFB44 },
150 { 0x05E6, 0xFB46 },
151 { 0x05E7, 0xFB47 },
152 { 0x05E8, 0xFB48 },
153 { 0x05E9, 0xFB49 },
154 { 0x05EA, 0xFB4A },
155 { 0xFB2A, 0xFB2C },
156 { 0xFB2B, 0xFB2D },
157 #define COMP_TABLE_IDX_05BF (COMP_TABLE_IDX_05BC + COMP_TABLE_LEN_05BC)
158 #define COMP_TABLE_LEN_05BF 3
159 { 0x05D1, 0xFB4C },
160 { 0x05DB, 0xFB4D },
161 { 0x05E4, 0xFB4E },
162 #define COMP_TABLE_IDX_05C1 (COMP_TABLE_IDX_05BF + COMP_TABLE_LEN_05BF)
163 #define COMP_TABLE_LEN_05C1 2
164 { 0x05E9, 0xFB2A },
165 { 0xFB49, 0xFB2C },
166 #define COMP_TABLE_IDX_05C2 (COMP_TABLE_IDX_05C1 + COMP_TABLE_LEN_05C1)
167 #define COMP_TABLE_LEN_05C2 2
168 { 0x05E9, 0xFB2B },
169 { 0xFB49, 0xFB2D },
170 #define COMP_TABLE_IDX_END (COMP_TABLE_IDX_05C2 + COMP_TABLE_LEN_05C2)
172 /* Compile-time verification of table size. */
173 typedef int verify1[(NELEMS (comp_table_data) == COMP_TABLE_IDX_END) - 1];
175 static const struct { unsigned int idx; unsigned int len; } comp_table[8] = {
176 { COMP_TABLE_IDX_05B4, COMP_TABLE_LEN_05B4 },
177 { COMP_TABLE_IDX_05B7, COMP_TABLE_LEN_05B7 },
178 { COMP_TABLE_IDX_05B8, COMP_TABLE_LEN_05B8 },
179 { COMP_TABLE_IDX_05B9, COMP_TABLE_LEN_05B9 },
180 { COMP_TABLE_IDX_05BC, COMP_TABLE_LEN_05BC },
181 { COMP_TABLE_IDX_05BF, COMP_TABLE_LEN_05BF },
182 { COMP_TABLE_IDX_05C1, COMP_TABLE_LEN_05C1 },
183 { COMP_TABLE_IDX_05C2, COMP_TABLE_LEN_05C2 },
186 #define MIN_NEEDED_INPUT MIN_NEEDED_FROM
187 #define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
188 #define MAX_NEEDED_OUTPUT 8
189 #define LOOPFCT FROM_LOOP
190 #define BODY \
192 uint32_t ch = *inptr; \
193 uint32_t last_ch; \
194 int must_buffer_ch; \
196 if (ch >= 0x80) \
198 ch = to_ucs4[ch - 0x80]; \
199 if (__builtin_expect (ch == L'\0', 0)) \
201 /* This is an illegal character. */ \
202 if (! ignore_errors_p ()) \
204 result = __GCONV_ILLEGAL_INPUT; \
205 break; \
208 ++inptr; \
209 ++*irreversible; \
210 continue; \
214 /* Determine whether there is a buffered character pending. */ \
215 last_ch = *statep >> 3; \
217 /* We have to buffer ch if it is a possible match in comp_table_data. */ \
218 must_buffer_ch = (ch >= 0x05d0 && ch <= 0x05f2); \
220 if (last_ch) \
222 if (ch >= 0x05b0 && ch < 0x05c5) \
224 /* See whether last_ch and ch can be combined. */ \
225 unsigned int i, i1, i2; \
227 switch (ch) \
229 case 0x05b4: \
230 i = 0; \
231 break; \
232 case 0x05b7: \
233 i = 1; \
234 break; \
235 case 0x05b8: \
236 i = 2; \
237 break; \
238 case 0x05b9: \
239 i = 3; \
240 break; \
241 case 0x05bc: \
242 i = 4; \
243 break; \
244 case 0x05bf: \
245 i = 5; \
246 break; \
247 case 0x05c1: \
248 i = 6; \
249 break; \
250 case 0x05c2: \
251 i = 7; \
252 break; \
253 default: \
254 goto not_combining; \
257 i1 = comp_table[i].idx; \
258 i2 = i1 + comp_table[i].len - 1; \
260 if (last_ch >= comp_table_data[i1].base \
261 && last_ch <= comp_table_data[i2].base) \
263 for (;;) \
265 i = (i1 + i2) >> 1; \
266 if (last_ch == comp_table_data[i].base) \
267 break; \
268 if (last_ch < comp_table_data[i].base) \
270 if (i1 == i) \
271 goto not_combining; \
272 i2 = i; \
274 else \
276 if (i1 != i) \
277 i1 = i; \
278 else \
280 i = i2; \
281 if (last_ch == comp_table_data[i].base) \
282 break; \
283 goto not_combining; \
287 last_ch = comp_table_data[i].composed; \
288 if (last_ch == 0xfb2a || last_ch == 0xfb2b \
289 || last_ch == 0xfb49) \
290 /* Buffer the combined character. */ \
291 *statep = last_ch << 3; \
292 else \
294 /* Output the combined character. */ \
295 put32 (outptr, last_ch); \
296 outptr += 4; \
297 *statep = 0; \
299 ++inptr; \
300 continue; \
304 not_combining: \
305 /* Output the buffered character. */ \
306 put32 (outptr, last_ch); \
307 outptr += 4; \
308 *statep = 0; \
310 /* If we don't have enough room to output ch as well, then deal \
311 with it in another round. */ \
312 if (!must_buffer_ch && __builtin_expect (outptr + 4 > outend, 0)) \
313 continue; \
316 if (must_buffer_ch) \
317 *statep = ch << 3; \
318 else \
320 put32 (outptr, ch); \
321 outptr += 4; \
323 ++inptr; \
325 #define LOOP_NEED_FLAGS
326 #define EXTRA_LOOP_DECLS , int *statep
327 #include <iconv/loop.c>
330 /* Next, define the conversion function from UCS4 to CP1255. */
332 static const unsigned char from_ucs4[] = {
333 #define FROM_IDX_00 0
334 0xa0, 0xa1, 0xa2, 0xa3, 0x00, 0xa5, 0xa6, 0xa7, /* 0x00a0-0x00a7 */
335 0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x00a8-0x00af */
336 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x00b0-0x00b7 */
337 0xb8, 0xb9, 0x00, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x00b8-0x00bf */
338 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00c0-0x00c7 */
339 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00c8-0x00cf */
340 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, /* 0x00d0-0x00d7 */
341 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00d8-0x00df */
342 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00e0-0x00e7 */
343 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00e8-0x00ef */
344 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, /* 0x00f0-0x00f7 */
345 #define FROM_IDX_02 (FROM_IDX_00 + 88)
346 0x88, 0x00, /* 0x02c6-0x02c7 */
347 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x02c8-0x02cf */
348 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x02d0-0x02d7 */
349 0x00, 0x00, 0x00, 0x00, 0x98, /* 0x02d8-0x02dc */
350 #define FROM_IDX_05 (FROM_IDX_02 + 23)
351 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x05b0-0x05b7 */
352 0xc8, 0xc9, 0x00, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x05b8-0x05bf */
353 0xd0, 0xd1, 0xd2, 0xd3, 0x00, 0x00, 0x00, 0x00, /* 0x05c0-0x05c7 */
354 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x05c8-0x05cf */
355 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x05d0-0x05d7 */
356 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x05d8-0x05df */
357 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x05e0-0x05e7 */
358 0xf8, 0xf9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x05e8-0x05ef */
359 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, /* 0x05f0-0x05f4 */
360 #define FROM_IDX_20 (FROM_IDX_05 + 69)
361 0xfd, 0xfe, /* 0x200e-0x200f */
362 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x2010-0x2017 */
363 0x91, 0x92, 0x82, 0x00, 0x93, 0x94, 0x84, 0x00, /* 0x2018-0x201f */
364 0x86, 0x87, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x2020-0x2027 */
365 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2028-0x202f */
366 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2030-0x2037 */
367 0x00, 0x8b, 0x9b, /* 0x2038-0x203a */
368 #define FROM_IDX_FF (FROM_IDX_20 + 45)
370 /* Compile-time verification of table size. */
371 typedef int verify2[(NELEMS (from_ucs4) == FROM_IDX_FF) - 1];
373 static const unsigned char comb_table[8] = {
374 0xc4, 0xc7, 0xc8, 0xc9, 0xcc, 0xcf, 0xd1, 0xd2,
377 /* Decomposition table for the relevant Unicode characters. */
378 static const struct {
379 uint16_t composed;
380 uint16_t base;
381 uint32_t comb1 : 8;
382 int32_t comb2 : 8;
383 } decomp_table[] = {
384 { 0xFB1D, 0x05D9, 0, -1 },
385 { 0xFB1F, 0x05F2, 1, -1 },
386 { 0xFB2A, 0x05E9, 6, -1 },
387 { 0xFB2B, 0x05E9, 7, -1 },
388 { 0xFB2C, 0x05E9, 4, 6 },
389 { 0xFB2D, 0x05E9, 4, 7 },
390 { 0xFB2E, 0x05D0, 1, -1 },
391 { 0xFB2F, 0x05D0, 2, -1 },
392 { 0xFB30, 0x05D0, 4, -1 },
393 { 0xFB31, 0x05D1, 4, -1 },
394 { 0xFB32, 0x05D2, 4, -1 },
395 { 0xFB33, 0x05D3, 4, -1 },
396 { 0xFB34, 0x05D4, 4, -1 },
397 { 0xFB35, 0x05D5, 4, -1 },
398 { 0xFB36, 0x05D6, 4, -1 },
399 { 0xFB38, 0x05D8, 4, -1 },
400 { 0xFB39, 0x05D9, 4, -1 },
401 { 0xFB3A, 0x05DA, 4, -1 },
402 { 0xFB3B, 0x05DB, 4, -1 },
403 { 0xFB3C, 0x05DC, 4, -1 },
404 { 0xFB3E, 0x05DE, 4, -1 },
405 { 0xFB40, 0x05E0, 4, -1 },
406 { 0xFB41, 0x05E1, 4, -1 },
407 { 0xFB43, 0x05E3, 4, -1 },
408 { 0xFB44, 0x05E4, 4, -1 },
409 { 0xFB46, 0x05E6, 4, -1 },
410 { 0xFB47, 0x05E7, 4, -1 },
411 { 0xFB48, 0x05E8, 4, -1 },
412 { 0xFB49, 0x05E9, 4, -1 },
413 { 0xFB4A, 0x05EA, 4, -1 },
414 { 0xFB4B, 0x05D5, 3, -1 },
415 { 0xFB4C, 0x05D1, 5, -1 },
416 { 0xFB4D, 0x05DB, 5, -1 },
417 { 0xFB4E, 0x05E4, 5, -1 },
420 #define MIN_NEEDED_INPUT MIN_NEEDED_TO
421 #define MIN_NEEDED_OUTPUT MIN_NEEDED_FROM
422 #define MAX_NEEDED_OUTPUT 3
423 #define LOOPFCT TO_LOOP
424 #define BODY \
426 uint32_t ch = get32 (inptr); \
428 if (ch < 0x0080) \
430 *outptr++ = ch; \
431 inptr += 4; \
433 else \
435 unsigned char res; \
437 if (ch >= 0x00a0 && ch < 0x00f8) \
438 res = from_ucs4[ch - 0x00a0 + FROM_IDX_00]; \
439 else if (ch == 0x0192) \
440 res = 0x83; \
441 else if (ch >= 0x02c6 && ch < 0x02dd) \
442 res = from_ucs4[ch - 0x02c6 + FROM_IDX_02]; \
443 else if (ch >= 0x05b0 && ch < 0x05f5) \
444 res = from_ucs4[ch - 0x05b0 + FROM_IDX_05]; \
445 else if (ch >= 0x200e && ch < 0x203b) \
446 res = from_ucs4[ch - 0x200e + FROM_IDX_20]; \
447 else if (ch == 0x20aa) \
448 res = 0xa4; \
449 else if (ch == 0x20ac) \
450 res = 0x80; \
451 else if (ch == 0x2122) \
452 res = 0x99; \
453 else \
455 UNICODE_TAG_HANDLER (ch, 4); \
456 res = 0; \
459 if (__builtin_expect (res != 0, 1)) \
461 *outptr++ = res; \
462 inptr += 4; \
464 else \
466 /* Try canonical decomposition. */ \
467 unsigned int i1, i2; \
469 i1 = 0; \
470 i2 = sizeof (decomp_table) / sizeof (decomp_table[0]) - 1; \
471 if (ch >= decomp_table[i1].composed \
472 && ch <= decomp_table[i2].composed) \
474 unsigned int i; \
476 for (;;) \
478 i = (i1 + i2) >> 1; \
479 if (ch == decomp_table[i].composed) \
480 break; \
481 if (ch < decomp_table[i].composed) \
483 if (i1 == i) \
484 goto failed; \
485 i2 = i; \
487 else \
489 if (i1 != i) \
490 i1 = i; \
491 else \
493 i = i2; \
494 if (ch == decomp_table[i].composed) \
495 break; \
496 goto failed; \
501 /* Found a canonical decomposition. */ \
502 ch = decomp_table[i].base; \
503 /* ch is one of 0x05d0..0x05d6, 0x05d8..0x05dc, 0x05de, \
504 0x05e0..0x05e1, 0x05e3..0x05e4, 0x05e6..0x05ea, 0x05f2. */ \
505 ch = from_ucs4[ch - 0x05b0 + FROM_IDX_05]; \
506 assert (ch != 0); \
508 if (decomp_table[i].comb2 < 0) \
510 /* See whether we have room for two bytes. */ \
511 if (__builtin_expect (outptr + 1 >= outend, 0)) \
513 result = __GCONV_FULL_OUTPUT; \
514 break; \
517 *outptr++ = (unsigned char) ch; \
518 *outptr++ = comb_table[decomp_table[i].comb1]; \
520 else \
522 /* See whether we have room for three bytes. */ \
523 if (__builtin_expect (outptr + 2 >= outend, 0)) \
525 result = __GCONV_FULL_OUTPUT; \
526 break; \
529 *outptr++ = (unsigned char) ch; \
530 *outptr++ = comb_table[decomp_table[i].comb1]; \
531 *outptr++ = comb_table[decomp_table[i].comb2]; \
534 inptr += 4; \
535 continue; \
538 failed: \
539 /* This is an illegal character. */ \
540 STANDARD_ERR_HANDLER (4); \
544 #define LOOP_NEED_FLAGS
545 #define EXTRA_LOOP_DECLS , int *statep
546 #include <iconv/loop.c>
549 /* Now define the toplevel functions. */
550 #include <iconv/skeleton.c>