Added configure check for libutil.h.
[wine.git] / unicode / cptable.c
blob23e61f845c376cfd29255b393b6fbce6cfdefbed
1 /*
2 * Codepage tables
4 * Copyright 2000 Alexandre Julliard
5 */
7 #include <stdlib.h>
9 #include "wine/unicode.h"
11 /* Everything below this line is generated automatically by cpmap.pl */
12 /* ### cpmap begin ### */
13 extern union cptable cptable_037;
14 extern union cptable cptable_042;
15 extern union cptable cptable_424;
16 extern union cptable cptable_437;
17 extern union cptable cptable_500;
18 extern union cptable cptable_737;
19 extern union cptable cptable_775;
20 extern union cptable cptable_850;
21 extern union cptable cptable_852;
22 extern union cptable cptable_855;
23 extern union cptable cptable_856;
24 extern union cptable cptable_857;
25 extern union cptable cptable_860;
26 extern union cptable cptable_861;
27 extern union cptable cptable_862;
28 extern union cptable cptable_863;
29 extern union cptable cptable_864;
30 extern union cptable cptable_865;
31 extern union cptable cptable_866;
32 extern union cptable cptable_869;
33 extern union cptable cptable_874;
34 extern union cptable cptable_875;
35 extern union cptable cptable_878;
36 extern union cptable cptable_932;
37 extern union cptable cptable_936;
38 extern union cptable cptable_949;
39 extern union cptable cptable_950;
40 extern union cptable cptable_1006;
41 extern union cptable cptable_1026;
42 extern union cptable cptable_1250;
43 extern union cptable cptable_1251;
44 extern union cptable cptable_1252;
45 extern union cptable cptable_1253;
46 extern union cptable cptable_1254;
47 extern union cptable cptable_1255;
48 extern union cptable cptable_1256;
49 extern union cptable cptable_1257;
50 extern union cptable cptable_1258;
51 extern union cptable cptable_10000;
52 extern union cptable cptable_10006;
53 extern union cptable cptable_10007;
54 extern union cptable cptable_10029;
55 extern union cptable cptable_10079;
56 extern union cptable cptable_10081;
57 extern union cptable cptable_20866;
58 extern union cptable cptable_28591;
59 extern union cptable cptable_28592;
60 extern union cptable cptable_28593;
61 extern union cptable cptable_28594;
62 extern union cptable cptable_28595;
63 extern union cptable cptable_28596;
64 extern union cptable cptable_28597;
65 extern union cptable cptable_28598;
66 extern union cptable cptable_28599;
68 static const union cptable * const cptables[54] =
70 &cptable_037,
71 &cptable_042,
72 &cptable_424,
73 &cptable_437,
74 &cptable_500,
75 &cptable_737,
76 &cptable_775,
77 &cptable_850,
78 &cptable_852,
79 &cptable_855,
80 &cptable_856,
81 &cptable_857,
82 &cptable_860,
83 &cptable_861,
84 &cptable_862,
85 &cptable_863,
86 &cptable_864,
87 &cptable_865,
88 &cptable_866,
89 &cptable_869,
90 &cptable_874,
91 &cptable_875,
92 &cptable_878,
93 &cptable_932,
94 &cptable_936,
95 &cptable_949,
96 &cptable_950,
97 &cptable_1006,
98 &cptable_1026,
99 &cptable_1250,
100 &cptable_1251,
101 &cptable_1252,
102 &cptable_1253,
103 &cptable_1254,
104 &cptable_1255,
105 &cptable_1256,
106 &cptable_1257,
107 &cptable_1258,
108 &cptable_10000,
109 &cptable_10006,
110 &cptable_10007,
111 &cptable_10029,
112 &cptable_10079,
113 &cptable_10081,
114 &cptable_20866,
115 &cptable_28591,
116 &cptable_28592,
117 &cptable_28593,
118 &cptable_28594,
119 &cptable_28595,
120 &cptable_28596,
121 &cptable_28597,
122 &cptable_28598,
123 &cptable_28599,
125 /* ### cpmap end ### */
126 /* Everything above this line is generated automatically by cpmap.pl */
128 #define NB_CODEPAGES (sizeof(cptables)/sizeof(cptables[0]))
131 static int cmp_codepage( const void *codepage, const void *entry )
133 return (unsigned int)codepage - (*(union cptable **)entry)->info.codepage;
137 /* get the table of a given code page */
138 const union cptable *cp_get_table( unsigned int codepage )
140 const union cptable **res;
142 if (!(res = bsearch( (void *)codepage, cptables, NB_CODEPAGES,
143 sizeof(cptables[0]), cmp_codepage ))) return NULL;
144 return *res;
148 /* enum valid codepages */
149 const union cptable *cp_enum_table( unsigned int index )
151 if (index >= NB_CODEPAGES) return NULL;
152 return cptables[index];