|
a/unac/unac.h |
|
b/unac/unac.h |
|
... |
|
... |
30 |
#ifdef __cplusplus
|
30 |
#ifdef __cplusplus
|
31 |
extern "C" {
|
31 |
extern "C" {
|
32 |
#endif
|
32 |
#endif
|
33 |
|
33 |
|
34 |
/* Generated by builder. Do not modify. Start defines */
|
34 |
/* Generated by builder. Do not modify. Start defines */
|
35 |
#define UNAC_BLOCK_SHIFT 5
|
35 |
#define UNAC_BLOCK_SHIFT 4
|
36 |
#define UNAC_BLOCK_MASK ((1 << UNAC_BLOCK_SHIFT) - 1)
|
36 |
#define UNAC_BLOCK_MASK ((1 << UNAC_BLOCK_SHIFT) - 1)
|
37 |
#define UNAC_BLOCK_SIZE (1 << UNAC_BLOCK_SHIFT)
|
37 |
#define UNAC_BLOCK_SIZE (1 << UNAC_BLOCK_SHIFT)
|
38 |
#define UNAC_BLOCK_COUNT 178
|
38 |
#define UNAC_BLOCK_COUNT 315
|
39 |
#define UNAC_INDEXES_SIZE (0x10000 >> UNAC_BLOCK_SHIFT)
|
39 |
#define UNAC_INDEXES_SIZE (0x10000 >> UNAC_BLOCK_SHIFT)
|
40 |
/* Generated by builder. Do not modify. End defines */
|
40 |
/* Generated by builder. Do not modify. End defines */
|
41 |
|
41 |
|
42 |
/*
|
42 |
/*
|
43 |
* Return the unaccented equivalent of the UTF-16 character <c>
|
43 |
* Return the unaccented equivalent of the UTF-16 character <c>
|
|
... |
|
... |
51 |
* tables (unac_data_table, unac_positions) layout.
|
51 |
* tables (unac_data_table, unac_positions) layout.
|
52 |
*/
|
52 |
*/
|
53 |
#define unac_char_utf16(c,p,l) \
|
53 |
#define unac_char_utf16(c,p,l) \
|
54 |
{ \
|
54 |
{ \
|
55 |
unsigned short index = unac_indexes[(c) >> UNAC_BLOCK_SHIFT]; \
|
55 |
unsigned short index = unac_indexes[(c) >> UNAC_BLOCK_SHIFT]; \
|
56 |
unsigned char position = (c) & UNAC_BLOCK_MASK; \
|
56 |
unsigned char position = 2*((c) & UNAC_BLOCK_MASK); \
|
57 |
(p) = &(unac_data_table[index][unac_positions[index][position]]); \
|
57 |
(p) = &(unac_data_table[index][unac_positions[index][position]]); \
|
58 |
(l) = unac_positions[index][position + 1] - unac_positions[index][position]; \
|
58 |
(l) = unac_positions[index][position + 1] - unac_positions[index][position]; \
|
59 |
if((l) == 1 && *(p) == 0xFFFF) { \
|
59 |
if((l) == 1 && *(p) == 0xFFFF) { \
|
60 |
(p) = 0; \
|
60 |
(p) = 0; \
|
61 |
(l) = 0; \
|
61 |
(l) = 0; \
|
62 |
} \
|
62 |
} \
|
63 |
}
|
63 |
}
|
|
|
64 |
|
|
|
65 |
/*
|
|
|
66 |
* Save as unac_ but case-folded
|
|
|
67 |
*/
|
|
|
68 |
#define unacfold_char_utf16(c,p,l) \
|
|
|
69 |
{ \
|
|
|
70 |
unsigned short index = unac_indexes[(c) >> UNAC_BLOCK_SHIFT]; \
|
|
|
71 |
unsigned char position = 2*((c) & UNAC_BLOCK_MASK)+1; \
|
|
|
72 |
(p) = &(unac_data_table[index][unac_positions[index][position]]); \
|
|
|
73 |
(l) = unac_positions[index][position + 1] - unac_positions[index][position]; \
|
|
|
74 |
if((l) == 1 && *(p) == 0xFFFF) { \
|
|
|
75 |
(p) = 0; \
|
|
|
76 |
(l) = 0; \
|
|
|
77 |
} \
|
|
|
78 |
}
|
64 |
|
79 |
|
65 |
/*
|
80 |
/*
|
66 |
* Return the unaccented equivalent of the UTF-16 string <in> of
|
81 |
* Return the unaccented equivalent of the UTF-16 string <in> of
|
67 |
* length <in_length> in the pointer <out>. The length of the UTF-16
|
82 |
* length <in_length> in the pointer <out>. The length of the UTF-16
|
68 |
* string returned in <out> is stored in <out_length>. If the pointer
|
83 |
* string returned in <out> is stored in <out_length>. If the pointer
|
|
... |
|
... |
75 |
* on error, in which case the errno variable is set to the
|
90 |
* on error, in which case the errno variable is set to the
|
76 |
* corresponding error code.
|
91 |
* corresponding error code.
|
77 |
*/
|
92 |
*/
|
78 |
int unac_string_utf16(const char* in, size_t in_length,
|
93 |
int unac_string_utf16(const char* in, size_t in_length,
|
79 |
char** out, size_t* out_length);
|
94 |
char** out, size_t* out_length);
|
|
|
95 |
int unacfold_string_utf16(const char* in, size_t in_length,
|
|
|
96 |
char** out, size_t* out_length);
|
80 |
|
97 |
|
81 |
/*
|
98 |
/*
|
82 |
* The semantic of this function is stricly equal to the function
|
99 |
* The semantic of this function is stricly equal to the function
|
83 |
* unac_string_utf16. The <charset> argument applies to the content of the
|
100 |
* unac_string_utf16. The <charset> argument applies to the content of the
|
84 |
* input string. It is converted to UTF-16 using iconv(3) before calling
|
101 |
* input string. It is converted to UTF-16 using iconv(3) before calling
|
|
... |
|
... |
90 |
* the errno variable is set to the corresponding error code.
|
107 |
* the errno variable is set to the corresponding error code.
|
91 |
*/
|
108 |
*/
|
92 |
int unac_string(const char* charset,
|
109 |
int unac_string(const char* charset,
|
93 |
const char* in, size_t in_length,
|
110 |
const char* in, size_t in_length,
|
94 |
char** out, size_t* out_length);
|
111 |
char** out, size_t* out_length);
|
|
|
112 |
int unacfold_string(const char* charset,
|
|
|
113 |
const char* in, size_t in_length,
|
|
|
114 |
char** out, size_t* out_length);
|
95 |
|
115 |
|
96 |
/*
|
116 |
/*
|
97 |
* Return unac version number.
|
117 |
* Return unac version number.
|
98 |
*/
|
118 |
*/
|
99 |
const char* unac_version(void);
|
119 |
const char* unac_version(void);
|
|
... |
|
... |
139 |
void unac_debug_callback(int level, unac_debug_print_t function, void* data);
|
159 |
void unac_debug_callback(int level, unac_debug_print_t function, void* data);
|
140 |
#endif /* HAVE_VSNPRINTF */
|
160 |
#endif /* HAVE_VSNPRINTF */
|
141 |
|
161 |
|
142 |
/* Generated by builder. Do not modify. Start declarations */
|
162 |
/* Generated by builder. Do not modify. Start declarations */
|
143 |
extern unsigned short unac_indexes[UNAC_INDEXES_SIZE];
|
163 |
extern unsigned short unac_indexes[UNAC_INDEXES_SIZE];
|
144 |
extern unsigned char unac_positions[UNAC_BLOCK_COUNT][UNAC_BLOCK_SIZE + 1];
|
164 |
extern unsigned char unac_positions[UNAC_BLOCK_COUNT][2*UNAC_BLOCK_SIZE + 1];
|
145 |
extern unsigned short* unac_data_table[UNAC_BLOCK_COUNT];
|
165 |
extern unsigned short* unac_data_table[UNAC_BLOCK_COUNT];
|
146 |
extern unsigned short unac_data0[];
|
166 |
extern unsigned short unac_data0[];
|
147 |
extern unsigned short unac_data1[];
|
167 |
extern unsigned short unac_data1[];
|
148 |
extern unsigned short unac_data2[];
|
168 |
extern unsigned short unac_data2[];
|
149 |
extern unsigned short unac_data3[];
|
169 |
extern unsigned short unac_data3[];
|
|
... |
|
... |
319 |
extern unsigned short unac_data173[];
|
339 |
extern unsigned short unac_data173[];
|
320 |
extern unsigned short unac_data174[];
|
340 |
extern unsigned short unac_data174[];
|
321 |
extern unsigned short unac_data175[];
|
341 |
extern unsigned short unac_data175[];
|
322 |
extern unsigned short unac_data176[];
|
342 |
extern unsigned short unac_data176[];
|
323 |
extern unsigned short unac_data177[];
|
343 |
extern unsigned short unac_data177[];
|
|
|
344 |
extern unsigned short unac_data178[];
|
|
|
345 |
extern unsigned short unac_data179[];
|
|
|
346 |
extern unsigned short unac_data180[];
|
|
|
347 |
extern unsigned short unac_data181[];
|
|
|
348 |
extern unsigned short unac_data182[];
|
|
|
349 |
extern unsigned short unac_data183[];
|
|
|
350 |
extern unsigned short unac_data184[];
|
|
|
351 |
extern unsigned short unac_data185[];
|
|
|
352 |
extern unsigned short unac_data186[];
|
|
|
353 |
extern unsigned short unac_data187[];
|
|
|
354 |
extern unsigned short unac_data188[];
|
|
|
355 |
extern unsigned short unac_data189[];
|
|
|
356 |
extern unsigned short unac_data190[];
|
|
|
357 |
extern unsigned short unac_data191[];
|
|
|
358 |
extern unsigned short unac_data192[];
|
|
|
359 |
extern unsigned short unac_data193[];
|
|
|
360 |
extern unsigned short unac_data194[];
|
|
|
361 |
extern unsigned short unac_data195[];
|
|
|
362 |
extern unsigned short unac_data196[];
|
|
|
363 |
extern unsigned short unac_data197[];
|
|
|
364 |
extern unsigned short unac_data198[];
|
|
|
365 |
extern unsigned short unac_data199[];
|
|
|
366 |
extern unsigned short unac_data200[];
|
|
|
367 |
extern unsigned short unac_data201[];
|
|
|
368 |
extern unsigned short unac_data202[];
|
|
|
369 |
extern unsigned short unac_data203[];
|
|
|
370 |
extern unsigned short unac_data204[];
|
|
|
371 |
extern unsigned short unac_data205[];
|
|
|
372 |
extern unsigned short unac_data206[];
|
|
|
373 |
extern unsigned short unac_data207[];
|
|
|
374 |
extern unsigned short unac_data208[];
|
|
|
375 |
extern unsigned short unac_data209[];
|
|
|
376 |
extern unsigned short unac_data210[];
|
|
|
377 |
extern unsigned short unac_data211[];
|
|
|
378 |
extern unsigned short unac_data212[];
|
|
|
379 |
extern unsigned short unac_data213[];
|
|
|
380 |
extern unsigned short unac_data214[];
|
|
|
381 |
extern unsigned short unac_data215[];
|
|
|
382 |
extern unsigned short unac_data216[];
|
|
|
383 |
extern unsigned short unac_data217[];
|
|
|
384 |
extern unsigned short unac_data218[];
|
|
|
385 |
extern unsigned short unac_data219[];
|
|
|
386 |
extern unsigned short unac_data220[];
|
|
|
387 |
extern unsigned short unac_data221[];
|
|
|
388 |
extern unsigned short unac_data222[];
|
|
|
389 |
extern unsigned short unac_data223[];
|
|
|
390 |
extern unsigned short unac_data224[];
|
|
|
391 |
extern unsigned short unac_data225[];
|
|
|
392 |
extern unsigned short unac_data226[];
|
|
|
393 |
extern unsigned short unac_data227[];
|
|
|
394 |
extern unsigned short unac_data228[];
|
|
|
395 |
extern unsigned short unac_data229[];
|
|
|
396 |
extern unsigned short unac_data230[];
|
|
|
397 |
extern unsigned short unac_data231[];
|
|
|
398 |
extern unsigned short unac_data232[];
|
|
|
399 |
extern unsigned short unac_data233[];
|
|
|
400 |
extern unsigned short unac_data234[];
|
|
|
401 |
extern unsigned short unac_data235[];
|
|
|
402 |
extern unsigned short unac_data236[];
|
|
|
403 |
extern unsigned short unac_data237[];
|
|
|
404 |
extern unsigned short unac_data238[];
|
|
|
405 |
extern unsigned short unac_data239[];
|
|
|
406 |
extern unsigned short unac_data240[];
|
|
|
407 |
extern unsigned short unac_data241[];
|
|
|
408 |
extern unsigned short unac_data242[];
|
|
|
409 |
extern unsigned short unac_data243[];
|
|
|
410 |
extern unsigned short unac_data244[];
|
|
|
411 |
extern unsigned short unac_data245[];
|
|
|
412 |
extern unsigned short unac_data246[];
|
|
|
413 |
extern unsigned short unac_data247[];
|
|
|
414 |
extern unsigned short unac_data248[];
|
|
|
415 |
extern unsigned short unac_data249[];
|
|
|
416 |
extern unsigned short unac_data250[];
|
|
|
417 |
extern unsigned short unac_data251[];
|
|
|
418 |
extern unsigned short unac_data252[];
|
|
|
419 |
extern unsigned short unac_data253[];
|
|
|
420 |
extern unsigned short unac_data254[];
|
|
|
421 |
extern unsigned short unac_data255[];
|
|
|
422 |
extern unsigned short unac_data256[];
|
|
|
423 |
extern unsigned short unac_data257[];
|
|
|
424 |
extern unsigned short unac_data258[];
|
|
|
425 |
extern unsigned short unac_data259[];
|
|
|
426 |
extern unsigned short unac_data260[];
|
|
|
427 |
extern unsigned short unac_data261[];
|
|
|
428 |
extern unsigned short unac_data262[];
|
|
|
429 |
extern unsigned short unac_data263[];
|
|
|
430 |
extern unsigned short unac_data264[];
|
|
|
431 |
extern unsigned short unac_data265[];
|
|
|
432 |
extern unsigned short unac_data266[];
|
|
|
433 |
extern unsigned short unac_data267[];
|
|
|
434 |
extern unsigned short unac_data268[];
|
|
|
435 |
extern unsigned short unac_data269[];
|
|
|
436 |
extern unsigned short unac_data270[];
|
|
|
437 |
extern unsigned short unac_data271[];
|
|
|
438 |
extern unsigned short unac_data272[];
|
|
|
439 |
extern unsigned short unac_data273[];
|
|
|
440 |
extern unsigned short unac_data274[];
|
|
|
441 |
extern unsigned short unac_data275[];
|
|
|
442 |
extern unsigned short unac_data276[];
|
|
|
443 |
extern unsigned short unac_data277[];
|
|
|
444 |
extern unsigned short unac_data278[];
|
|
|
445 |
extern unsigned short unac_data279[];
|
|
|
446 |
extern unsigned short unac_data280[];
|
|
|
447 |
extern unsigned short unac_data281[];
|
|
|
448 |
extern unsigned short unac_data282[];
|
|
|
449 |
extern unsigned short unac_data283[];
|
|
|
450 |
extern unsigned short unac_data284[];
|
|
|
451 |
extern unsigned short unac_data285[];
|
|
|
452 |
extern unsigned short unac_data286[];
|
|
|
453 |
extern unsigned short unac_data287[];
|
|
|
454 |
extern unsigned short unac_data288[];
|
|
|
455 |
extern unsigned short unac_data289[];
|
|
|
456 |
extern unsigned short unac_data290[];
|
|
|
457 |
extern unsigned short unac_data291[];
|
|
|
458 |
extern unsigned short unac_data292[];
|
|
|
459 |
extern unsigned short unac_data293[];
|
|
|
460 |
extern unsigned short unac_data294[];
|
|
|
461 |
extern unsigned short unac_data295[];
|
|
|
462 |
extern unsigned short unac_data296[];
|
|
|
463 |
extern unsigned short unac_data297[];
|
|
|
464 |
extern unsigned short unac_data298[];
|
|
|
465 |
extern unsigned short unac_data299[];
|
|
|
466 |
extern unsigned short unac_data300[];
|
|
|
467 |
extern unsigned short unac_data301[];
|
|
|
468 |
extern unsigned short unac_data302[];
|
|
|
469 |
extern unsigned short unac_data303[];
|
|
|
470 |
extern unsigned short unac_data304[];
|
|
|
471 |
extern unsigned short unac_data305[];
|
|
|
472 |
extern unsigned short unac_data306[];
|
|
|
473 |
extern unsigned short unac_data307[];
|
|
|
474 |
extern unsigned short unac_data308[];
|
|
|
475 |
extern unsigned short unac_data309[];
|
|
|
476 |
extern unsigned short unac_data310[];
|
|
|
477 |
extern unsigned short unac_data311[];
|
|
|
478 |
extern unsigned short unac_data312[];
|
|
|
479 |
extern unsigned short unac_data313[];
|
|
|
480 |
extern unsigned short unac_data314[];
|
324 |
/* Generated by builder. Do not modify. End declarations */
|
481 |
/* Generated by builder. Do not modify. End declarations */
|
325 |
|
482 |
|
326 |
#ifdef __cplusplus
|
483 |
#ifdef __cplusplus
|
327 |
}
|
484 |
}
|
328 |
#endif
|
485 |
#endif
|