2000-06-09 07:27:21 +02:00
|
|
|
/*
|
|
|
|
* Codepage tables
|
|
|
|
*
|
|
|
|
* Copyright 2000 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-06-09 07:27:21 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2020-02-12 09:06:51 +01:00
|
|
|
#include "wine/asm.h"
|
|
|
|
|
|
|
|
#ifdef __ASM_OBSOLETE
|
|
|
|
|
2020-11-29 21:30:08 +01:00
|
|
|
#include "unicode.h"
|
2000-06-09 07:27:21 +02:00
|
|
|
|
2016-02-18 06:33:10 +01:00
|
|
|
/* Everything below this line is generated automatically by make_unicode */
|
2000-06-09 07:27:21 +02:00
|
|
|
/* ### 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;
|
2008-04-08 12:19:27 +02:00
|
|
|
extern union cptable cptable_1361;
|
2000-06-09 07:27:21 +02:00
|
|
|
extern union cptable cptable_10000;
|
2013-06-26 17:41:41 +02:00
|
|
|
extern union cptable cptable_10001;
|
2013-06-26 17:46:35 +02:00
|
|
|
extern union cptable cptable_10002;
|
2013-06-26 17:49:30 +02:00
|
|
|
extern union cptable cptable_10003;
|
2013-08-19 19:00:55 +02:00
|
|
|
extern union cptable cptable_10004;
|
2013-08-19 19:02:01 +02:00
|
|
|
extern union cptable cptable_10005;
|
2000-06-09 07:27:21 +02:00
|
|
|
extern union cptable cptable_10006;
|
|
|
|
extern union cptable cptable_10007;
|
2013-06-26 17:51:47 +02:00
|
|
|
extern union cptable cptable_10008;
|
2013-06-26 13:38:21 +02:00
|
|
|
extern union cptable cptable_10010;
|
2013-06-26 12:49:42 +02:00
|
|
|
extern union cptable cptable_10017;
|
2013-06-26 12:52:33 +02:00
|
|
|
extern union cptable cptable_10021;
|
2000-06-09 07:27:21 +02:00
|
|
|
extern union cptable cptable_10029;
|
|
|
|
extern union cptable cptable_10079;
|
|
|
|
extern union cptable cptable_10081;
|
2013-06-26 12:54:57 +02:00
|
|
|
extern union cptable cptable_10082;
|
2006-06-07 21:12:59 +02:00
|
|
|
extern union cptable cptable_20127;
|
2000-06-09 07:27:21 +02:00
|
|
|
extern union cptable cptable_20866;
|
2002-10-02 03:29:22 +02:00
|
|
|
extern union cptable cptable_20932;
|
2005-01-19 21:59:31 +01:00
|
|
|
extern union cptable cptable_21866;
|
2000-06-09 07:27:21 +02:00
|
|
|
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;
|
2000-11-11 01:34:32 +01:00
|
|
|
extern union cptable cptable_28603;
|
|
|
|
extern union cptable cptable_28605;
|
2000-06-09 07:27:21 +02:00
|
|
|
|
2020-02-10 09:13:04 +01:00
|
|
|
static const union cptable * const cptables[65] =
|
2000-06-09 07:27:21 +02:00
|
|
|
{
|
|
|
|
&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,
|
2008-04-08 12:19:27 +02:00
|
|
|
&cptable_1361,
|
2000-06-09 07:27:21 +02:00
|
|
|
&cptable_10000,
|
2013-06-26 17:41:41 +02:00
|
|
|
&cptable_10001,
|
2013-06-26 17:46:35 +02:00
|
|
|
&cptable_10002,
|
2013-06-26 17:49:30 +02:00
|
|
|
&cptable_10003,
|
2013-08-19 19:00:55 +02:00
|
|
|
&cptable_10004,
|
2013-08-19 19:02:01 +02:00
|
|
|
&cptable_10005,
|
2000-06-09 07:27:21 +02:00
|
|
|
&cptable_10006,
|
|
|
|
&cptable_10007,
|
2013-06-26 17:51:47 +02:00
|
|
|
&cptable_10008,
|
2013-06-26 13:38:21 +02:00
|
|
|
&cptable_10010,
|
2013-06-26 12:49:42 +02:00
|
|
|
&cptable_10017,
|
2013-06-26 12:52:33 +02:00
|
|
|
&cptable_10021,
|
2000-06-09 07:27:21 +02:00
|
|
|
&cptable_10029,
|
|
|
|
&cptable_10079,
|
|
|
|
&cptable_10081,
|
2013-06-26 12:54:57 +02:00
|
|
|
&cptable_10082,
|
2006-06-07 21:12:59 +02:00
|
|
|
&cptable_20127,
|
2000-06-09 07:27:21 +02:00
|
|
|
&cptable_20866,
|
2002-10-02 03:29:22 +02:00
|
|
|
&cptable_20932,
|
2005-01-19 21:59:31 +01:00
|
|
|
&cptable_21866,
|
2000-06-09 07:27:21 +02:00
|
|
|
&cptable_28591,
|
|
|
|
&cptable_28592,
|
|
|
|
&cptable_28593,
|
|
|
|
&cptable_28594,
|
|
|
|
&cptable_28595,
|
|
|
|
&cptable_28596,
|
|
|
|
&cptable_28597,
|
|
|
|
&cptable_28598,
|
|
|
|
&cptable_28599,
|
2000-11-11 01:34:32 +01:00
|
|
|
&cptable_28603,
|
|
|
|
&cptable_28605,
|
2000-06-09 07:27:21 +02:00
|
|
|
};
|
|
|
|
/* ### cpmap end ### */
|
2016-02-18 06:33:10 +01:00
|
|
|
/* Everything above this line is generated automatically by make_unicode */
|
2000-06-09 07:27:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
static int cmp_codepage( const void *codepage, const void *entry )
|
|
|
|
{
|
2006-02-06 13:10:18 +01:00
|
|
|
return *(const unsigned int *)codepage - (*(const union cptable *const *)entry)->info.codepage;
|
2000-06-09 07:27:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* get the table of a given code page */
|
2020-02-12 09:06:51 +01:00
|
|
|
const union cptable *wine_cp_get_table_obsolete( unsigned int codepage )
|
2000-06-09 07:27:21 +02:00
|
|
|
{
|
|
|
|
const union cptable **res;
|
|
|
|
|
2018-11-07 22:31:46 +01:00
|
|
|
if (!(res = bsearch( &codepage, cptables, ARRAY_SIZE( cptables ),
|
2000-06-09 07:27:21 +02:00
|
|
|
sizeof(cptables[0]), cmp_codepage ))) return NULL;
|
|
|
|
return *res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* enum valid codepages */
|
2020-02-12 09:06:51 +01:00
|
|
|
const union cptable *wine_cp_enum_table_obsolete( unsigned int index )
|
2000-06-09 07:27:21 +02:00
|
|
|
{
|
2018-11-07 22:31:46 +01:00
|
|
|
if (index >= ARRAY_SIZE( cptables )) return NULL;
|
2000-06-09 07:27:21 +02:00
|
|
|
return cptables[index];
|
|
|
|
}
|
2020-02-12 09:06:51 +01:00
|
|
|
|
|
|
|
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 */
|