shlwapi/tests: Skip some tests on Win9x/WinMe.
[wine.git] / libs / wine / cptable.c
blob50849468e65908f92f21da9f0f0aa9e3a51df207
1 /*
2 * Codepage tables
4 * Copyright 2000 Alexandre Julliard
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.
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.
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
21 #include <stdlib.h>
23 #include "wine/unicode.h"
25 /* Everything below this line is generated automatically by cpmap.pl */
26 /* ### cpmap begin ### */
27 extern union cptable cptable_037;
28 extern union cptable cptable_424;
29 extern union cptable cptable_437;
30 extern union cptable cptable_500;
31 extern union cptable cptable_737;
32 extern union cptable cptable_775;
33 extern union cptable cptable_850;
34 extern union cptable cptable_852;
35 extern union cptable cptable_855;
36 extern union cptable cptable_856;
37 extern union cptable cptable_857;
38 extern union cptable cptable_860;
39 extern union cptable cptable_861;
40 extern union cptable cptable_862;
41 extern union cptable cptable_863;
42 extern union cptable cptable_864;
43 extern union cptable cptable_865;
44 extern union cptable cptable_866;
45 extern union cptable cptable_869;
46 extern union cptable cptable_874;
47 extern union cptable cptable_875;
48 extern union cptable cptable_878;
49 extern union cptable cptable_932;
50 extern union cptable cptable_936;
51 extern union cptable cptable_949;
52 extern union cptable cptable_950;
53 extern union cptable cptable_1006;
54 extern union cptable cptable_1026;
55 extern union cptable cptable_1250;
56 extern union cptable cptable_1251;
57 extern union cptable cptable_1252;
58 extern union cptable cptable_1253;
59 extern union cptable cptable_1254;
60 extern union cptable cptable_1255;
61 extern union cptable cptable_1256;
62 extern union cptable cptable_1257;
63 extern union cptable cptable_1258;
64 extern union cptable cptable_1361;
65 extern union cptable cptable_10000;
66 extern union cptable cptable_10006;
67 extern union cptable cptable_10007;
68 extern union cptable cptable_10029;
69 extern union cptable cptable_10079;
70 extern union cptable cptable_10081;
71 extern union cptable cptable_20127;
72 extern union cptable cptable_20866;
73 extern union cptable cptable_20932;
74 extern union cptable cptable_21866;
75 extern union cptable cptable_28591;
76 extern union cptable cptable_28592;
77 extern union cptable cptable_28593;
78 extern union cptable cptable_28594;
79 extern union cptable cptable_28595;
80 extern union cptable cptable_28596;
81 extern union cptable cptable_28597;
82 extern union cptable cptable_28598;
83 extern union cptable cptable_28599;
84 extern union cptable cptable_28600;
85 extern union cptable cptable_28603;
86 extern union cptable cptable_28604;
87 extern union cptable cptable_28605;
88 extern union cptable cptable_28606;
90 static const union cptable * const cptables[62] =
92 &cptable_037,
93 &cptable_424,
94 &cptable_437,
95 &cptable_500,
96 &cptable_737,
97 &cptable_775,
98 &cptable_850,
99 &cptable_852,
100 &cptable_855,
101 &cptable_856,
102 &cptable_857,
103 &cptable_860,
104 &cptable_861,
105 &cptable_862,
106 &cptable_863,
107 &cptable_864,
108 &cptable_865,
109 &cptable_866,
110 &cptable_869,
111 &cptable_874,
112 &cptable_875,
113 &cptable_878,
114 &cptable_932,
115 &cptable_936,
116 &cptable_949,
117 &cptable_950,
118 &cptable_1006,
119 &cptable_1026,
120 &cptable_1250,
121 &cptable_1251,
122 &cptable_1252,
123 &cptable_1253,
124 &cptable_1254,
125 &cptable_1255,
126 &cptable_1256,
127 &cptable_1257,
128 &cptable_1258,
129 &cptable_1361,
130 &cptable_10000,
131 &cptable_10006,
132 &cptable_10007,
133 &cptable_10029,
134 &cptable_10079,
135 &cptable_10081,
136 &cptable_20127,
137 &cptable_20866,
138 &cptable_20932,
139 &cptable_21866,
140 &cptable_28591,
141 &cptable_28592,
142 &cptable_28593,
143 &cptable_28594,
144 &cptable_28595,
145 &cptable_28596,
146 &cptable_28597,
147 &cptable_28598,
148 &cptable_28599,
149 &cptable_28600,
150 &cptable_28603,
151 &cptable_28604,
152 &cptable_28605,
153 &cptable_28606,
155 /* ### cpmap end ### */
156 /* Everything above this line is generated automatically by cpmap.pl */
158 #define NB_CODEPAGES (sizeof(cptables)/sizeof(cptables[0]))
161 static int cmp_codepage( const void *codepage, const void *entry )
163 return *(const unsigned int *)codepage - (*(const union cptable *const *)entry)->info.codepage;
167 /* get the table of a given code page */
168 const union cptable *wine_cp_get_table( unsigned int codepage )
170 const union cptable **res;
172 if (!(res = bsearch( &codepage, cptables, NB_CODEPAGES,
173 sizeof(cptables[0]), cmp_codepage ))) return NULL;
174 return *res;
178 /* enum valid codepages */
179 const union cptable *wine_cp_enum_table( unsigned int index )
181 if (index >= NB_CODEPAGES) return NULL;
182 return cptables[index];