-
Notifications
You must be signed in to change notification settings - Fork 0
/
cptable.c
183 lines (171 loc) · 5.03 KB
/
cptable.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*
* Codepage tables
*
* Copyright 2000 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdlib.h>
#include "wine/unicode.h"
/* Everything below this line is generated automatically by cpmap.pl */
/* ### cpmap begin ### */
extern union cptable cptable_037;
extern union cptable cptable_424;
extern union cptable cptable_437;
extern union cptable cptable_500;
extern union cptable cptable_737;
extern union cptable cptable_775;
extern union cptable cptable_850;
extern union cptable cptable_852;
extern union cptable cptable_855;
extern union cptable cptable_856;
extern union cptable cptable_857;
extern union cptable cptable_860;
extern union cptable cptable_861;
extern union cptable cptable_862;
extern union cptable cptable_863;
extern union cptable cptable_864;
extern union cptable cptable_865;
extern union cptable cptable_866;
extern union cptable cptable_869;
extern union cptable cptable_874;
extern union cptable cptable_875;
extern union cptable cptable_878;
extern union cptable cptable_932;
extern union cptable cptable_936;
extern union cptable cptable_949;
extern union cptable cptable_950;
extern union cptable cptable_1006;
extern union cptable cptable_1026;
extern union cptable cptable_1250;
extern union cptable cptable_1251;
extern union cptable cptable_1252;
extern union cptable cptable_1253;
extern union cptable cptable_1254;
extern union cptable cptable_1255;
extern union cptable cptable_1256;
extern union cptable cptable_1257;
extern union cptable cptable_1258;
extern union cptable cptable_1361;
extern union cptable cptable_10000;
extern union cptable cptable_10006;
extern union cptable cptable_10007;
extern union cptable cptable_10029;
extern union cptable cptable_10079;
extern union cptable cptable_10081;
extern union cptable cptable_20127;
extern union cptable cptable_20866;
extern union cptable cptable_20932;
extern union cptable cptable_21866;
extern union cptable cptable_28591;
extern union cptable cptable_28592;
extern union cptable cptable_28593;
extern union cptable cptable_28594;
extern union cptable cptable_28595;
extern union cptable cptable_28596;
extern union cptable cptable_28597;
extern union cptable cptable_28598;
extern union cptable cptable_28599;
extern union cptable cptable_28600;
extern union cptable cptable_28603;
extern union cptable cptable_28604;
extern union cptable cptable_28605;
extern union cptable cptable_28606;
static const union cptable * const cptables[62] =
{
&cptable_037,
&cptable_424,
&cptable_437,
&cptable_500,
&cptable_737,
&cptable_775,
&cptable_850,
&cptable_852,
&cptable_855,
&cptable_856,
&cptable_857,
&cptable_860,
&cptable_861,
&cptable_862,
&cptable_863,
&cptable_864,
&cptable_865,
&cptable_866,
&cptable_869,
&cptable_874,
&cptable_875,
&cptable_878,
&cptable_932,
&cptable_936,
&cptable_949,
&cptable_950,
&cptable_1006,
&cptable_1026,
&cptable_1250,
&cptable_1251,
&cptable_1252,
&cptable_1253,
&cptable_1254,
&cptable_1255,
&cptable_1256,
&cptable_1257,
&cptable_1258,
&cptable_1361,
&cptable_10000,
&cptable_10006,
&cptable_10007,
&cptable_10029,
&cptable_10079,
&cptable_10081,
&cptable_20127,
&cptable_20866,
&cptable_20932,
&cptable_21866,
&cptable_28591,
&cptable_28592,
&cptable_28593,
&cptable_28594,
&cptable_28595,
&cptable_28596,
&cptable_28597,
&cptable_28598,
&cptable_28599,
&cptable_28600,
&cptable_28603,
&cptable_28604,
&cptable_28605,
&cptable_28606,
};
/* ### cpmap end ### */
/* Everything above this line is generated automatically by cpmap.pl */
#define NB_CODEPAGES (sizeof(cptables)/sizeof(cptables[0]))
static int cmp_codepage( const void *codepage, const void *entry )
{
return *(const unsigned int *)codepage - (*(const union cptable *const *)entry)->info.codepage;
}
/* get the table of a given code page */
const union cptable *wine_cp_get_table( unsigned int codepage )
{
const union cptable **res;
if (!(res = bsearch( &codepage, cptables, NB_CODEPAGES,
sizeof(cptables[0]), cmp_codepage ))) return NULL;
return *res;
}
/* enum valid codepages */
const union cptable *wine_cp_enum_table( unsigned int index )
{
if (index >= NB_CODEPAGES) return NULL;
return cptables[index];
}