123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- /*
- * Codepage tables
- *
- * Copyright 2000 Alexandre Julliard
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
- #include <stdlib.h>
- #include "wine/asm.h"
- #ifdef __ASM_OBSOLETE
- #include "unicode.h"
- /* Everything below this line is generated automatically by make_unicode */
- /* ### cpmap begin ### */
- extern union cptable cptable_037;
- extern union cptable cptable_437;
- extern union cptable cptable_500;
- extern union cptable cptable_737;
- extern union cptable cptable_775;
- extern union cptable cptable_850;
- extern union cptable cptable_852;
- extern union cptable cptable_855;
- extern union cptable cptable_857;
- extern union cptable cptable_860;
- extern union cptable cptable_861;
- extern union cptable cptable_862;
- extern union cptable cptable_863;
- extern union cptable cptable_864;
- extern union cptable cptable_865;
- extern union cptable cptable_866;
- extern union cptable cptable_869;
- extern union cptable cptable_874;
- extern union cptable cptable_875;
- extern union cptable cptable_932;
- extern union cptable cptable_936;
- extern union cptable cptable_949;
- extern union cptable cptable_950;
- extern union cptable cptable_1026;
- extern union cptable cptable_1250;
- extern union cptable cptable_1251;
- extern union cptable cptable_1252;
- extern union cptable cptable_1253;
- extern union cptable cptable_1254;
- extern union cptable cptable_1255;
- extern union cptable cptable_1256;
- extern union cptable cptable_1257;
- extern union cptable cptable_1258;
- extern union cptable cptable_1361;
- extern union cptable cptable_10000;
- extern union cptable cptable_10001;
- extern union cptable cptable_10002;
- extern union cptable cptable_10003;
- extern union cptable cptable_10004;
- extern union cptable cptable_10005;
- extern union cptable cptable_10006;
- extern union cptable cptable_10007;
- extern union cptable cptable_10008;
- extern union cptable cptable_10010;
- extern union cptable cptable_10017;
- extern union cptable cptable_10021;
- extern union cptable cptable_10029;
- extern union cptable cptable_10079;
- extern union cptable cptable_10081;
- extern union cptable cptable_10082;
- extern union cptable cptable_20127;
- extern union cptable cptable_20866;
- extern union cptable cptable_20932;
- extern union cptable cptable_21866;
- extern union cptable cptable_28591;
- extern union cptable cptable_28592;
- extern union cptable cptable_28593;
- extern union cptable cptable_28594;
- extern union cptable cptable_28595;
- extern union cptable cptable_28596;
- extern union cptable cptable_28597;
- extern union cptable cptable_28598;
- extern union cptable cptable_28599;
- extern union cptable cptable_28603;
- extern union cptable cptable_28605;
- static const union cptable * const cptables[65] =
- {
- &cptable_037,
- &cptable_437,
- &cptable_500,
- &cptable_737,
- &cptable_775,
- &cptable_850,
- &cptable_852,
- &cptable_855,
- &cptable_857,
- &cptable_860,
- &cptable_861,
- &cptable_862,
- &cptable_863,
- &cptable_864,
- &cptable_865,
- &cptable_866,
- &cptable_869,
- &cptable_874,
- &cptable_875,
- &cptable_932,
- &cptable_936,
- &cptable_949,
- &cptable_950,
- &cptable_1026,
- &cptable_1250,
- &cptable_1251,
- &cptable_1252,
- &cptable_1253,
- &cptable_1254,
- &cptable_1255,
- &cptable_1256,
- &cptable_1257,
- &cptable_1258,
- &cptable_1361,
- &cptable_10000,
- &cptable_10001,
- &cptable_10002,
- &cptable_10003,
- &cptable_10004,
- &cptable_10005,
- &cptable_10006,
- &cptable_10007,
- &cptable_10008,
- &cptable_10010,
- &cptable_10017,
- &cptable_10021,
- &cptable_10029,
- &cptable_10079,
- &cptable_10081,
- &cptable_10082,
- &cptable_20127,
- &cptable_20866,
- &cptable_20932,
- &cptable_21866,
- &cptable_28591,
- &cptable_28592,
- &cptable_28593,
- &cptable_28594,
- &cptable_28595,
- &cptable_28596,
- &cptable_28597,
- &cptable_28598,
- &cptable_28599,
- &cptable_28603,
- &cptable_28605,
- };
- /* ### cpmap end ### */
- /* Everything above this line is generated automatically by make_unicode */
- static int cmp_codepage( const void *codepage, const void *entry )
- {
- return *(const unsigned int *)codepage - (*(const union cptable *const *)entry)->info.codepage;
- }
- /* get the table of a given code page */
- const union cptable *wine_cp_get_table_obsolete( unsigned int codepage )
- {
- const union cptable **res;
- if (!(res = bsearch( &codepage, cptables, ARRAY_SIZE( cptables ),
- sizeof(cptables[0]), cmp_codepage ))) return NULL;
- return *res;
- }
- /* enum valid codepages */
- const union cptable *wine_cp_enum_table_obsolete( unsigned int index )
- {
- if (index >= ARRAY_SIZE( cptables )) return NULL;
- return cptables[index];
- }
- int wine_is_dbcs_leadbyte_obsolete( const union cptable *table, unsigned char ch )
- {
- return (table->info.char_size == 2) && (table->dbcs.cp2uni_leadbytes[ch]);
- }
- __ASM_OBSOLETE(wine_cp_get_table);
- __ASM_OBSOLETE(wine_cp_enum_table);
- __ASM_OBSOLETE(wine_is_dbcs_leadbyte);
- #endif /* __ASM_OBSOLETE */
|