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