|
a/unac/unac.h |
|
b/unac/unac.h |
|
... |
|
... |
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 4
|
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 418
|
38 |
#define UNAC_BLOCK_COUNT 422
|
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>
|
44 |
* in the pointer <p>. The length of the unsigned short array pointed
|
44 |
* in the pointer <p>. The length of the unsigned short array pointed
|
45 |
* by <p> is returned in the <l> argument.
|
45 |
* by <p> is returned in the <l> argument.
|
46 |
* The C++ prototype of this macro would be:
|
46 |
* The C++ prototype of this macro would be:
|
47 |
*
|
47 |
*
|
48 |
* void unac_char(const unsigned short c, unsigned short*& p, int& l)
|
48 |
* void unac_char(const unsigned short c, unsigned short*& p, int& l, int o)
|
49 |
*
|
49 |
*
|
50 |
* See unac(3) in IMPLEMENTATION NOTES for more information about the
|
50 |
* See unac(3) in IMPLEMENTATION NOTES for more information about the
|
51 |
* tables (unac_data_table, unac_positions) layout.
|
51 |
* tables (unac_data_table, unac_positions) layout.
|
|
|
52 |
*
|
|
|
53 |
* Each transformed char has 3 possible outputs: unaccented, unaccented and
|
|
|
54 |
* folded, or just folded. These are kept at offset 0,1,2 in the position table
|
52 |
*/
|
55 |
*/
|
53 |
#define unac_char_utf16(c,p,l) \
|
|
|
54 |
{ \
|
|
|
55 |
unsigned short index = unac_indexes[(c) >> UNAC_BLOCK_SHIFT]; \
|
|
|
56 |
unsigned char position = 2*((c) & UNAC_BLOCK_MASK); \
|
|
|
57 |
(p) = &(unac_data_table[index][unac_positions[index][position]]); \
|
|
|
58 |
(l) = unac_positions[index][position + 1] - unac_positions[index][position]; \
|
|
|
59 |
if((l) == 1 && *(p) == 0xFFFF) { \
|
|
|
60 |
(p) = 0; \
|
|
|
61 |
(l) = 0; \
|
|
|
62 |
} \
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
/*
|
|
|
66 |
* Save as unac_ but case-folded
|
|
|
67 |
*/
|
|
|
68 |
#define unacfold_char_utf16(c,p,l) \
|
56 |
#define unac_uf_char_utf16_(c,p,l,o) \
|
69 |
{ \
|
57 |
{ \
|
70 |
unsigned short index = unac_indexes[(c) >> UNAC_BLOCK_SHIFT]; \
|
58 |
unsigned short index = unac_indexes[(c) >> UNAC_BLOCK_SHIFT]; \
|
71 |
unsigned char position = 2*((c) & UNAC_BLOCK_MASK)+1; \
|
59 |
unsigned char position = 3*((c) & UNAC_BLOCK_MASK) + (o); \
|
72 |
(p) = &(unac_data_table[index][unac_positions[index][position]]); \
|
60 |
(p) = &(unac_data_table[index][unac_positions[index][position]]); \
|
73 |
(l) = unac_positions[index][position + 1] - unac_positions[index][position]; \
|
61 |
(l) = unac_positions[index][position + 1] \
|
|
|
62 |
- unac_positions[index][position]; \
|
74 |
if((l) == 1 && *(p) == 0xFFFF) { \
|
63 |
if((l) == 1 && *(p) == 0xFFFF) { \
|
75 |
(p) = 0; \
|
64 |
(p) = 0; \
|
76 |
(l) = 0; \
|
65 |
(l) = 0; \
|
77 |
} \
|
66 |
} \
|
78 |
}
|
67 |
}
|
|
|
68 |
|
|
|
69 |
#define unac_char_utf16(c,p,l) unac_uf_char_utf16_((c),(p),(l),0)
|
|
|
70 |
#define unacfold_char_utf16(c,p,l) unac_uf_char_utf16_((c),(p),(l),1)
|
|
|
71 |
#define fold_char_utf16(c,p,l) unac_uf_char_utf16_((c),(p),(l),2)
|
79 |
|
72 |
|
80 |
/*
|
73 |
/*
|
81 |
* Return the unaccented equivalent of the UTF-16 string <in> of
|
74 |
* Return the unaccented equivalent of the UTF-16 string <in> of
|
82 |
* length <in_length> in the pointer <out>. The length of the UTF-16
|
75 |
* length <in_length> in the pointer <out>. The length of the UTF-16
|
83 |
* string returned in <out> is stored in <out_length>. If the pointer
|
76 |
* string returned in <out> is stored in <out_length>. If the pointer
|
|
... |
|
... |
92 |
*/
|
85 |
*/
|
93 |
int unac_string_utf16(const char* in, size_t in_length,
|
86 |
int unac_string_utf16(const char* in, size_t in_length,
|
94 |
char** out, size_t* out_length);
|
87 |
char** out, size_t* out_length);
|
95 |
int unacfold_string_utf16(const char* in, size_t in_length,
|
88 |
int unacfold_string_utf16(const char* in, size_t in_length,
|
96 |
char** out, size_t* out_length);
|
89 |
char** out, size_t* out_length);
|
|
|
90 |
int fold_string_utf16(const char* in, size_t in_length,
|
|
|
91 |
char** out, size_t* out_length);
|
97 |
|
92 |
|
98 |
/*
|
93 |
/*
|
99 |
* The semantic of this function is stricly equal to the function
|
94 |
* The semantic of this function is stricly equal to the function
|
100 |
* unac_string_utf16. The <charset> argument applies to the content of the
|
95 |
* unac_string_utf16. The <charset> argument applies to the content of the
|
101 |
* input string. It is converted to UTF-16 using iconv(3) before calling
|
96 |
* input string. It is converted to UTF-16 using iconv(3) before calling
|
|
... |
|
... |
108 |
*/
|
103 |
*/
|
109 |
int unac_string(const char* charset,
|
104 |
int unac_string(const char* charset,
|
110 |
const char* in, size_t in_length,
|
105 |
const char* in, size_t in_length,
|
111 |
char** out, size_t* out_length);
|
106 |
char** out, size_t* out_length);
|
112 |
int unacfold_string(const char* charset,
|
107 |
int unacfold_string(const char* charset,
|
|
|
108 |
const char* in, size_t in_length,
|
|
|
109 |
char** out, size_t* out_length);
|
|
|
110 |
int fold_string(const char* charset,
|
113 |
const char* in, size_t in_length,
|
111 |
const char* in, size_t in_length,
|
114 |
char** out, size_t* out_length);
|
112 |
char** out, size_t* out_length);
|
115 |
|
113 |
|
116 |
/* To be called before starting threads in mt programs */
|
114 |
/* To be called before starting threads in mt programs */
|
117 |
void unac_init_mt();
|
115 |
void unac_init_mt();
|
|
... |
|
... |
178 |
void unac_debug_callback(int level, unac_debug_print_t function, void* data);
|
176 |
void unac_debug_callback(int level, unac_debug_print_t function, void* data);
|
179 |
#endif /* HAVE_VSNPRINTF */
|
177 |
#endif /* HAVE_VSNPRINTF */
|
180 |
|
178 |
|
181 |
/* Generated by builder. Do not modify. Start declarations */
|
179 |
/* Generated by builder. Do not modify. Start declarations */
|
182 |
extern unsigned short unac_indexes[UNAC_INDEXES_SIZE];
|
180 |
extern unsigned short unac_indexes[UNAC_INDEXES_SIZE];
|
183 |
extern unsigned char unac_positions[UNAC_BLOCK_COUNT][2*UNAC_BLOCK_SIZE + 1];
|
181 |
extern unsigned char unac_positions[UNAC_BLOCK_COUNT][3*UNAC_BLOCK_SIZE + 1];
|
184 |
extern unsigned short* unac_data_table[UNAC_BLOCK_COUNT];
|
182 |
extern unsigned short* unac_data_table[UNAC_BLOCK_COUNT];
|
185 |
extern unsigned short unac_data0[];
|
183 |
extern unsigned short unac_data0[];
|
186 |
extern unsigned short unac_data1[];
|
184 |
extern unsigned short unac_data1[];
|
187 |
extern unsigned short unac_data2[];
|
185 |
extern unsigned short unac_data2[];
|
188 |
extern unsigned short unac_data3[];
|
186 |
extern unsigned short unac_data3[];
|
|
... |
|
... |
598 |
extern unsigned short unac_data413[];
|
596 |
extern unsigned short unac_data413[];
|
599 |
extern unsigned short unac_data414[];
|
597 |
extern unsigned short unac_data414[];
|
600 |
extern unsigned short unac_data415[];
|
598 |
extern unsigned short unac_data415[];
|
601 |
extern unsigned short unac_data416[];
|
599 |
extern unsigned short unac_data416[];
|
602 |
extern unsigned short unac_data417[];
|
600 |
extern unsigned short unac_data417[];
|
|
|
601 |
extern unsigned short unac_data418[];
|
|
|
602 |
extern unsigned short unac_data419[];
|
|
|
603 |
extern unsigned short unac_data420[];
|
|
|
604 |
extern unsigned short unac_data421[];
|
603 |
/* Generated by builder. Do not modify. End declarations */
|
605 |
/* Generated by builder. Do not modify. End declarations */
|
604 |
|
606 |
|
605 |
#ifdef __cplusplus
|
607 |
#ifdef __cplusplus
|
606 |
}
|
608 |
}
|
607 |
#endif
|
609 |
#endif
|