/* * Codepage tables * * Copyright 2000 Alexandre Julliard */ #include #include "wine/unicode.h" /* Everything below this line is generated automatically by cpmap.pl */ /* ### cpmap begin ### */ extern struct sbcs_table cptable_037; extern struct sbcs_table cptable_042; extern struct sbcs_table cptable_424; extern struct sbcs_table cptable_437; extern struct sbcs_table cptable_500; extern struct sbcs_table cptable_737; extern struct sbcs_table cptable_775; extern struct sbcs_table cptable_850; extern struct sbcs_table cptable_852; extern struct sbcs_table cptable_855; extern struct sbcs_table cptable_856; extern struct sbcs_table cptable_857; extern struct sbcs_table cptable_860; extern struct sbcs_table cptable_861; extern struct sbcs_table cptable_862; extern struct sbcs_table cptable_863; extern struct sbcs_table cptable_864; extern struct sbcs_table cptable_865; extern struct sbcs_table cptable_866; extern struct sbcs_table cptable_869; extern struct sbcs_table cptable_874; extern struct sbcs_table cptable_875; extern struct sbcs_table cptable_878; extern struct sbcs_table cptable_932; extern struct sbcs_table cptable_936; extern struct sbcs_table cptable_949; extern struct sbcs_table cptable_950; extern struct sbcs_table cptable_1006; extern struct sbcs_table cptable_1026; extern struct sbcs_table cptable_1250; extern struct sbcs_table cptable_1251; extern struct sbcs_table cptable_1252; extern struct sbcs_table cptable_1253; extern struct sbcs_table cptable_1254; extern struct sbcs_table cptable_1255; extern struct sbcs_table cptable_1256; extern struct sbcs_table cptable_1257; extern struct sbcs_table cptable_1258; extern struct sbcs_table cptable_10000; extern struct sbcs_table cptable_10006; extern struct sbcs_table cptable_10007; extern struct sbcs_table cptable_10029; extern struct sbcs_table cptable_10079; extern struct sbcs_table cptable_10081; extern struct sbcs_table cptable_20866; extern struct sbcs_table cptable_28591; extern struct sbcs_table cptable_28592; extern struct sbcs_table cptable_28593; extern struct sbcs_table cptable_28594; extern struct sbcs_table cptable_28595; extern struct sbcs_table cptable_28596; extern struct sbcs_table cptable_28597; extern struct sbcs_table cptable_28598; extern struct sbcs_table cptable_28599; extern struct sbcs_table cptable_28600; extern struct sbcs_table cptable_28603; extern struct sbcs_table cptable_28604; extern struct sbcs_table cptable_28605; static const union cptable * const cptables[58] = { (const union cptable *)&cptable_037, (const union cptable *)&cptable_042, (const union cptable *)&cptable_424, (const union cptable *)&cptable_437, (const union cptable *)&cptable_500, (const union cptable *)&cptable_737, (const union cptable *)&cptable_775, (const union cptable *)&cptable_850, (const union cptable *)&cptable_852, (const union cptable *)&cptable_855, (const union cptable *)&cptable_856, (const union cptable *)&cptable_857, (const union cptable *)&cptable_860, (const union cptable *)&cptable_861, (const union cptable *)&cptable_862, (const union cptable *)&cptable_863, (const union cptable *)&cptable_864, (const union cptable *)&cptable_865, (const union cptable *)&cptable_866, (const union cptable *)&cptable_869, (const union cptable *)&cptable_874, (const union cptable *)&cptable_875, (const union cptable *)&cptable_878, (const union cptable *)&cptable_932, (const union cptable *)&cptable_936, (const union cptable *)&cptable_949, (const union cptable *)&cptable_950, (const union cptable *)&cptable_1006, (const union cptable *)&cptable_1026, (const union cptable *)&cptable_1250, (const union cptable *)&cptable_1251, (const union cptable *)&cptable_1252, (const union cptable *)&cptable_1253, (const union cptable *)&cptable_1254, (const union cptable *)&cptable_1255, (const union cptable *)&cptable_1256, (const union cptable *)&cptable_1257, (const union cptable *)&cptable_1258, (const union cptable *)&cptable_10000, (const union cptable *)&cptable_10006, (const union cptable *)&cptable_10007, (const union cptable *)&cptable_10029, (const union cptable *)&cptable_10079, (const union cptable *)&cptable_10081, (const union cptable *)&cptable_20866, (const union cptable *)&cptable_28591, (const union cptable *)&cptable_28592, (const union cptable *)&cptable_28593, (const union cptable *)&cptable_28594, (const union cptable *)&cptable_28595, (const union cptable *)&cptable_28596, (const union cptable *)&cptable_28597, (const union cptable *)&cptable_28598, (const union cptable *)&cptable_28599, (const union cptable *)&cptable_28600, (const union cptable *)&cptable_28603, (const union cptable *)&cptable_28604, (const union cptable *)&cptable_28605, }; /* ### cpmap end ### */ /* Everything above this line is generated automatically by cpmap.pl */ #define NB_CODEPAGES (sizeof(cptables)/sizeof(cptables[0])) #ifdef __WIN32OS2__ static int _LNK_CONV cmp_codepage( const void *codepage, const void *entry ) #else static int cmp_codepage( const void *codepage, const void *entry ) #endif { return (unsigned int)codepage - (*(union cptable **)entry)->info.codepage; } /* get the table of a given code page */ const union cptable *cp_get_table( unsigned int codepage ) { const union cptable **res; #ifdef __WIN32OS2__ if (!(res = (const union cptable **)bsearch( (void *)codepage, cptables, NB_CODEPAGES, sizeof(cptables[0]), cmp_codepage ))) return NULL; #else if (!(res = bsearch( (void *)codepage, cptables, NB_CODEPAGES, sizeof(cptables[0]), cmp_codepage ))) return NULL; #endif return *res; } /* enum valid codepages */ const union cptable *cp_enum_table( unsigned int index ) { if (index >= NB_CODEPAGES) return NULL; return cptables[index]; }