iphlpapi: Implement ConvertInterfaceLuidToGuid() on top of nsi.
[wine.git] / libs / wine / cptable.c
blob58bb22f0aa85f63cb29b1caa970ef58c23d622b2
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/asm.h"
25 #ifdef __ASM_OBSOLETE
27 #include "unicode.h"
29 /* Everything below this line is generated automatically by make_unicode */
30 /* ### cpmap begin ### */
31 extern union cptable cptable_037;
32 extern union cptable cptable_437;
33 extern union cptable cptable_500;
34 extern union cptable cptable_737;
35 extern union cptable cptable_775;
36 extern union cptable cptable_850;
37 extern union cptable cptable_852;
38 extern union cptable cptable_855;
39 extern union cptable cptable_857;
40 extern union cptable cptable_860;
41 extern union cptable cptable_861;
42 extern union cptable cptable_862;
43 extern union cptable cptable_863;
44 extern union cptable cptable_864;
45 extern union cptable cptable_865;
46 extern union cptable cptable_866;
47 extern union cptable cptable_869;
48 extern union cptable cptable_874;
49 extern union cptable cptable_875;
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_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_10001;
67 extern union cptable cptable_10002;
68 extern union cptable cptable_10003;
69 extern union cptable cptable_10004;
70 extern union cptable cptable_10005;
71 extern union cptable cptable_10006;
72 extern union cptable cptable_10007;
73 extern union cptable cptable_10008;
74 extern union cptable cptable_10010;
75 extern union cptable cptable_10017;
76 extern union cptable cptable_10021;
77 extern union cptable cptable_10029;
78 extern union cptable cptable_10079;
79 extern union cptable cptable_10081;
80 extern union cptable cptable_10082;
81 extern union cptable cptable_20127;
82 extern union cptable cptable_20866;
83 extern union cptable cptable_20932;
84 extern union cptable cptable_21866;
85 extern union cptable cptable_28591;
86 extern union cptable cptable_28592;
87 extern union cptable cptable_28593;
88 extern union cptable cptable_28594;
89 extern union cptable cptable_28595;
90 extern union cptable cptable_28596;
91 extern union cptable cptable_28597;
92 extern union cptable cptable_28598;
93 extern union cptable cptable_28599;
94 extern union cptable cptable_28603;
95 extern union cptable cptable_28605;
97 static const union cptable * const cptables[65] =
99 &cptable_037,
100 &cptable_437,
101 &cptable_500,
102 &cptable_737,
103 &cptable_775,
104 &cptable_850,
105 &cptable_852,
106 &cptable_855,
107 &cptable_857,
108 &cptable_860,
109 &cptable_861,
110 &cptable_862,
111 &cptable_863,
112 &cptable_864,
113 &cptable_865,
114 &cptable_866,
115 &cptable_869,
116 &cptable_874,
117 &cptable_875,
118 &cptable_932,
119 &cptable_936,
120 &cptable_949,
121 &cptable_950,
122 &cptable_1026,
123 &cptable_1250,
124 &cptable_1251,
125 &cptable_1252,
126 &cptable_1253,
127 &cptable_1254,
128 &cptable_1255,
129 &cptable_1256,
130 &cptable_1257,
131 &cptable_1258,
132 &cptable_1361,
133 &cptable_10000,
134 &cptable_10001,
135 &cptable_10002,
136 &cptable_10003,
137 &cptable_10004,
138 &cptable_10005,
139 &cptable_10006,
140 &cptable_10007,
141 &cptable_10008,
142 &cptable_10010,
143 &cptable_10017,
144 &cptable_10021,
145 &cptable_10029,
146 &cptable_10079,
147 &cptable_10081,
148 &cptable_10082,
149 &cptable_20127,
150 &cptable_20866,
151 &cptable_20932,
152 &cptable_21866,
153 &cptable_28591,
154 &cptable_28592,
155 &cptable_28593,
156 &cptable_28594,
157 &cptable_28595,
158 &cptable_28596,
159 &cptable_28597,
160 &cptable_28598,
161 &cptable_28599,
162 &cptable_28603,
163 &cptable_28605,
165 /* ### cpmap end ### */
166 /* Everything above this line is generated automatically by make_unicode */
169 static int cmp_codepage( const void *codepage, const void *entry )
171 return *(const unsigned int *)codepage - (*(const union cptable *const *)entry)->info.codepage;
175 /* get the table of a given code page */
176 const union cptable *wine_cp_get_table_obsolete( unsigned int codepage )
178 const union cptable **res;
180 if (!(res = bsearch( &codepage, cptables, ARRAY_SIZE( cptables ),
181 sizeof(cptables[0]), cmp_codepage ))) return NULL;
182 return *res;
186 /* enum valid codepages */
187 const union cptable *wine_cp_enum_table_obsolete( unsigned int index )
189 if (index >= ARRAY_SIZE( cptables )) return NULL;
190 return cptables[index];
193 int wine_is_dbcs_leadbyte_obsolete( const union cptable *table, unsigned char ch )
195 return (table->info.char_size == 2) && (table->dbcs.cp2uni_leadbytes[ch]);
198 __ASM_OBSOLETE(wine_cp_get_table);
199 __ASM_OBSOLETE(wine_cp_enum_table);
200 __ASM_OBSOLETE(wine_is_dbcs_leadbyte);
202 #endif /* __ASM_OBSOLETE */