Implemented Rtl*ByteSwap() functions, based on a patch by Jon
[wine/multimedia.git] / unicode / cptable.c
blobdded69175e704cf883d7a461606d36dab3d1967f
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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_042;
29 extern union cptable cptable_424;
30 extern union cptable cptable_437;
31 extern union cptable cptable_500;
32 extern union cptable cptable_737;
33 extern union cptable cptable_775;
34 extern union cptable cptable_850;
35 extern union cptable cptable_852;
36 extern union cptable cptable_855;
37 extern union cptable cptable_856;
38 extern union cptable cptable_857;
39 extern union cptable cptable_860;
40 extern union cptable cptable_861;
41 extern union cptable cptable_862;
42 extern union cptable cptable_863;
43 extern union cptable cptable_864;
44 extern union cptable cptable_865;
45 extern union cptable cptable_866;
46 extern union cptable cptable_869;
47 extern union cptable cptable_874;
48 extern union cptable cptable_875;
49 extern union cptable cptable_878;
50 extern union cptable cptable_932;
51 extern union cptable cptable_936;
52 extern union cptable cptable_949;
53 extern union cptable cptable_950;
54 extern union cptable cptable_1006;
55 extern union cptable cptable_1026;
56 extern union cptable cptable_1250;
57 extern union cptable cptable_1251;
58 extern union cptable cptable_1252;
59 extern union cptable cptable_1253;
60 extern union cptable cptable_1254;
61 extern union cptable cptable_1255;
62 extern union cptable cptable_1256;
63 extern union cptable cptable_1257;
64 extern union cptable cptable_1258;
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_20866;
72 extern union cptable cptable_20932;
73 extern union cptable cptable_28591;
74 extern union cptable cptable_28592;
75 extern union cptable cptable_28593;
76 extern union cptable cptable_28594;
77 extern union cptable cptable_28595;
78 extern union cptable cptable_28596;
79 extern union cptable cptable_28597;
80 extern union cptable cptable_28598;
81 extern union cptable cptable_28599;
82 extern union cptable cptable_28600;
83 extern union cptable cptable_28603;
84 extern union cptable cptable_28604;
85 extern union cptable cptable_28605;
86 extern union cptable cptable_28606;
88 static const union cptable * const cptables[60] =
90 &cptable_037,
91 &cptable_042,
92 &cptable_424,
93 &cptable_437,
94 &cptable_500,
95 &cptable_737,
96 &cptable_775,
97 &cptable_850,
98 &cptable_852,
99 &cptable_855,
100 &cptable_856,
101 &cptable_857,
102 &cptable_860,
103 &cptable_861,
104 &cptable_862,
105 &cptable_863,
106 &cptable_864,
107 &cptable_865,
108 &cptable_866,
109 &cptable_869,
110 &cptable_874,
111 &cptable_875,
112 &cptable_878,
113 &cptable_932,
114 &cptable_936,
115 &cptable_949,
116 &cptable_950,
117 &cptable_1006,
118 &cptable_1026,
119 &cptable_1250,
120 &cptable_1251,
121 &cptable_1252,
122 &cptable_1253,
123 &cptable_1254,
124 &cptable_1255,
125 &cptable_1256,
126 &cptable_1257,
127 &cptable_1258,
128 &cptable_10000,
129 &cptable_10006,
130 &cptable_10007,
131 &cptable_10029,
132 &cptable_10079,
133 &cptable_10081,
134 &cptable_20866,
135 &cptable_20932,
136 &cptable_28591,
137 &cptable_28592,
138 &cptable_28593,
139 &cptable_28594,
140 &cptable_28595,
141 &cptable_28596,
142 &cptable_28597,
143 &cptable_28598,
144 &cptable_28599,
145 &cptable_28600,
146 &cptable_28603,
147 &cptable_28604,
148 &cptable_28605,
149 &cptable_28606,
151 /* ### cpmap end ### */
152 /* Everything above this line is generated automatically by cpmap.pl */
154 #define NB_CODEPAGES (sizeof(cptables)/sizeof(cptables[0]))
157 static int cmp_codepage( const void *codepage, const void *entry )
159 return (unsigned int)codepage - (*(union cptable **)entry)->info.codepage;
163 /* get the table of a given code page */
164 const union cptable *cp_get_table( unsigned int codepage )
166 const union cptable **res;
168 if (!(res = bsearch( (void *)codepage, cptables, NB_CODEPAGES,
169 sizeof(cptables[0]), cmp_codepage ))) return NULL;
170 return *res;
174 /* enum valid codepages */
175 const union cptable *cp_enum_table( unsigned int index )
177 if (index >= NB_CODEPAGES) return NULL;
178 return cptables[index];