diff -u --recursive --new-file v2.1.59/linux/CREDITS linux/CREDITS --- v2.1.59/linux/CREDITS Wed Oct 15 16:04:23 1997 +++ linux/CREDITS Thu Oct 23 14:00:14 1997 @@ -215,8 +215,9 @@ S: USA N: Gordon Chaffee -E: chaffee@plateau.cs.berkeley.edu -D: vfat filesystem +E: chaffee@bmrc.berkeley.edu +W: http://bmrc.berkeley.edu/people/chaffee/ +D: vfat, fat32, joliet, native language support S: 3674 Oakwood Terrace #201 S: Fremont, California 94536 S: USA diff -u --recursive --new-file v2.1.59/linux/Documentation/Configure.help linux/Documentation/Configure.help --- v2.1.59/linux/Documentation/Configure.help Tue Sep 23 16:48:46 1997 +++ linux/Documentation/Configure.help Thu Oct 23 14:00:14 1997 @@ -4218,6 +4218,154 @@ umsdos.o. Note that the filesystem of your root partition cannot be a module, so this could be dangerous. If unsure, say N. +nls: Native language codepages and Unicode support +CONFIG_NLS + This is required by the FAT filesystems and by the ISO9660 filesystem + when it is compiled with Joliet support. Joliet is a Microsoft + extension for CDROMs that supports Unicode. This allows translation + between different character sets. When dealing with the FAT based + filesystems, there are two character sets that are important. The + first is the codepage. Codepages are character sets that are used by + DOS to allow filenames to have native language characters when + character sets were limited to 256 characters. The codepage is the + character set that is used to store native language characters on + disk. The two most common codepages are 437 in the United States and + 850 in much of Europe. The second important character set is the + input/output character set. This is the character set that is + displayed on the screen. In the United States, this will almost always + be the ISO 8859-1 character set. This is the default. Linux will only + do a translation of the FAT filenames, not the contents of the files. + +nls iso8859-1 +CONFIG_NLS_ISO8859_1 + ISO8859-1 is the Latin 1 character set, and it covers most West + European languages such as Albanian, Catalan, Danish, Dutch, English, + Faeroese, Finnish, French, German, Galician, Irish, Icelandic, Italian, + Norwegian, Portuguese, Spanish, Swedish, and Valencian. + +nls iso8859-2 +CONFIG_NLS_ISO8859_2 + ISO8859-2 is the Latin 2 character set, and it works for most + Latin-written Slavic and Central European languages: Czech, German, + Hungarian, Polish, Rumanian, Croatian, Slovak, Slovene. + +nls iso8859-3 +CONFIG_NLS_ISO8859_3 + ISO8859-3 is the Latin 3 character set, and it s popular with authors + of Esperanto, Galician, Maltese, and Turkish. + +nls iso8859-4 +CONFIG_NLS_ISO8859_4 + ISO8859-4 is the Latin 4 character set, and it introduces letters + for Estonian, Latvian, and Lithuanian. It is an incomplete predecessor of + Latin 6. + +nls iso8859-5 +CONFIG_NLS_ISO8859_5 + ISO8859-5 is a Cyrillic character set, and you can type Bulgarian, + Byelorussian, Macedonian, Russian, Serbian, and Ukrainian. + Note that the charset KOI8-R is preferred in Russia. + +nls iso8859-6 +CONFIG_NLS_ISO8859_6 + ISO8859-6 is the Arabic character set. + +nls iso8859-7 +CONFIG_NLS_ISO8859_7 + ISO8859-7 is the Modern Greek character set. + +nls iso8859-8 +CONFIG_NLS_ISO8859_8 + ISO8859-8 is the Hebrew character set. + +nls iso8859-9 +CONFIG_NLS_ISO8859_9 + ISO8859-9 is the Latin 5 character set, and it replaces the rarely + needed Icelandic letters in Latin 1 with the Turkish ones. Useful in + Turkey. + +nls iso8859-10 +CONFIG_NLS_ISO8859_10 + ISO8859-10 is the Latin 6 character set, and it adds the last Inuit + (Greenlandic) and Sami (Lappish) letters that were missing in Latin 4 to + cover the entire Nordic area. + +nls koi8-r +CONFIG_NLS_KOI8_R + This is the preferred Russian character set. + +nls codepage 437 +CONFIG_NLS_CODEPAGE_437 + This is the DOS codepage that is used in the United States and parts of + Canada. + +nls codepage 737 +CONFIG_NLS_CODEPAGE_737 + This is the codepage used by DOS for Greek. + +nls codepage 775 +CONFIG_NLS_CODEPAGE_775 + This is the codepage used by DOS for the Baltic Rim Languages. + +nls codepage 850 +CONFIG_NLS_CODEPAGE_850 + This is the DOS codepage that is used in much of Europe--United Kingdom, + Germany, Spain, Italy, and [add more countries here]. It has some + characters useful to many European languages that are not part of + codepage 437. + +nls codepage 852 +CONFIG_NLS_CODEPAGE_852 + This is the Latin 2 codepage used by DOS for much of Central and + Eastern Europe. It has all the required characters for these languages: + Albanian, Croatian, Czech, English, Finnish, Hungarian, Irish, German, + Polish, Romanian, Serbian (Latin transcription), Slovak, Slovenian, and + Sorbian. + +nls codepage 855 +CONFIG_NLS_CODEPAGE_855 + This is the DOS codepage that is used for Cyrillic. + +nls codepage 857 +CONFIG_NLS_CODEPAGE_857 + This is the DOS codepage that is used for Turkish. + +nls codepage 860 +CONFIG_NLS_CODEPAGE_860 + This is the DOS codepage that is used for Portuguese. + +nls codepage 861 +CONFIG_NLS_CODEPAGE_861 + This is the DOS codepage that is used for Icelandic. + +nls codepage 862 +CONFIG_NLS_CODEPAGE_862 + This is the DOS codepage that is used for Hebrew. + +nls codepage 863 +CONFIG_NLS_CODEPAGE_863 + This is the DOS codepage that is used for Canadian French. + +nls codepage 864 +CONFIG_NLS_CODEPAGE_864 + This is the DOS codepage that is used for Arabic. + +nls codepage 865 +CONFIG_NLS_CODEPAGE_865 + This is the DOS codepage that is used in the Nordic European countries. + +nls codepage 866 +CONFIG_NLS_CODEPAGE_866 + This is the DOS codepage that is used for Cyrillic/Russian. + +nls codepage 869 +CONFIG_NLS_CODEPAGE_869 + This is the DOS codepage that is used for Greek. + +nls codepage 874 +CONFIG_NLS_CODEPAGE_874 + This is the DOS codepage that is used for Thai. + /proc filesystem support CONFIG_PROC_FS This is a virtual filesystem providing information about the status diff -u --recursive --new-file v2.1.59/linux/Documentation/filesystems/00-INDEX linux/Documentation/filesystems/00-INDEX --- v2.1.59/linux/Documentation/filesystems/00-INDEX Fri Jan 3 03:03:41 1997 +++ linux/Documentation/filesystems/00-INDEX Thu Oct 23 14:00:14 1997 @@ -4,6 +4,8 @@ - info and mount options for the Amiga Fast File System. hpfs.txt - info and mount options for the OS/2 HPFS. +isofs.txt + - info and mount options for the ISO9660 (CDROM) filesystem. ncpfs.txt - info on Novell Netware(tm) filesystem using NCP protocol. romfs.txt diff -u --recursive --new-file v2.1.59/linux/Documentation/filesystems/vfat.txt linux/Documentation/filesystems/vfat.txt --- v2.1.59/linux/Documentation/filesystems/vfat.txt Thu Apr 11 23:49:29 1996 +++ linux/Documentation/filesystems/vfat.txt Thu Oct 23 14:00:14 1997 @@ -8,7 +8,20 @@ VFAT MOUNT OPTIONS ---------------------------------------------------------------------- -uni_xlate -- Translate unhandled Unicode characters to special +codepage=### -- Sets the codepage for converting to shortname characters + on FAT and VFAT filesystems. By default, codepage 437 + is used. This is the default for the U.S. and some + European countries. +iocharset=name -- Character set to use for converting between 8 bit characters + and 16 bit Unicode characters. Long filenames are stored on + disk in Unicode format, but Unix for the most part doesn't + know how to deal with Unicode. There is also an option of + doing UTF8 translations with the utf8 option. +utf8= -- UTF8 is the filesystem safe version of Unicode that + is used by the console. It can be be enabled for the + filesystem with this option. If 'uni_xlate' gets set, + UTF8 gets disabled. +uni_xlate= -- Translate unhandled Unicode characters to special escaped sequences. This would let you backup and restore filenames that are created with any Unicode characters. Until Linux supports Unicode for real, @@ -18,11 +31,11 @@ illegal on the vfat filesystem. The escape sequence that gets used, where u is the unicode character, is: ':', (u & 0x3f), ((u>>6) & 0x3f), (u>>12), -posix -- Allow names of same letters, different case such as +posix= -- Allow names of same letters, different case such as 'LongFileName' and 'longfilename' to coexist. This has some problems currently because 8.3 conflicts are not handled correctly for Posix filesystem compliance. -nonumtail -- When creating 8.3 aliases, normally the alias will +nonumtail= -- When creating 8.3 aliases, normally the alias will end in '~1' or tilde followed by some number. If this option is set, then if the filename is "longfilename.txt" and "longfile.txt" does not @@ -31,19 +44,19 @@ quiet -- Stops printing certain warning messages. +: 0,1,yes,no,true,false TODO ---------------------------------------------------------------------- +* When only shortnames exist, translate them from the codepage character + set to the iocharset. Currently, translations only occur when longnames + exist. To translate, first convert from codepage to Unicode and then + to the output character set. + * Need to get rid of the raw scanning stuff. Instead, always use a get next directory entry approach. The only thing left that uses raw scanning is the directory renaming code. -* Need to add dcache_lookup code msdos filesystem. This means the - directories need to be versioned like the vfat filesystem. - -* Add support for different codepages. Right now, we only support - the a single English codepage. - * Fix the Posix filesystem support to work in 8.3 space. This involves renaming aliases if a conflict occurs between a new filename and an old alias. This is quite a mess. @@ -55,11 +68,12 @@ * When a volume name is the same as a directory name in the root directory of the filesystem, the directory name sometimes shows up empty an empty file. +* autoconv option does not work correctly. BUG REPORTS ---------------------------------------------------------------------- If you have trouble with the VFAT filesystem, mail bug reports to -chaffee@bugs-bunny.cs.berkeley.edu. Please specify the filename +chaffee@bmrc.cs.berkeley.edu. Please specify the filename and the operation that gave you trouble. TEST SUITE @@ -67,7 +81,7 @@ If you plan to make any modifications to the vfat filesystem, please get the test suite that comes with the vfat distribution at - http://www-plateau.cs.berkeley.edu/people/chaffee/vfat.html + http://bmrc.berkeley.edu/people/chaffee/vfat.html This tests quite a few parts of the vfat filesystem and additional tests for new features or untested features would be appreciated. @@ -194,271 +208,3 @@ Finally, note that the extended name is stored in Unicode. Each Unicode character takes two bytes. - - -NOTES ON UNICODE TRANSLATION IN VFAT FILESYSTEM ----------------------------------------------------------------------- -(Information provided by Steve Searle ) - -Char used as Char(s) used Char(s) used in Entries which have -filename in shortname longname slot been corrected -0x80 (128) 0x80 0xC7 -0x81 (129) 0x9A 0xFC -0x82 (130) 0x90 0xE9 E -0x83 (131) 0xB6 0xE2 E -0x84 (132) 0x8E 0xE4 E -0x85 (133) 0xB7 0xE0 E -0x86 (134) 0x8F 0xE5 E -0x87 (135) 0x80 0xE7 E -0x88 (136) 0xD2 0xEA E -0x89 (137) 0xD3 0xEB E -0x8A (138) 0xD4 0xE8 E -0x8B (139) 0xD8 0xEF E -0x8C (140) 0xD7 0xEE E -0x8D (141) 0xDE 0xEC E -0x8E (142) 0x8E 0xC4 E -0x8F (143) 0x8F 0xC5 E -0x90 (144) 0x90 0xC9 E -0x91 (145) 0x92 0xE6 E -0x92 (146) 0x92 0xC6 E -0x93 (147) 0xE2 0xF4 E -0x94 (148) 0x99 0xF6 -0x95 (149) 0xE3 0xF2 -0x96 (150) 0xEA 0xFB -0x97 (151) 0xEB 0xF9 -0x98 (152) "_~1" 0xFF -0x99 (153) 0x99 0xD6 -0x9A (154) 0x9A 0xDC -0x9B (155) 0x9D 0xF8 -0x9C (156) 0x9C 0xA3 -0x9D (157) 0x9D 0xD8 -0x9E (158) 0x9E 0xD7 -0x9F (159) 0x9F 0x92 -0xA0 (160) 0xB5 0xE1 -0xA1 (161) 0xD6 0xE0 -0xA2 (162) 0xE0 0xF3 -0xA3 (163) 0xE9 0xFA -0xA4 (164) 0xA5 0xF1 -0xA5 (165) 0xA5 0xD1 -0xA6 (166) 0xA6 0xAA -0xA7 (167) 0xA7 0xBA -0xA8 (168) 0xA8 0xBF -0xA9 (169) 0xA9 0xAE -0xAA (170) 0xAA 0xAC -0xAB (171) 0xAB 0xBD -0xAC (172) 0xAC 0xBC -0xAD (173) 0xAD 0xA1 -0xAE (174) 0xAE 0xAB -0xAF (175) 0xAF 0xBB -0xB0 (176) 0xB0 0x91 0x25 -0xB1 (177) 0xB1 0x92 0x25 -0xB2 (178) 0xB2 0x93 0x25 -0xB3 (179) 0xB3 0x02 0x25 -0xB4 (180) 0xB4 0x24 0x25 -0xB5 (181) 0xB5 0xC1 -0xB6 (182) 0xB6 0xC2 -0xB7 (183) 0xB7 0xC0 -0xB8 (184) 0xB8 0xA9 -0xB9 (185) 0xB9 0x63 0x25 -0xBA (186) 0xBA 0x51 0x25 -0xBB (187) 0xBB 0x57 0x25 -0xBC (188) 0xBC 0x5D 0x25 -0xBD (189) 0xBD 0xA2 -0xBE (190) 0xBE 0xA5 -0xBF (191) 0xBF 0x10 0x25 -0xC0 (192) 0xC0 0x14 0x25 -0xC1 (193) 0xC1 0x34 0x25 -0xC2 (194) 0xC2 0x2C 0x25 -0xC3 (195) 0xC3 0x1C 0x25 -0xC4 (196) 0xC4 0x00 0x25 -0xC5 (197) 0xC5 0x3C 0x25 -0xC6 (198) 0xC7 0xE3 E -0xC7 (199) 0xC7 0xC3 -0xC8 (200) 0xC8 0x5A 0x25 E -0xC9 (201) 0xC9 0x54 0x25 E -0xCA (202) 0xCA 0x69 0x25 E -0xCB (203) 0xCB 0x66 0x25 E -0xCC (204) 0xCC 0x60 0x25 E -0xCD (205) 0xCD 0x50 0x25 E -0xCE (206) 0xCE 0x6C 0x25 E -0xCF (207) 0xCF 0xA4 E -0xD0 (208) 0xD1 0xF0 -0xD1 (209) 0xD1 0xD0 -0xD2 (210) 0xD2 0xCA -0xD3 (211) 0xD3 0xCB -0xD4 (212) 0xD4 0xC8 -0xD5 (213) 0x49 0x31 0x01 -0xD6 (214) 0xD6 0xCD -0xD7 (215) 0xD7 0xCE -0xD8 (216) 0xD8 0xCF -0xD9 (217) 0xD9 0x18 0x25 -0xDA (218) 0xDA 0x0C 0x25 -0xDB (219) 0xDB 0x88 0x25 -0xDC (220) 0xDC 0x84 0x25 -0xDD (221) 0xDD 0xA6 -0xDE (222) 0xDE 0xCC -0xDF (223) 0xDF 0x80 0x25 -0xE0 (224) 0xE0 0xD3 -0xE1 (225) 0xE1 0xDF -0xE2 (226) 0xE2 0xD4 -0xE3 (227) 0xE3 0xD2 -0xE4 (228) 0x05 0xF5 -0xE5 (229) 0x05 0xD5 -0xE6 (230) 0xE6 0xB5 -0xE7 (231) 0xE8 0xFE -0xE8 (232) 0xE8 0xDE -0xE9 (233) 0xE9 0xDA -0xEA (234) 0xEA 0xDB -0xEB (235) 0xEB 0xD9 -0xEC (236) 0xED 0xFD -0xED (237) 0xED 0xDD -0xEE (238) 0xEE 0xAF -0xEF (239) 0xEF 0xB4 -0xF0 (240) 0xF0 0xAD -0xF1 (241) 0xF1 0xB1 -0xF2 (242) 0xF2 0x17 0x20 -0xF3 (243) 0xF3 0xBE -0xF4 (244) 0xF4 0xB6 -0xF5 (245) 0xF5 0xA7 -0xF6 (246) 0xF6 0xF7 -0xF7 (247) 0xF7 0xB8 -0xF8 (248) 0xF8 0xB0 -0xF9 (249) 0xF9 0xA8 -0xFA (250) 0xFA 0xB7 -0xFB (251) 0xFB 0xB9 -0xFC (252) 0xFC 0xB3 -0xFD (253) 0xFD 0xB2 -0xFE (254) 0xFE 0xA0 0x25 -0xFF (255) 0xFF 0xA0 - - -Page 0 -0x80 (128) 0x00 -0x81 (129) 0x00 -0x82 (130) 0x00 -0x83 (131) 0x00 -0x84 (132) 0x00 -0x85 (133) 0x00 -0x86 (134) 0x00 -0x87 (135) 0x00 -0x88 (136) 0x00 -0x89 (137) 0x00 -0x8A (138) 0x00 -0x8B (139) 0x00 -0x8C (140) 0x00 -0x8D (141) 0x00 -0x8E (142) 0x00 -0x8F (143) 0x00 -0x90 (144) 0x00 -0x91 (145) 0x00 -0x92 (146) 0x00 -0x93 (147) 0x00 -0x94 (148) 0x00 -0x95 (149) 0x00 -0x96 (150) 0x00 -0x97 (151) 0x00 -0x98 (152) 0x00 -0x99 (153) 0x00 -0x9A (154) 0x00 -0x9B (155) 0x00 -0x9C (156) 0x00 -0x9D (157) 0x00 -0x9E (158) 0x00 -0x9F (159) 0x92 -0xA0 (160) 0xFF -0xA1 (161) 0xAD -0xA2 (162) 0xBD -0xA3 (163) 0x9C -0xA4 (164) 0xCF -0xA5 (165) 0xBE -0xA6 (166) 0xDD -0xA7 (167) 0xF5 -0xA8 (168) 0xF9 -0xA9 (169) 0xB8 -0xAA (170) 0x00 -0xAB (171) 0xAE -0xAC (172) 0xAA -0xAD (173) 0xF0 -0xAE (174) 0x00 -0xAF (175) 0xEE -0xB0 (176) 0xF8 -0xB1 (177) 0xF1 -0xB2 (178) 0xFD -0xB3 (179) 0xFC -0xB4 (180) 0xEF -0xB5 (181) 0xE6 -0xB6 (182) 0xF4 -0xB7 (183) 0xFA -0xB8 (184) 0xF7 -0xB9 (185) 0xFB -0xBA (186) 0x00 -0xBB (187) 0xAF -0xBC (188) 0xAC -0xBD (189) 0xAB -0xBE (190) 0xF3 -0xBF (191) 0x00 -0xC0 (192) 0xB7 -0xC1 (193) 0xB5 -0xC2 (194) 0xB6 -0xC3 (195) 0xC7 -0xC4 (196) 0x8E -0xC5 (197) 0x8F -0xC6 (198) 0x92 -0xC7 (199) 0x80 -0xC8 (200) 0xD4 -0xC9 (201) 0x90 -0xCA (202) 0xD2 -0xCB (203) 0xD3 -0xCC (204) 0xDE -0xCD (205) 0xD6 -0xCE (206) 0xD7 -0xCF (207) 0xD8 -0xD0 (208) 0x00 -0xD1 (209) 0xA5 -0xD2 (210) 0xE3 -0xD3 (211) 0xE0 -0xD4 (212) 0xE2 -0xD5 (213) 0xE5 -0xD6 (214) 0x99 -0xD7 (215) 0x9E -0xD8 (216) 0x9D -0xD9 (217) 0xEB -0xDA (218) 0xE9 -0xDB (219) 0xEA -0xDC (220) 0x9A -0xDD (221) 0xED -0xDE (222) 0xE8 -0xDF (223) 0xE1 -0xE0 (224) 0x85, 0xA1 -0xE1 (225) 0xA0 -0xE2 (226) 0x83 -0xE3 (227) 0xC6 -0xE4 (228) 0x84 -0xE5 (229) 0x86 -0xE6 (230) 0x91 -0xE7 (231) 0x87 -0xE8 (232) 0x8A -0xE9 (233) 0x82 -0xEA (234) 0x88 -0xEB (235) 0x89 -0xEC (236) 0x8D -0xED (237) 0x00 -0xEE (238) 0x8C -0xEF (239) 0x8B -0xF0 (240) 0xD0 -0xF1 (241) 0xA4 -0xF2 (242) 0x95 -0xF3 (243) 0xA2 -0xF4 (244) 0x93 -0xF5 (245) 0xE4 -0xF6 (246) 0x94 -0xF7 (247) 0xF6 -0xF8 (248) 0x9B -0xF9 (249) 0x97 -0xFA (250) 0xA3 -0xFB (251) 0x96 -0xFC (252) 0x81 -0xFD (253) 0xEC -0xFE (254) 0xE7 -0xFF (255) 0x98 - diff -u --recursive --new-file v2.1.59/linux/Makefile linux/Makefile --- v2.1.59/linux/Makefile Mon Oct 20 10:36:52 1997 +++ linux/Makefile Thu Oct 23 14:00:14 1997 @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 1 -SUBLEVEL = 59 +SUBLEVEL = 60 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/) @@ -308,6 +308,7 @@ if [ -f IPV6_MODULES ]; then inst_mod IPV6_MODULES ipv6; fi; \ if [ -f SCSI_MODULES ]; then inst_mod SCSI_MODULES scsi; fi; \ if [ -f FS_MODULES ]; then inst_mod FS_MODULES fs; fi; \ + if [ -f NLS_MODULES ]; then inst_mod NLS_MODULES fs; fi; \ if [ -f CDROM_MODULES ]; then inst_mod CDROM_MODULES cdrom; fi; \ \ ls *.o > .allmods; \ diff -u --recursive --new-file v2.1.59/linux/arch/alpha/config.in linux/arch/alpha/config.in --- v2.1.59/linux/arch/alpha/config.in Wed Sep 3 20:52:41 1997 +++ linux/arch/alpha/config.in Thu Oct 23 14:00:14 1997 @@ -154,6 +154,8 @@ source fs/Config.in +source fs/nls/Config.in + source drivers/char/Config.in if [ "$CONFIG_RTC" != "n" ]; then bool ' ARC console time' CONFIG_RTC_ARC y diff -u --recursive --new-file v2.1.59/linux/arch/alpha/kernel/entry.S linux/arch/alpha/kernel/entry.S --- v2.1.59/linux/arch/alpha/kernel/entry.S Wed Sep 24 20:05:45 1997 +++ linux/arch/alpha/kernel/entry.S Tue Oct 21 08:57:28 1997 @@ -10,7 +10,7 @@ #define rti .long PAL_rti #define SIGCHLD 20 -#define NR_SYSCALLS 350 +#define NR_SYSCALLS 352 #define osf_vfork sys_fork /* @@ -771,5 +771,5 @@ .quad sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, do_entSys /* sys_afs_syscall */, sys_newuname .quad sys_nanosleep, sys_mremap, sys_nfsservctl, sys_setresuid, sys_getresuid .quad sys_pciconfig_read, sys_pciconfig_write, sys_query_module - .quad sys_prctl + .quad sys_prctl, sys_pread, sys_pwrite .quad do_entSys, do_entSys diff -u --recursive --new-file v2.1.59/linux/arch/i386/config.in linux/arch/i386/config.in --- v2.1.59/linux/arch/i386/config.in Sun Sep 7 13:10:42 1997 +++ linux/arch/i386/config.in Thu Oct 23 14:00:14 1997 @@ -104,6 +104,8 @@ source fs/Config.in +source fs/nls/Config.in + source drivers/char/Config.in mainmenu_option next_comment diff -u --recursive --new-file v2.1.59/linux/arch/m68k/config.in linux/arch/m68k/config.in --- v2.1.59/linux/arch/m68k/config.in Wed Sep 3 20:52:42 1997 +++ linux/arch/m68k/config.in Thu Oct 23 14:00:14 1997 @@ -209,6 +209,8 @@ source fs/Config.in +source fs/nls/Config.in + mainmenu_option next_comment comment 'Character devices' diff -u --recursive --new-file v2.1.59/linux/arch/mips/config.in linux/arch/mips/config.in --- v2.1.59/linux/arch/mips/config.in Wed Sep 3 20:52:42 1997 +++ linux/arch/mips/config.in Thu Oct 23 14:00:14 1997 @@ -181,6 +181,8 @@ source fs/Config.in +source fs/nls/Config.in + if [ "$CONFIG_SGI" != "y" ]; then source drivers/char/Config.in diff -u --recursive --new-file v2.1.59/linux/arch/mips/kernel/irixelf.c linux/arch/mips/kernel/irixelf.c --- v2.1.59/linux/arch/mips/kernel/irixelf.c Mon Aug 4 16:25:36 1997 +++ linux/arch/mips/kernel/irixelf.c Mon Oct 20 10:12:00 1997 @@ -683,9 +683,12 @@ } } - /* OK, This is the point of no return. */ - flush_old_exec(bprm); + /* Flush all traces of the currently running executable */ + retval = flush_old_exec(bprm); + if (retval) + return retval; + /* OK, This is the point of no return */ current->mm->end_data = 0; current->mm->end_code = 0; current->mm->start_mmap = ELF_START_MMAP; diff -u --recursive --new-file v2.1.59/linux/arch/ppc/config.in linux/arch/ppc/config.in --- v2.1.59/linux/arch/ppc/config.in Thu Sep 4 17:07:29 1997 +++ linux/arch/ppc/config.in Thu Oct 23 14:00:14 1997 @@ -108,6 +108,8 @@ source fs/Config.in +source fs/nls/Config.in + source drivers/char/Config.in mainmenu_option next_comment diff -u --recursive --new-file v2.1.59/linux/arch/sparc/config.in linux/arch/sparc/config.in --- v2.1.59/linux/arch/sparc/config.in Thu Sep 4 17:07:30 1997 +++ linux/arch/sparc/config.in Thu Oct 23 14:00:14 1997 @@ -145,6 +145,8 @@ source fs/Config.in +source fs/nls/Config.in + mainmenu_option next_comment comment 'Watchdog' diff -u --recursive --new-file v2.1.59/linux/arch/sparc64/config.in linux/arch/sparc64/config.in --- v2.1.59/linux/arch/sparc64/config.in Thu Sep 4 17:07:30 1997 +++ linux/arch/sparc64/config.in Thu Oct 23 14:00:14 1997 @@ -183,6 +183,8 @@ source fs/Config.in +source fs/nls/Config.in + mainmenu_option next_comment comment 'Kernel hacking' diff -u --recursive --new-file v2.1.59/linux/arch/sparc64/kernel/binfmt_aout32.c linux/arch/sparc64/kernel/binfmt_aout32.c --- v2.1.59/linux/arch/sparc64/kernel/binfmt_aout32.c Thu Jul 17 10:06:04 1997 +++ linux/arch/sparc64/kernel/binfmt_aout32.c Mon Oct 20 10:12:00 1997 @@ -256,6 +256,7 @@ unsigned long p = bprm->p; unsigned long fd_offset; unsigned long rlim; + int retval; ex = *((struct exec *) bprm->buf); /* exec-header */ if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && @@ -278,8 +279,12 @@ if (ex.a_data + ex.a_bss > rlim) return -ENOMEM; + /* Flush all traces of the currently running executable */ + retval = flush_old_exec(bprm); + if (retval) + return retval; + /* OK, This is the point of no return */ - flush_old_exec(bprm); memcpy(¤t->tss.core_exec, &ex, sizeof(struct exec)); current->mm->end_code = ex.a_text + diff -u --recursive --new-file v2.1.59/linux/drivers/block/floppy.c linux/drivers/block/floppy.c --- v2.1.59/linux/drivers/block/floppy.c Wed Sep 24 20:05:46 1997 +++ linux/drivers/block/floppy.c Tue Oct 21 08:57:28 1997 @@ -3463,20 +3463,22 @@ printk("\n"); } -static long floppy_read(struct inode * inode, struct file * filp, - char * buf, unsigned long count) +static ssize_t floppy_read(struct file * filp, char *buf, + size_t count, loff_t *ppos) { + struct inode *inode = filp->f_dentry->d_inode; int drive = DRIVE(inode->i_rdev); check_disk_change(inode->i_rdev); if (UTESTF(FD_DISK_CHANGED)) return -ENXIO; - return block_read(inode, filp, buf, count); + return block_read(filp, buf, count, ppos); } -static long floppy_write(struct inode * inode, struct file * filp, - const char * buf, unsigned long count) +static ssize_t floppy_write(struct file * filp, const char * buf, + size_t count, loff_t *ppos) { + struct inode * inode = filp->f_dentry->d_inode; int block; int ret; int drive = DRIVE(inode->i_rdev); @@ -3488,9 +3490,9 @@ return -ENXIO; if (!UTESTF(FD_DISK_WRITABLE)) return -EROFS; - block = (filp->f_pos + count) >> 9; + block = (*ppos + count) >> 9; INFBOUND(UDRS->maxblock, block); - ret= block_write(inode, filp, buf, count); + ret= block_write(filp, buf, count, ppos); return ret; } diff -u --recursive --new-file v2.1.59/linux/drivers/block/ide-tape.c linux/drivers/block/ide-tape.c --- v2.1.59/linux/drivers/block/ide-tape.c Tue May 13 22:41:05 1997 +++ linux/drivers/block/ide-tape.c Tue Oct 21 08:57:28 1997 @@ -2883,11 +2883,18 @@ * size will only result in a (slightly) increased driver overhead, but * will no longer hit performance. */ -static long idetape_chrdev_read (struct inode *inode, struct file *file, char *buf, unsigned long count) +static ssize_t idetape_chrdev_read (struct file *file, char *buf, + size_t count, loff_t *ppos) { + struct inode *inode = file->f_dentry->d_inode; ide_drive_t *drive = get_drive_ptr (inode->i_rdev); idetape_tape_t *tape = drive->driver_data; - int bytes_read,temp,actually_read=0; + ssize_t bytes_read,temp,actually_read=0; + + if (ppos != &file->f_pos) { + /* "A request was outside the capabilities of the device." */ + return -ENXIO; + } #if IDETAPE_DEBUG_LOG printk (KERN_INFO "Reached idetape_chrdev_read\n"); @@ -2953,11 +2960,18 @@ return (actually_read); } -static long idetape_chrdev_write (struct inode *inode, struct file *file, const char *buf, unsigned long count) +static ssize_t idetape_chrdev_write (struct file *file, const char *buf, + size_t count, loff_t *ppos) { + struct inode *inode = file->f_dentry->d_inode; ide_drive_t *drive = get_drive_ptr (inode->i_rdev); idetape_tape_t *tape = drive->driver_data; - int retval,actually_written=0; + ssize_t retval,actually_written=0; + + if (ppos != &file->f_pos) { + /* "A request was outside the capabilities of the device." */ + return -ENXIO; + } #if IDETAPE_DEBUG_LOG printk (KERN_INFO "Reached idetape_chrdev_write\n"); diff -u --recursive --new-file v2.1.59/linux/drivers/block/md.c linux/drivers/block/md.c --- v2.1.59/linux/drivers/block/md.c Thu Jul 17 10:06:04 1997 +++ linux/drivers/block/md.c Tue Oct 21 08:57:28 1997 @@ -374,26 +374,26 @@ } -static long md_read (struct inode *inode, struct file *file, - char *buf, unsigned long count) +static ssize_t md_read (struct file *file, char *buf, size_t count, + loff_t *ppos) { - int minor=MINOR(inode->i_rdev); + int minor=MINOR(file->f_dentry->d_inode->i_rdev); if (!md_dev[minor].pers) /* Check if device is being run */ return -ENXIO; - return block_read (inode, file, buf, count); + return block_read(file, buf, count, ppos); } -static long md_write (struct inode *inode, struct file *file, - const char *buf, unsigned long count) +static ssize_t md_write (struct file *file, const char *buf, + size_t count, loff_t *ppos) { - int minor=MINOR(inode->i_rdev); + int minor=MINOR(file->f_dentry->d_inode->i_rdev); if (!md_dev[minor].pers) /* Check if device is being run */ return -ENXIO; - return block_write (inode, file, buf, count); + return block_write(file, buf, count, ppos); } static struct file_operations md_fops= diff -u --recursive --new-file v2.1.59/linux/drivers/block/rd.c linux/drivers/block/rd.c --- v2.1.59/linux/drivers/block/rd.c Tue Sep 23 16:48:47 1997 +++ linux/drivers/block/rd.c Tue Oct 21 08:57:28 1997 @@ -184,16 +184,16 @@ #ifdef CONFIG_BLK_DEV_INITRD -static long initrd_read(struct inode *inode,struct file *file, - char *buf, unsigned long count) +static ssize_t initrd_read(struct file *file, char *buf, + size_t count, loff_t *ppos) { int left; - left = initrd_end-initrd_start-file->f_pos; + left = initrd_end - initrd_start - *ppos; if (count > left) count = left; if (count == 0) return 0; - copy_to_user(buf,(char *) initrd_start+file->f_pos,count); - file->f_pos += count; + copy_to_user(buf, (char *)initrd_start + *ppos, count); + *ppos += count; return count; } @@ -363,7 +363,7 @@ fp->f_op->llseek(fp, start_block * BLOCK_SIZE, 0); fp->f_pos = start_block * BLOCK_SIZE; - fp->f_op->read(fp->f_dentry->d_inode, fp, buf, size); + fp->f_op->read(fp, buf, size, &fp->f_pos); /* * If it matches the gzip magic numbers, return -1 @@ -393,7 +393,7 @@ fp->f_op->llseek(fp, (start_block+1) * BLOCK_SIZE, 0); fp->f_pos = (start_block+1) * BLOCK_SIZE; - fp->f_op->read(fp->f_dentry->d_inode, fp, buf, size); + fp->f_op->read(fp, buf, size, &fp->f_pos); /* Try minix */ if (minixsb->s_magic == MINIX_SUPER_MAGIC || @@ -510,10 +510,8 @@ printk(KERN_NOTICE "RAMDISK: Loading %d blocks into ram disk... ", nblocks); for (i=0; i < nblocks; i++) { - infile.f_op->read(infile.f_dentry->d_inode, &infile, buf, - BLOCK_SIZE); - outfile.f_op->write(outfile.f_dentry->d_inode, &outfile, buf, - BLOCK_SIZE); + infile.f_op->read(&infile, buf, BLOCK_SIZE, &infile.f_pos); + outfile.f_op->write(&outfile, buf, BLOCK_SIZE, &outfile.f_pos); if (!(i % 16)) { printk("%c\b", rotator[rotate & 0x3]); rotate++; @@ -641,8 +639,8 @@ { if (exit_code) return -1; - insize = crd_infp->f_op->read(crd_infp->f_dentry->d_inode, crd_infp, - inbuf, INBUFSIZ); + insize = crd_infp->f_op->read(crd_infp, inbuf, INBUFSIZ, + &crd_infp->f_pos); if (insize == 0) return -1; inptr = 1; @@ -660,8 +658,7 @@ unsigned n; uch *in, ch; - crd_outfp->f_op->write(crd_outfp->f_dentry->d_inode, crd_outfp, window, - outcnt); + crd_outfp->f_op->write(crd_outfp, window, outcnt, &crd_outfp->f_pos); in = window; for (n = 0; n < outcnt; n++) { ch = *in++; diff -u --recursive --new-file v2.1.59/linux/drivers/char/mem.c linux/drivers/char/mem.c --- v2.1.59/linux/drivers/char/mem.c Tue Sep 23 16:48:47 1997 +++ linux/drivers/char/mem.c Tue Oct 21 08:57:28 1997 @@ -36,11 +36,10 @@ void pcwatchdog_init(void); #endif -static long do_write_mem(struct file * file, - void *p, unsigned long realp, - const char * buf, unsigned long count) +static ssize_t do_write_mem(struct file * file, void *p, unsigned long realp, + const char * buf, size_t count, loff_t *ppos) { - unsigned long written; + ssize_t written; written = 0; #if defined(__sparc__) || defined(__mc68000__) @@ -58,8 +57,8 @@ if (copy_from_user(p, buf, count) < 0) return -EFAULT; written += count; - file->f_pos += written; - return count; + *ppos += written; + return written; } @@ -67,12 +66,12 @@ * This funcion reads the *physical* memory. The f_pos points directly to the * memory location. */ -static long read_mem(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t read_mem(struct file * file, char * buf, + size_t count, loff_t *ppos) { - unsigned long p = file->f_pos; + unsigned long p = *ppos; unsigned long end_mem; - unsigned long read; + ssize_t read; end_mem = __pa(high_memory); if (p >= end_mem) @@ -99,14 +98,14 @@ if (copy_to_user(buf, __va(p), count) < 0) return -EFAULT; read += count; - file->f_pos += read; + *ppos += read; return read; } -static long write_mem(struct inode * inode, struct file * file, - const char * buf, unsigned long count) +static ssize_t write_mem(struct file * file, const char * buf, + size_t count, loff_t *ppos) { - unsigned long p = file->f_pos; + unsigned long p = *ppos; unsigned long end_mem; end_mem = __pa(high_memory); @@ -114,7 +113,7 @@ return 0; if (count > end_mem - p) count = end_mem - p; - return do_write_mem(file,__va(p),p,buf,count); + return do_write_mem(file, __va(p), p, buf, count, ppos); } static int mmap_mem(struct file * file, struct vm_area_struct * vma) @@ -135,9 +134,10 @@ #endif #ifdef __powerpc__ if (offset >= __pa(high_memory)) - pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE | _PAGE_GUARDED; + pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE|_PAGE_GUARDED; #endif - if (remap_page_range(vma->vm_start, offset, vma->vm_end - vma->vm_start, vma->vm_page_prot)) + if (remap_page_range(vma->vm_start, offset, vma->vm_end-vma->vm_start, + vma->vm_page_prot)) return -EAGAIN; vma->vm_dentry = dget(file->f_dentry); return 0; @@ -146,61 +146,63 @@ /* * This function reads the *virtual* memory as seen by the kernel. */ -static long read_kmem(struct inode *inode, struct file *file, - char *buf, unsigned long count) +static ssize_t read_kmem(struct file *file, char *buf, + size_t count, loff_t *ppos) { - unsigned long p = file->f_pos; - unsigned long read = 0; - long virtr; + unsigned long p = *ppos; + ssize_t read = 0; + ssize_t virtr; if (p < (unsigned long) high_memory) { - unsigned long tmp; - + read = count; if (count > (unsigned long) high_memory - p) - tmp = (unsigned long) high_memory - p; - else - tmp = count; - read = tmp; + read = (unsigned long) high_memory - p; + #if defined(__sparc__) || defined(__mc68000__) /* we don't have page 0 mapped on sparc and m68k.. */ - while (p < PAGE_SIZE && tmp > 0) { - put_user(0,buf); - buf++; - p++; - tmp--; + if (p < PAGE_SIZE && read > 0) { + size_t tmp = PAGE_SIZE - p; + if (tmp > read) tmp = read; + clear_user(buf, tmp); + buf += tmp; + p += tmp; + read -= tmp; + count -= tmp; } #endif - copy_to_user(buf, (char *) p, tmp); - buf += tmp; + copy_to_user(buf, (char *)p, read); + p += read; + buf += read; + count -= read; } - virtr = vread(buf, (char *) (unsigned long) file->f_pos, count - read); + virtr = vread(buf, (char *)p, count); if (virtr < 0) return virtr; - file->f_pos += virtr + read; + *ppos += p + virtr; return virtr + read; } /* * This function writes to the *virtual* memory as seen by the kernel. */ -static long write_kmem(struct inode * inode, struct file * file, - const char * buf, unsigned long count) +static ssize_t write_kmem(struct file * file, const char * buf, + size_t count, loff_t *ppos) { - unsigned long p = file->f_pos; + unsigned long p = *ppos; if (p >= (unsigned long) high_memory) return 0; if (count > (unsigned long) high_memory - p) count = (unsigned long) high_memory - p; - return do_write_mem(file,(void*)p,p,buf,count); + return do_write_mem(file, (void*)p, p, buf, count, ppos); } -static long read_port(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t read_port(struct file * file, char * buf, + size_t count, loff_t *ppos) { - unsigned int i = file->f_pos; - char * tmp = buf; + unsigned long i = *ppos; + char *tmp = buf; if (verify_area(VERIFY_WRITE,buf,count)) return -EFAULT; @@ -210,14 +212,14 @@ i++; tmp++; } - file->f_pos = i; + *ppos = i; return tmp-buf; } -static long write_port(struct inode * inode, struct file * file, - const char * buf, unsigned long count) +static ssize_t write_port(struct file * file, const char * buf, + size_t count, loff_t *ppos) { - unsigned int i = file->f_pos; + unsigned long i = *ppos; const char * tmp = buf; if (verify_area(VERIFY_READ,buf,count)) @@ -230,18 +232,18 @@ i++; tmp++; } - file->f_pos = i; + *ppos = i; return tmp-buf; } -static long read_null(struct inode * node, struct file * file, - char * buf, unsigned long count) +static ssize_t read_null(struct file * file, char * buf, + size_t count, loff_t *ppos) { return 0; } -static long write_null(struct inode * inode, struct file * file, - const char * buf, unsigned long count) +static ssize_t write_null(struct file * file, const char * buf, + size_t count, loff_t *ppos) { return count; } @@ -249,7 +251,7 @@ /* * For fun, we are using the MMU for this. */ -static inline unsigned long read_zero_pagealigned(char * buf, unsigned long size) +static inline size_t read_zero_pagealigned(char * buf, size_t size) { struct vm_area_struct * vma; unsigned long addr=(unsigned long)buf; @@ -292,8 +294,8 @@ return size; } -static long read_zero(struct inode * node, struct file * file, - char * buf, unsigned long count) +static ssize_t read_zero(struct file * file, char * buf, + size_t count, loff_t *ppos) { unsigned long left, unwritten, written = 0; @@ -339,21 +341,23 @@ return 0; } -static long write_full(struct inode * inode, struct file * file, - const char * buf, unsigned long count) +static ssize_t write_full(struct file * file, const char * buf, + size_t count, loff_t *ppos) { return -ENOSPC; } /* - * Special lseek() function for /dev/null and /dev/zero. Most notably, you can fopen() - * both devices with "a" now. This was previously impossible. SRB. + * Special lseek() function for /dev/null and /dev/zero. Most notably, you + * can fopen() both devices with "a" now. This was previously impossible. + * -- SRB. */ -static long long null_lseek(struct file * file, long long offset, int orig) +static loff_t null_lseek(struct file * file, loff_t offset, int orig) { - return file->f_pos=0; + return file->f_pos = 0; } + /* * The memory devices use the full 32/64 bits of the offset, and so we cannot * check against negative addresses: they are ok. The return value is weird, @@ -362,7 +366,7 @@ * also note that seeking relative to the "end of file" isn't supported: * it has no meaning, so it returns -EINVAL. */ -static long long memory_lseek(struct file * file, long long offset, int orig) +static loff_t memory_lseek(struct file * file, loff_t offset, int orig) { switch (orig) { case 0: diff -u --recursive --new-file v2.1.59/linux/drivers/char/n_tty.c linux/drivers/char/n_tty.c --- v2.1.59/linux/drivers/char/n_tty.c Wed Sep 24 20:05:46 1997 +++ linux/drivers/char/n_tty.c Tue Oct 21 08:57:28 1997 @@ -88,9 +88,8 @@ /* * Return number of characters buffered to be delivered to user - * */ -int n_tty_chars_in_buffer(struct tty_struct *tty) +ssize_t n_tty_chars_in_buffer(struct tty_struct *tty) { if (tty->icanon) { if (!tty->canon_data) return 0; @@ -817,10 +816,10 @@ */ static inline void copy_from_read_buf(struct tty_struct *tty, unsigned char **b, - unsigned int *nr) + size_t *nr) { - int n; + ssize_t n; n = MIN(*nr, MIN(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail)); if (!n) @@ -832,15 +831,15 @@ *nr -= n; } -static int read_chan(struct tty_struct *tty, struct file *file, - unsigned char *buf, unsigned int nr) +static ssize_t read_chan(struct tty_struct *tty, struct file *file, + unsigned char *buf, size_t nr) { struct wait_queue wait = { current, NULL }; int c; unsigned char *b = buf; int minimum, time; - int retval = 0; - int size; + ssize_t retval = 0; + ssize_t size; do_it_again: @@ -1004,13 +1003,13 @@ return (size ? size : retval); } -static int write_chan(struct tty_struct * tty, struct file * file, - const unsigned char * buf, unsigned int nr) +static ssize_t write_chan(struct tty_struct * tty, struct file * file, + const unsigned char * buf, size_t nr) { struct wait_queue wait = { current, NULL }; - int c, num; + int c; const unsigned char *b = buf; - int retval = 0; + ssize_t retval = 0, num; /* Job control check -- must be done at start (POSIX.1 7.1.1.4). */ if (L_TOSTOP(tty) && file->f_dentry->d_inode->i_rdev != CONSOLE_DEV) { diff -u --recursive --new-file v2.1.59/linux/drivers/char/psaux.c linux/drivers/char/psaux.c --- v2.1.59/linux/drivers/char/psaux.c Wed Sep 24 20:05:46 1997 +++ linux/drivers/char/psaux.c Tue Oct 21 08:57:28 1997 @@ -302,13 +302,13 @@ * Write to the aux device. */ -static long write_aux(struct inode * inode, struct file * file, - const char * buffer, unsigned long count) +static ssize_t write_aux(struct file * file, const char * buffer, + size_t count, loff_t *ppos) { - int retval = 0; + ssize_t retval = 0; if (count) { - int written = 0; + ssize_t written = 0; aux_start_atomic(); do { @@ -326,7 +326,7 @@ retval = -EIO; if (written) { retval = written; - inode->i_mtime = CURRENT_TIME; + file->f_dentry->d_inode->i_mtime = CURRENT_TIME; } } @@ -449,10 +449,10 @@ * Write to the 82C710 mouse device. */ -static long write_qp(struct inode * inode, struct file * file, - const char * buffer, unsigned long count) +static ssize_t write_qp(struct file * file, const char * buffer, + size_t count, loff_t *ppos) { - int i = count; + ssize_t i = count; while (i--) { char c; @@ -461,7 +461,7 @@ get_user(c, buffer++); outb_p(c, qp_data); } - inode->i_mtime = CURRENT_TIME; + file->f_dentry->d_inode->i_mtime = CURRENT_TIME; return count; } @@ -527,11 +527,11 @@ * Put bytes from input queue to buffer. */ -static long read_aux(struct inode * inode, struct file * file, - char * buffer, unsigned long count) +static ssize_t read_aux(struct file * file, char * buffer, + size_t count, loff_t *ppos) { struct wait_queue wait = { current, NULL }; - int i = count; + ssize_t i = count; unsigned char c; if (queue_empty()) { @@ -554,7 +554,7 @@ } aux_ready = !queue_empty(); if (count-i) { - inode->i_atime = CURRENT_TIME; + file->f_dentry->d_inode->i_atime = CURRENT_TIME; return count-i; } if (signal_pending(current)) diff -u --recursive --new-file v2.1.59/linux/drivers/char/random.c linux/drivers/char/random.c --- v2.1.59/linux/drivers/char/random.c Wed Sep 24 20:05:46 1997 +++ linux/drivers/char/random.c Tue Oct 21 08:57:28 1997 @@ -346,13 +346,13 @@ static struct wait_queue *random_read_wait; static struct wait_queue *random_write_wait; -static long random_read(struct inode * inode, struct file * file, - char * buf, unsigned long nbytes); -static long random_read_unlimited(struct inode * inode, struct file * file, - char * buf, unsigned long nbytes); +static ssize_t random_read(struct file * file, char * buf, + size_t nbytes, loff_t *ppos); +static ssize_t random_read_unlimited(struct file * file, char * buf, + size_t nbytes, loff_t *ppos); static unsigned int random_poll(struct file *file, poll_table * wait); -static long random_write(struct inode * inode, struct file * file, - const char * buffer, unsigned long count); +static ssize_t random_write(struct file * file, const char * buffer, + size_t count, loff_t *ppos); static int random_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg); @@ -983,10 +983,10 @@ * bits of entropy are left in the pool, but it does not restrict the * number of bytes that are actually obtained. */ -static int extract_entropy(struct random_bucket *r, char * buf, - int nbytes, int to_user) +static ssize_t extract_entropy(struct random_bucket *r, char * buf, + size_t nbytes, int to_user) { - int ret, i; + ssize_t ret, i; __u32 tmp[HASH_BUFFER_SIZE]; char *cp,*dp; @@ -1075,13 +1075,11 @@ extract_entropy(&random_state, (char *) buf, nbytes, 0); } -static long -random_read(struct inode * inode, struct file * file, char * buf, unsigned long nbytes) +static ssize_t +random_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos) { struct wait_queue wait = { current, NULL }; - int n; - int retval = 0; - int count = 0; + ssize_t n, retval = 0, count = 0; if (nbytes == 0) return 0; @@ -1121,19 +1119,18 @@ remove_wait_queue(&random_read_wait, &wait); /* - * If we gave the user some bytes and we have an inode pointer, - * update the access time. + * If we gave the user some bytes, update the access time. */ - if (inode && count != 0) { - UPDATE_ATIME(inode); + if (count != 0) { + UPDATE_ATIME(file->f_dentry->d_inode); } return (count ? count : retval); } -static long -random_read_unlimited(struct inode * inode, struct file * file, - char * buf, unsigned long nbytes) +static ssize_t +random_read_unlimited(struct file * file, char * buf, + size_t nbytes, loff_t *ppos) { return extract_entropy(&random_state, buf, nbytes, 1); } @@ -1153,14 +1150,14 @@ return mask; } -static long -random_write(struct inode * inode, struct file * file, - const char * buffer, unsigned long count) +static ssize_t +random_write(struct file * file, const char * buffer, + size_t count, loff_t *ppos) { - int i, bytes, ret = 0; + ssize_t i, bytes, ret = 0; __u32 buf[16]; const char *p = buffer; - int c = count; + ssize_t c = count; while (c > 0) { bytes = MIN(c, sizeof(buf)); @@ -1179,9 +1176,9 @@ while (i--) add_entropy_word(&random_state, buf[i]); } - if ((ret > 0) && inode) { - inode->i_mtime = CURRENT_TIME; - mark_inode_dirty(inode); + if (ret > 0) { + file->f_dentry->d_inode->i_mtime = CURRENT_TIME; + mark_inode_dirty(file->f_dentry->d_inode); } return ret; } @@ -1265,7 +1262,8 @@ retval = verify_area(VERIFY_READ, (void *) p, size); if (retval) return retval; - retval = random_write(0, file, (const char *) p, size); + retval = random_write(file, (const char *) p, + size, &file->f_pos); if (retval < 0) return retval; /* diff -u --recursive --new-file v2.1.59/linux/drivers/char/rtc.c linux/drivers/char/rtc.c --- v2.1.59/linux/drivers/char/rtc.c Wed Sep 24 20:05:47 1997 +++ linux/drivers/char/rtc.c Tue Oct 21 08:57:28 1997 @@ -78,8 +78,8 @@ static long long rtc_llseek(struct file *file, loff_t offset, int origin); -static long rtc_read(struct inode *inode, struct file *file, - char *buf, unsigned long count); +static ssize_t rtc_read(struct file *file, char *buf, + size_t count, loff_t *ppos); static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); @@ -146,11 +146,12 @@ return -ESPIPE; } -static long rtc_read(struct inode *inode, struct file *file, char *buf, - unsigned long count) +static ssize_t rtc_read(struct file *file, char *buf, + size_t count, loff_t *ppos) { struct wait_queue wait = { current, NULL }; - int retval = 0; + unsigned long data; + ssize_t retval; if (count < sizeof(unsigned long)) return -EINVAL; @@ -159,30 +160,22 @@ current->state = TASK_INTERRUPTIBLE; - while (rtc_irq_data == 0) { + while ((data = xchg(&rtc_irq_data, 0)) == 0) { if (file->f_flags & O_NONBLOCK) { retval = -EAGAIN; - break; + goto out; } if (signal_pending(current)) { retval = -ERESTARTSYS; - break; + goto out; } schedule(); } - if (retval == 0) { - unsigned long data, flags; - save_flags(flags); - cli(); - data = rtc_irq_data; - rtc_irq_data = 0; - restore_flags(flags); - retval = put_user(data, (unsigned long *)buf); - if (!retval) - retval = sizeof(unsigned long); - } - + retval = put_user(data, (unsigned long *)buf); + if (!retval) + retval = sizeof(unsigned long); +out: current->state = TASK_RUNNING; remove_wait_queue(&rtc_wait, &wait); diff -u --recursive --new-file v2.1.59/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c --- v2.1.59/linux/drivers/char/tty_io.c Wed Sep 24 20:05:47 1997 +++ linux/drivers/char/tty_io.c Tue Oct 21 08:57:28 1997 @@ -108,8 +108,8 @@ static void initialize_tty_struct(struct tty_struct *tty); -static long tty_read(struct inode *, struct file *, char *, unsigned long); -static long tty_write(struct inode *, struct file *, const char *, unsigned long); +static ssize_t tty_read(struct file *, char *, size_t, loff_t *); +static ssize_t tty_write(struct file *, const char *, size_t, loff_t *); static unsigned int tty_poll(struct file *, poll_table *); static int tty_open(struct inode *, struct file *); static int tty_release(struct inode *, struct file *); @@ -304,15 +304,21 @@ return -ERESTARTSYS; } -static long hung_up_tty_read(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t hung_up_tty_read(struct file * file, char * buf, + size_t count, loff_t *ppos) { + /* Can't seek (pread) on ttys. */ + if (ppos != &file->f_pos) + return -ESPIPE; return 0; } -static long hung_up_tty_write(struct inode * inode, - struct file * file, const char * buf, unsigned long count) +static ssize_t hung_up_tty_write(struct file * file, const char * buf, + size_t count, loff_t *ppos) { + /* Can't seek (pwrite) on ttys. */ + if (ppos != &file->f_pos) + return -ESPIPE; return -EIO; } @@ -543,13 +549,19 @@ wake_up_interruptible(&tty->write_wait); } -static long tty_read(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t tty_read(struct file * file, char * buf, size_t count, + loff_t *ppos) { int i; struct tty_struct * tty; + struct inode *inode; + + /* Can't seek (pread) on ttys. */ + if (ppos != &file->f_pos) + return -ESPIPE; tty = (struct tty_struct *)file->private_data; + inode = file->f_dentry->d_inode; if (tty_paranoia_check(tty, inode->i_rdev, "tty_read")) return -EIO; if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags))) @@ -584,15 +596,14 @@ * Split writes up in sane blocksizes to avoid * denial-of-service type attacks */ -static inline int do_tty_write( - int (*write)(struct tty_struct *, struct file *, const unsigned char *, unsigned int), - struct inode *inode, +static inline ssize_t do_tty_write( + ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char *, size_t), struct tty_struct *tty, struct file *file, const unsigned char *buf, - unsigned int count) + size_t count) { - int ret = 0, written = 0; + ssize_t ret = 0, written = 0; for (;;) { unsigned long size = PAGE_SIZE*2; @@ -613,19 +624,25 @@ schedule(); } if (written) { - inode->i_mtime = CURRENT_TIME; + file->f_dentry->d_inode->i_mtime = CURRENT_TIME; ret = written; } return ret; } -static long tty_write(struct inode * inode, struct file * file, - const char * buf, unsigned long count) +static ssize_t tty_write(struct file * file, const char * buf, size_t count, + loff_t *ppos) { int is_console; struct tty_struct * tty; + struct inode *inode; + + /* Can't seek (pwrite) on ttys. */ + if (ppos != &file->f_pos) + return -ESPIPE; + inode = file->f_dentry->d_inode; is_console = (inode->i_rdev == CONSOLE_DEV); if (is_console && redirect) @@ -649,22 +666,23 @@ #endif if (!tty->ldisc.write) return -EIO; - return do_tty_write(tty->ldisc.write, - inode, tty, file, - (const unsigned char *)buf, - (unsigned int)count); + return do_tty_write(tty->ldisc.write, tty, file, + (const unsigned char *)buf, count); } /* Semaphore to protect creating and releasing a tty */ static struct semaphore tty_sem = MUTEX; + static void down_tty_sem(int index) { down(&tty_sem); } + static void up_tty_sem(int index) { up(&tty_sem); } + static void release_mem(struct tty_struct *tty, int idx); /* diff -u --recursive --new-file v2.1.59/linux/drivers/char/vc_screen.c linux/drivers/char/vc_screen.c --- v2.1.59/linux/drivers/char/vc_screen.c Tue Sep 23 16:48:47 1997 +++ linux/drivers/char/vc_screen.c Tue Oct 21 08:57:28 1997 @@ -103,12 +103,13 @@ } #define RETURN( x ) { enable_bh( CONSOLE_BH ); return x; } -static long -vcs_read(struct inode *inode, struct file *file, char *buf, unsigned long count) +static ssize_t +vcs_read(struct file *file, char *buf, size_t count, loff_t *ppos) { - int p = file->f_pos; + struct inode *inode = file->f_dentry->d_inode; unsigned int currcons = MINOR(inode->i_rdev); - int viewed, attr, size, read; + long p = *ppos; + long viewed, attr, size, read; char *buf0; unsigned short *org = NULL; @@ -160,16 +161,17 @@ put_user(func_scr_readw(org) & 0xff, buf++); } read = buf - buf0; - file->f_pos += read; + *ppos += read; RETURN( read ); } -static long -vcs_write(struct inode *inode, struct file *file, const char *buf, unsigned long count) +static ssize_t +vcs_write(struct file *file, const char *buf, size_t count, loff_t *ppos) { - int p = file->f_pos; + struct inode *inode = file->f_dentry->d_inode; unsigned int currcons = MINOR(inode->i_rdev); - int viewed, attr, size, written; + long p = *ppos; + long viewed, attr, size, written; const char *buf0; unsigned short *org = NULL; @@ -242,7 +244,7 @@ update_screen(currcons); #endif written = buf - buf0; - file->f_pos += written; + *ppos += written; RETURN( written ); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/3c501.c linux/drivers/net/3c501.c --- v2.1.59/linux/drivers/net/3c501.c Tue May 13 22:41:08 1997 +++ linux/drivers/net/3c501.c Wed Oct 22 08:27:31 1997 @@ -357,10 +357,9 @@ if (el_debug > 2) printk("%s: Doing el_open()...", dev->name); - if (request_irq(dev->irq, &el_interrupt, 0, "3c501", NULL)) + if (request_irq(dev->irq, &el_interrupt, 0, "3c501", dev)) return -EAGAIN; - irq2dev_map[dev->irq] = dev; el_reset(dev); dev->start = 1; @@ -483,7 +482,7 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct net_local *lp; int ioaddr; int axsr; /* Aux. status reg. */ @@ -761,7 +760,6 @@ free_irq(dev->irq, NULL); outb(AX_RESET, AX_CMD); /* Reset the chip */ - irq2dev_map[dev->irq] = 0; MOD_DEC_USE_COUNT; return 0; diff -u --recursive --new-file v2.1.59/linux/drivers/net/3c503.c linux/drivers/net/3c503.c --- v2.1.59/linux/drivers/net/3c503.c Wed Apr 23 19:01:18 1997 +++ linux/drivers/net/3c503.c Wed Oct 22 08:27:31 1997 @@ -340,13 +340,13 @@ outb(EGACFR_NORM, E33G_GACFR); /* Enable RAM and interrupts. */ do { - if (request_irq (*irqp, NULL, 0, "bogus", NULL) != -EBUSY) { + if (request_irq (*irqp, NULL, 0, "bogus", dev) != -EBUSY) { /* Twinkle the interrupt, and check if it's seen. */ autoirq_setup(0); outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR); outb_p(0x00, E33G_IDCFR); if (*irqp == autoirq_report(0) /* It's a good IRQ line! */ - && request_irq (dev->irq = *irqp, &ei_interrupt, 0, ei_status.name, NULL) == 0) + && request_irq (dev->irq = *irqp, &ei_interrupt, 0, ei_status.name, dev) == 0) break; } } while (*++irqp); @@ -355,7 +355,7 @@ return -EAGAIN; } } else { - if (request_irq(dev->irq, &ei_interrupt, 0, ei_status.name, NULL)) { + if (request_irq(dev->irq, &ei_interrupt, 0, ei_status.name, dev)) { return -EAGAIN; } } @@ -371,7 +371,6 @@ { free_irq(dev->irq, NULL); dev->irq = ei_status.saved_irq; - irq2dev_map[dev->irq] = NULL; outb(EGACFR_IRQOFF, E33G_GACFR); /* disable interrupts. */ ei_close(dev); @@ -675,7 +674,7 @@ for (this_dev = 0; this_dev < MAX_EL2_CARDS; this_dev++) { struct device *dev = &dev_el2[this_dev]; if (dev->priv != NULL) { - /* NB: el2_close() handles free_irq + irq2dev map */ + /* NB: el2_close() handles free_irq */ kfree(dev->priv); dev->priv = NULL; release_region(dev->base_addr, EL2_IO_EXTENT); diff -u --recursive --new-file v2.1.59/linux/drivers/net/3c505.c linux/drivers/net/3c505.c --- v2.1.59/linux/drivers/net/3c505.c Tue May 13 22:41:08 1997 +++ linux/drivers/net/3c505.c Wed Oct 22 08:27:31 1997 @@ -669,7 +669,7 @@ printk("elp_interrupt(): illegal IRQ number found in interrupt routine (%i)\n", irq); return; } - dev = irq2dev_map[irq]; + dev = dev_id; if (dev == NULL) { printk("elp_interrupt(): irq %d for unknown device.\n", irq); @@ -926,15 +926,9 @@ adapter->rx_backlog.out = 0; /* - * make sure we can find the device header given the interrupt number - */ - irq2dev_map[dev->irq] = dev; - - /* * install our interrupt service routine */ - if (request_irq(dev->irq, &elp_interrupt, 0, "3c505", NULL)) { - irq2dev_map[dev->irq] = NULL; + if (request_irq(dev->irq, &elp_interrupt, 0, "3c505", dev)) { return -EAGAIN; } if (request_dma(dev->dma, "3c505")) { @@ -1223,11 +1217,6 @@ * release the IRQ */ free_irq(dev->irq, NULL); - - /* - * and we no longer have to map irq to dev either - */ - irq2dev_map[dev->irq] = 0; free_dma(dev->dma); free_pages((unsigned long) adapter->dma_buffer, __get_order(DMA_BUFFER_SIZE)); diff -u --recursive --new-file v2.1.59/linux/drivers/net/3c507.c linux/drivers/net/3c507.c --- v2.1.59/linux/drivers/net/3c507.c Tue May 13 22:41:08 1997 +++ linux/drivers/net/3c507.c Wed Oct 22 08:27:31 1997 @@ -362,7 +362,7 @@ irq = inb(ioaddr + IRQ_CONFIG) & 0x0f; - irqval = request_irq(irq, &el16_interrupt, 0, "3c507", NULL); + irqval = request_irq(irq, &el16_interrupt, 0, "3c507", dev); if (irqval) { printk ("unable to get IRQ %d (irqval=%d).\n", irq, irqval); return EAGAIN; @@ -431,8 +431,6 @@ static int el16_open(struct device *dev) { - irq2dev_map[dev->irq] = dev; - /* Initialize the 82586 memory and start it. */ init_82586_mem(dev); @@ -506,7 +504,7 @@ Handle the network interface interrupts. */ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct net_local *lp; int ioaddr, status, boguscount = 0; ushort ack_cmd = 0; @@ -619,10 +617,7 @@ /* Disable the 82586's input to the interrupt line. */ outb(0x80, ioaddr + MISC_CTRL); - /* We always physically use the IRQ line, so we don't do free_irq(). - We do remove ourselves from the map. */ - - irq2dev_map[dev->irq] = 0; + /* We always physically use the IRQ line, so we don't do free_irq(). */ /* Update the statistics here. */ diff -u --recursive --new-file v2.1.59/linux/drivers/net/3c509.c linux/drivers/net/3c509.c --- v2.1.59/linux/drivers/net/3c509.c Thu Sep 4 17:07:30 1997 +++ linux/drivers/net/3c509.c Wed Oct 22 08:27:31 1997 @@ -418,7 +418,6 @@ outw(SetStatusEnb | 0x00, ioaddr + EL3_CMD); if (request_irq(dev->irq, &el3_interrupt, 0, "3c509", dev)) { - irq2dev_map[dev->irq] = NULL; return -EAGAIN; } @@ -868,7 +867,6 @@ kfree_s(dev->priv,sizeof(struct el3_private)); dev->priv = NULL; free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = NULL; release_region(dev->base_addr, EL3_IO_EXTENT); unregister_netdev(dev); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/8390.c linux/drivers/net/8390.c --- v2.1.59/linux/drivers/net/8390.c Mon Aug 11 14:47:04 1997 +++ linux/drivers/net/8390.c Wed Oct 22 08:27:31 1997 @@ -121,7 +121,6 @@ return -ENXIO; } - irq2dev_map[dev->irq] = dev; NS8390_init(dev, 1); dev->start = 1; ei_local->irqlock = 0; @@ -284,7 +283,7 @@ Handle the ether interface interrupts. */ void ei_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; int e8390_base; int interrupts, nr_serviced = 0; struct ei_device *ei_local; @@ -296,12 +295,14 @@ e8390_base = dev->base_addr; ei_local = (struct ei_device *) dev->priv; if (dev->interrupt || ei_local->irqlock) { +#if 1 /* This might just be an interrupt for a PCI device sharing this line */ /* The "irqlock" check is only for testing. */ printk(ei_local->irqlock ? "%s: Interrupted while interrupts are masked! isr=%#2x imr=%#2x.\n" : "%s: Reentering the interrupt handler! isr=%#2x imr=%#2x.\n", dev->name, inb_p(e8390_base + EN0_ISR), inb_p(e8390_base + EN0_IMR)); +#endif return; } diff -u --recursive --new-file v2.1.59/linux/drivers/net/8390.h linux/drivers/net/8390.h --- v2.1.59/linux/drivers/net/8390.h Mon Oct 20 10:36:52 1997 +++ linux/drivers/net/8390.h Wed Oct 22 08:28:35 1997 @@ -45,7 +45,6 @@ #ifndef HAVE_AUTOIRQ /* From auto_irq.c */ -extern struct device *irq2dev_map[16]; extern void autoirq_setup(int waittime); extern unsigned long autoirq_report(int waittime); #endif diff -u --recursive --new-file v2.1.59/linux/drivers/net/ac3200.c linux/drivers/net/ac3200.c --- v2.1.59/linux/drivers/net/ac3200.c Wed Apr 23 19:01:18 1997 +++ linux/drivers/net/ac3200.c Wed Oct 22 08:27:31 1997 @@ -165,7 +165,7 @@ else if (dev->irq == 2) dev->irq = 9; - if (request_irq(dev->irq, ei_interrupt, 0, "ac3200", NULL)) { + if (request_irq(dev->irq, ei_interrupt, 0, "ac3200", dev)) { printk (" unable to get IRQ %d.\n", dev->irq); return EAGAIN; } @@ -228,7 +228,7 @@ /* Someday we may enable the IRQ and shared memory here. */ int ioaddr = dev->base_addr; - if (request_irq(dev->irq, ei_interrupt, 0, "ac3200", NULL)) + if (request_irq(dev->irq, ei_interrupt, 0, "ac3200", dev)) return -EAGAIN; #endif @@ -304,7 +304,6 @@ /* We should someday disable shared memory and interrupts. */ outb(0x00, ioaddr + 6); /* Disable interrupts. */ free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = 0; #endif ei_close(dev); @@ -369,9 +368,8 @@ if (dev->priv != NULL) { kfree(dev->priv); dev->priv = NULL; - /* Someday free_irq + irq2dev may be in ac_close_card() */ + /* Someday free_irq may be in ac_close_card() */ free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = NULL; release_region(dev->base_addr, AC_IO_EXTENT); unregister_netdev(dev); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/apricot.c linux/drivers/net/apricot.c --- v2.1.59/linux/drivers/net/apricot.c Thu May 29 21:53:07 1997 +++ linux/drivers/net/apricot.c Wed Oct 22 08:27:31 1997 @@ -537,11 +537,9 @@ if (i596_debug > 1) printk("%s: i596_open() irq %d.\n", dev->name, dev->irq); - if (request_irq(dev->irq, &i596_interrupt, 0, "apricot", NULL)) + if (request_irq(dev->irq, &i596_interrupt, 0, "apricot", dev)) return -EAGAIN; - irq2dev_map[dev->irq] = dev; - i = init_rx_bufs(dev, RX_RING_SIZE); if ((i = init_rx_bufs(dev, RX_RING_SIZE)) < RX_RING_SIZE) @@ -550,7 +548,6 @@ if (i < 4) { free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = 0; return -EAGAIN; } @@ -746,7 +743,7 @@ static void i596_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct i596_private *lp; short ioaddr; int boguscnt = 200; @@ -934,7 +931,6 @@ break; } free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = 0; remove_rx_bufs(dev); MOD_DEC_USE_COUNT; diff -u --recursive --new-file v2.1.59/linux/drivers/net/arc-rimi.c linux/drivers/net/arc-rimi.c --- v2.1.59/linux/drivers/net/arc-rimi.c Sun Sep 7 13:10:42 1997 +++ linux/drivers/net/arc-rimi.c Wed Oct 22 08:27:31 1997 @@ -178,12 +178,11 @@ int mirror_size; /* reserve the irq */ - if (request_irq(airq,&arcnet_interrupt,0,"arcnet (RIM I)",NULL)) + if (request_irq(airq,&arcnet_interrupt,0,"arcnet (RIM I)",dev)) { BUGMSG(D_NORMAL,"Can't get IRQ %d!\n",airq); return -ENODEV; } - irq2dev_map[airq]=dev; dev->irq=airq; dev->base_addr=0; @@ -221,7 +220,6 @@ dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL); if (dev->priv == NULL) { - irq2dev_map[airq] = NULL; free_irq(airq,NULL); return -ENOMEM; } @@ -792,7 +790,6 @@ if (dev->irq) { - irq2dev_map[dev->irq] = NULL; free_irq(dev->irq,NULL); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/arcnet.c linux/drivers/net/arcnet.c --- v2.1.59/linux/drivers/net/arcnet.c Sun Sep 7 13:10:42 1997 +++ linux/drivers/net/arcnet.c Wed Oct 22 08:27:31 1997 @@ -919,7 +919,7 @@ void arcnet_interrupt(int irq,void *dev_id,struct pt_regs *regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct arcnet_local *lp; if (dev==NULL) diff -u --recursive --new-file v2.1.59/linux/drivers/net/at1700.c linux/drivers/net/at1700.c --- v2.1.59/linux/drivers/net/at1700.c Tue May 13 22:41:08 1997 +++ linux/drivers/net/at1700.c Wed Oct 22 08:27:31 1997 @@ -193,7 +193,7 @@ | (read_eeprom(ioaddr, 0)>>14)]; /* Snarf the interrupt vector now. */ - if (request_irq(irq, &net_interrupt, 0, "at1700", NULL)) { + if (request_irq(irq, &net_interrupt, 0, "at1700", dev)) { printk ("AT1700 found at %#3x, but it's unusable due to a conflict on" "IRQ %d.\n", ioaddr, irq); return EAGAIN; @@ -212,7 +212,6 @@ dev->base_addr = ioaddr; dev->irq = irq; - irq2dev_map[irq] = dev; for(i = 0; i < 3; i++) { unsigned short eeprom_val = read_eeprom(ioaddr, 4+i); @@ -435,7 +434,7 @@ static void net_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct net_local *lp; int ioaddr, status; @@ -656,7 +655,6 @@ /* If we don't do this, we can't re-insmod it later. */ free_irq(dev_at1700.irq, NULL); - irq2dev_map[dev_at1700.irq] = NULL; release_region(dev_at1700.base_addr, AT1700_IO_EXTENT); } #endif /* MODULE */ diff -u --recursive --new-file v2.1.59/linux/drivers/net/atp.c linux/drivers/net/atp.c --- v2.1.59/linux/drivers/net/atp.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/atp.c Wed Oct 22 08:27:31 1997 @@ -327,9 +327,7 @@ /* The interrupt line is turned off (tri-stated) when the device isn't in use. That's especially important for "attached" interfaces where the port or interrupt may be shared. */ - if (irq2dev_map[dev->irq] != 0 - || (irq2dev_map[dev->irq] = dev) == 0 - || request_irq(dev->irq, &net_interrupt, 0, "ATP", NULL)) { + if (request_irq(dev->irq, &net_interrupt, 0, "ATP", dev)) { return -EAGAIN; } @@ -479,7 +477,7 @@ static void net_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct net_local *lp; int ioaddr, status, boguscount = 20; static int num_tx_since_rx = 0; @@ -730,7 +728,6 @@ /* Free the IRQ line. */ outb(0x00, ioaddr + PAR_CONTROL); free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = 0; /* Leave the hardware in a reset state. */ write_reg_high(ioaddr, CMR1, CMR1h_RESET); diff -u --recursive --new-file v2.1.59/linux/drivers/net/auto_irq.c linux/drivers/net/auto_irq.c --- v2.1.59/linux/drivers/net/auto_irq.c Mon Oct 20 10:36:52 1997 +++ linux/drivers/net/auto_irq.c Wed Oct 22 08:27:31 1997 @@ -39,8 +39,6 @@ #include #include -struct device *irq2dev_map[NR_IRQS] = {0, 0, /* ... zeroed */}; - static unsigned long irqs; void autoirq_setup(int waittime) diff -u --recursive --new-file v2.1.59/linux/drivers/net/com20020.c linux/drivers/net/com20020.c --- v2.1.59/linux/drivers/net/com20020.c Sun Sep 7 13:10:42 1997 +++ linux/drivers/net/com20020.c Wed Oct 22 08:27:31 1997 @@ -336,12 +336,11 @@ struct arcnet_local *lp; /* reserve the irq */ - if (request_irq(airq,&arcnet_interrupt,0,"arcnet (COM20020)",NULL)) + if (request_irq(airq,&arcnet_interrupt,0,"arcnet (COM20020)",dev)) { BUGMSG(D_NORMAL,"Can't get IRQ %d!\n",airq); return -ENODEV; } - irq2dev_map[airq]=dev; dev->irq=airq; /* reserve the I/O region - guaranteed to work by check_region */ @@ -355,7 +354,6 @@ dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL); if (dev->priv == NULL) { - irq2dev_map[airq] = NULL; free_irq(airq,NULL); release_region(ioaddr,ARCNET_TOTAL_SIZE); return -ENOMEM; @@ -1026,7 +1024,6 @@ if (dev->irq) { - irq2dev_map[dev->irq] = NULL; free_irq(dev->irq,NULL); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/com90io.c linux/drivers/net/com90io.c --- v2.1.59/linux/drivers/net/com90io.c Sun Sep 7 13:10:42 1997 +++ linux/drivers/net/com90io.c Wed Oct 22 08:27:31 1997 @@ -296,12 +296,11 @@ struct arcnet_local *lp; /* reserve the irq */ - if (request_irq(airq,&arcnet_interrupt,0,"arcnet (COM90xx-IO)",NULL)) + if (request_irq(airq,&arcnet_interrupt,0,"arcnet (COM90xx-IO)",dev)) { BUGMSG(D_NORMAL,"Can't get IRQ %d!\n",airq); return -ENODEV; } - irq2dev_map[airq]=dev; dev->irq=airq; /* reserve the I/O region - guaranteed to work by check_region */ @@ -315,7 +314,6 @@ dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL); if (dev->priv == NULL) { - irq2dev_map[airq] = NULL; free_irq(airq,NULL); release_region(ioaddr,ARCNET_TOTAL_SIZE); return -ENOMEM; @@ -905,7 +903,6 @@ if (dev->irq) { - irq2dev_map[dev->irq] = NULL; free_irq(dev->irq,NULL); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/com90xx.c linux/drivers/net/com90xx.c --- v2.1.59/linux/drivers/net/com90xx.c Sun Sep 7 13:10:42 1997 +++ linux/drivers/net/com90xx.c Wed Oct 22 08:27:31 1997 @@ -542,12 +542,11 @@ int mirror_size; /* reserve the irq */ - if (request_irq(airq,&arcnet_interrupt,0,"arcnet (90xx)",NULL)) + if (request_irq(airq,&arcnet_interrupt,0,"arcnet (90xx)",dev)) { BUGMSG(D_NORMAL,"Can't get IRQ %d!\n",airq); return -ENODEV; } - irq2dev_map[airq]=dev; dev->irq=airq; /* reserve the I/O region - guaranteed to work by check_region */ @@ -585,7 +584,6 @@ dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL); if (dev->priv == NULL) { - irq2dev_map[airq] = NULL; free_irq(airq,NULL); release_region(ioaddr,ARCNET_TOTAL_SIZE); return -ENOMEM; @@ -1203,7 +1201,6 @@ if (dev->irq) { - irq2dev_map[dev->irq] = NULL; free_irq(dev->irq,NULL); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/cops.c linux/drivers/net/cops.c --- v2.1.59/linux/drivers/net/cops.c Thu Jul 17 10:06:05 1997 +++ linux/drivers/net/cops.c Wed Oct 22 08:27:31 1997 @@ -302,7 +302,7 @@ dev->irq = 9; /* Snarf the interrupt now. */ - irqval = request_irq(dev->irq, &cops_interrupt, 0, cardname, NULL); + irqval = request_irq(dev->irq, &cops_interrupt, 0, cardname, dev); if (irqval) { printk(KERN_WARNING "%s: Unable to get IRQ %d (irqval=%d).\n", dev->name, dev->irq, irqval); @@ -398,8 +398,6 @@ */ static int cops_open(struct device *dev) { - irq2dev_map[dev->irq] = dev; - cops_jumpstart(dev); /* Start the card up. */ dev->tbusy = 0; @@ -666,7 +664,7 @@ */ static void cops_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *) irq2dev_map[irq]; + struct device *dev = dev_id; struct cops_local *lp; int ioaddr, status; int boguscount = 0; @@ -954,7 +952,6 @@ { dev->tbusy = 1; dev->start = 0; - irq2dev_map[dev->irq] = 0; #ifdef MODULE MOD_DEC_USE_COUNT; diff -u --recursive --new-file v2.1.59/linux/drivers/net/cs89x0.c linux/drivers/net/cs89x0.c --- v2.1.59/linux/drivers/net/cs89x0.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/cs89x0.c Wed Oct 22 08:27:31 1997 @@ -605,10 +605,10 @@ /* Allow interrupts to be generated by the chip */ writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON); for (i = 2; i < CS8920_NO_INTS; i++) if ((1 << dev->irq) & lp->irq_map) { - if (request_irq (i, NULL, 0, "cs8920", NULL) != -EBUSY) { + if (request_irq (i, NULL, 0, "cs8920", dev) != -EBUSY) { write_irq(dev, lp->chip_type, i); writereg(dev, PP_BufCFG, GENERATE_SW_INTERRUPT); - if (request_irq (dev->irq = i, &net_interrupt, 0, "cs89x0", NULL) == 0) + if (request_irq (dev->irq = i, &net_interrupt, 0, "cs89x0", dev) == 0) break; } } @@ -626,13 +626,11 @@ } writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON); write_irq(dev, lp->chip_type, dev->irq); - if (request_irq(dev->irq, &net_interrupt, 0, "cs89x0", NULL)) { + if (request_irq(dev->irq, &net_interrupt, 0, "cs89x0", dev)) { return -EAGAIN; } } - irq2dev_map[dev->irq] = dev; - /* set the Ethernet address */ for (i=0; i < ETH_ALEN/2; i++) writereg(dev, PP_IA+i*2, dev->dev_addr[i*2] | (dev->dev_addr[i*2+1] << 8)); @@ -658,7 +656,6 @@ release_irq: writereg(dev, PP_LineCTL, readreg(dev, PP_LineCTL) & ~(SERIAL_TX_ON | SERIAL_RX_ON)); free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = 0; return -EAGAIN; } @@ -794,7 +791,7 @@ Handle the network interface interrupts. */ static void net_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct net_local *lp; int ioaddr, status; @@ -922,8 +919,6 @@ dev->start = 0; free_irq(dev->irq, NULL); - - irq2dev_map[dev->irq] = 0; /* Update the statistics here. */ diff -u --recursive --new-file v2.1.59/linux/drivers/net/de600.c linux/drivers/net/de600.c --- v2.1.59/linux/drivers/net/de600.c Wed Apr 23 19:01:19 1997 +++ linux/drivers/net/de600.c Wed Oct 22 08:27:32 1997 @@ -338,11 +338,10 @@ static int de600_open(struct device *dev) { - if (request_irq(DE600_IRQ, de600_interrupt, 0, "de600", NULL)) { + if (request_irq(DE600_IRQ, de600_interrupt, 0, "de600", dev)) { printk ("%s: unable to get IRQ %d\n", dev->name, DE600_IRQ); return 1; } - irq2dev_map[DE600_IRQ] = dev; MOD_INC_USE_COUNT; dev->start = 1; @@ -368,7 +367,6 @@ if (dev->start) { free_irq(DE600_IRQ, NULL); - irq2dev_map[DE600_IRQ] = NULL; dev->start = 0; MOD_DEC_USE_COUNT; } @@ -481,7 +479,7 @@ static void de600_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = irq2dev_map[irq]; + struct device *dev = dev_id; byte irq_status; int retrig = 0; int boguscount = 0; diff -u --recursive --new-file v2.1.59/linux/drivers/net/de620.c linux/drivers/net/de620.c --- v2.1.59/linux/drivers/net/de620.c Wed Apr 23 19:01:19 1997 +++ linux/drivers/net/de620.c Wed Oct 22 08:27:32 1997 @@ -439,11 +439,10 @@ static int de620_open(struct device *dev) { - if (request_irq(dev->irq, de620_interrupt, 0, "de620", NULL)) { + if (request_irq(dev->irq, de620_interrupt, 0, "de620", dev)) { printk ("%s: unable to get IRQ %d\n", dev->name, dev->irq); return 1; } - irq2dev_map[dev->irq] = dev; MOD_INC_USE_COUNT; if (adapter_init(dev)) { @@ -465,7 +464,6 @@ de620_set_register(dev, W_TCR, RXOFF); free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = NULL; dev->start = 0; MOD_DEC_USE_COUNT; @@ -595,7 +593,7 @@ static void de620_interrupt(int irq_in, void *dev_id, struct pt_regs *regs) { - struct device *dev = irq2dev_map[irq_in]; + struct device *dev = dev_id; byte irq_status; int bogus_count = 0; int again = 0; diff -u --recursive --new-file v2.1.59/linux/drivers/net/depca.c linux/drivers/net/depca.c --- v2.1.59/linux/drivers/net/depca.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/depca.c Wed Oct 22 08:27:32 1997 @@ -687,7 +687,6 @@ s16 nicsr; int status = 0; - irq2dev_map[dev->irq] = dev; STOP_DEPCA; nicsr = inb(DEPCA_NICSR); @@ -703,7 +702,7 @@ depca_dbg_open(dev); - if (request_irq(dev->irq, &depca_interrupt, 0, lp->adapter_name, NULL)) { + if (request_irq(dev->irq, &depca_interrupt, 0, lp->adapter_name, dev)) { printk("depca_open(): Requested IRQ%d is busy\n",dev->irq); status = -EAGAIN; } else { @@ -837,7 +836,7 @@ static void depca_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev =dev_id; struct depca_private *lp; s16 csr0, nicsr; u_long ioaddr; @@ -1059,7 +1058,6 @@ ** Free the associated irq */ free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = NULL; MOD_DEC_USE_COUNT; @@ -1133,25 +1131,23 @@ struct depca_private *lp = (struct depca_private *)dev->priv; u_long ioaddr = dev->base_addr; - if (irq2dev_map[dev->irq] != NULL) { - while(dev->tbusy); /* Stop ring access */ - set_bit(0, (void*)&dev->tbusy); - while(lp->tx_old != lp->tx_new); /* Wait for the ring to empty */ + while(dev->tbusy); /* Stop ring access */ + set_bit(0, (void*)&dev->tbusy); + while(lp->tx_old != lp->tx_new); /* Wait for the ring to empty */ - STOP_DEPCA; /* Temporarily stop the depca. */ - depca_init_ring(dev); /* Initialize the descriptor rings */ + STOP_DEPCA; /* Temporarily stop the depca. */ + depca_init_ring(dev); /* Initialize the descriptor rings */ - if (dev->flags & IFF_PROMISC) { /* Set promiscuous mode */ - lp->init_block.mode |= PROM; - } else { - SetMulticastFilter(dev); - lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */ - } - - LoadCSRs(dev); /* Reload CSR3 */ - InitRestartDepca(dev); /* Resume normal operation. */ - dev->tbusy = 0; /* Unlock the TX ring */ + if (dev->flags & IFF_PROMISC) { /* Set promiscuous mode */ + lp->init_block.mode |= PROM; + } else { + SetMulticastFilter(dev); + lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */ } + + LoadCSRs(dev); /* Reload CSR3 */ + InitRestartDepca(dev); /* Resume normal operation. */ + dev->tbusy = 0; /* Unlock the TX ring */ } /* diff -u --recursive --new-file v2.1.59/linux/drivers/net/e2100.c linux/drivers/net/e2100.c --- v2.1.59/linux/drivers/net/e2100.c Wed Apr 23 19:01:19 1997 +++ linux/drivers/net/e2100.c Wed Oct 22 08:27:32 1997 @@ -254,10 +254,9 @@ { short ioaddr = dev->base_addr; - if (request_irq(dev->irq, ei_interrupt, 0, "e2100", NULL)) { + if (request_irq(dev->irq, ei_interrupt, 0, "e2100", dev)) { return EBUSY; } - irq2dev_map[dev->irq] = dev; /* Set the interrupt line and memory base on the hardware. */ inb(ioaddr + E21_IRQ_LOW); @@ -362,8 +361,6 @@ inb(ioaddr + E21_IRQ_HIGH); /* High IRQ bit, and if_port. */ outb(0, ioaddr + E21_ASIC); - irq2dev_map[dev->irq] = NULL; - ei_close(dev); /* Double-check that the memory has been turned off, because really @@ -442,7 +439,7 @@ for (this_dev = 0; this_dev < MAX_E21_CARDS; this_dev++) { struct device *dev = &dev_e21[this_dev]; if (dev->priv != NULL) { - /* NB: e21_close() handles free_irq + irq2dev map */ + /* NB: e21_close() handles free_irq */ kfree(dev->priv); dev->priv = NULL; release_region(dev->base_addr, E21_IO_EXTENT); diff -u --recursive --new-file v2.1.59/linux/drivers/net/eepro.c linux/drivers/net/eepro.c --- v2.1.59/linux/drivers/net/eepro.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/eepro.c Wed Oct 22 08:27:32 1997 @@ -420,7 +420,7 @@ if (dev->irq > 2) { printk(", IRQ %d, %s.\n", dev->irq, ifmap[dev->if_port]); - if (request_irq(dev->irq, &eepro_interrupt, 0, "eepro", NULL)) { + if (request_irq(dev->irq, &eepro_interrupt, 0, "eepro", dev)) { printk("%s: unable to get IRQ %d.\n", dev->name, dev->irq); return -EAGAIN; } @@ -513,7 +513,7 @@ outb(DIAGNOSE_CMD, ioaddr); /* RESET the 82595 */ if (*irqp == autoirq_report(2) && /* It's a good IRQ line */ - (request_irq(dev->irq = *irqp, &eepro_interrupt, 0, "eepro", NULL) == 0)) + (request_irq(dev->irq = *irqp, &eepro_interrupt, 0, "eepro", dev) == 0)) break; /* clear all interrupts */ @@ -560,10 +560,6 @@ return -EAGAIN; } - if (irq2dev_map[dev->irq] != 0 - || (irq2dev_map[dev->irq] = dev) == 0) - return -EAGAIN; - /* Initialize the 82595. */ outb(BANK2_SELECT, ioaddr); /* be CAREFUL, BANK 2 now */ @@ -741,7 +737,7 @@ static void eepro_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; int ioaddr, status, boguscount = 20; if (net_debug > 5) @@ -824,8 +820,6 @@ /* release the interrupt */ free_irq(dev->irq, NULL); - - irq2dev_map[dev->irq] = 0; /* Update the statistics here. What statistics? */ diff -u --recursive --new-file v2.1.59/linux/drivers/net/eepro100.c linux/drivers/net/eepro100.c --- v2.1.59/linux/drivers/net/eepro100.c Sun Sep 7 13:10:42 1997 +++ linux/drivers/net/eepro100.c Wed Oct 22 08:31:16 1997 @@ -447,11 +447,7 @@ static void speedo_init_rx_ring(struct device *dev); static int speedo_start_xmit(struct sk_buff *skb, struct device *dev); static int speedo_rx(struct device *dev); -#ifdef SA_SHIRQ static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs); -#else -static void speedo_interrupt(int irq, struct pt_regs *regs); -#endif static int speedo_close(struct device *dev); static struct enet_statistics *speedo_get_stats(struct device *dev); static void set_rx_mode(struct device *dev); @@ -823,26 +819,10 @@ SLOW_DOWN_IO; /* At least 250ns */ #endif -#ifdef SA_SHIRQ if (request_irq(dev->irq, &speedo_interrupt, SA_SHIRQ, "Intel EtherExpress Pro 10/100 Ethernet", dev)) { return -EAGAIN; } -#else -#ifdef USE_SHARED_IRQ - if (request_shared_irq(dev->irq, &speedo_interrupt, dev, - "Intel EtherExpress Pro 10/100 Ethernet")) - return -EAGAIN; -#else - if (dev->irq < 2 || dev->irq > 15 || irq2dev_map[dev->irq] != NULL) - return -EAGAIN; - irq2dev_map[dev->irq] = dev; - if (request_irq(dev->irq, &speedo_interrupt, 0, "Intel EtherExpress Pro 10/100 Ethernet")) { - irq2dev_map[dev->irq] = NULL; - return -EAGAIN; - } -#endif -#endif if (speedo_debug > 1) printk(KERN_DEBUG "%s: speedo_open() irq %d.\n", dev->name, dev->irq); @@ -1116,21 +1096,9 @@ /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -#ifdef SA_SHIRQ static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs) -#else -static void speedo_interrupt(int irq, struct pt_regs *regs) -#endif { -#ifdef SA_SHIRQ struct device *dev = (struct device *)dev_instance; -#else -#ifdef USE_SHARED_IRQ - struct device *dev = (struct device *)(irq == 0 ? regs : irq2dev_map[irq]); -#else - struct device *dev = (struct device *)(irq2dev_map[irq]); -#endif -#endif struct speedo_private *sp; int ioaddr, boguscnt = INTR_WORK; unsigned short status; @@ -1254,11 +1222,7 @@ if (dev->start == 0 && --stopit < 0) { printk(KERN_ALERT "%s: Emergency stop, interrupt is stuck.\n", dev->name); -#ifdef SA_SHIRQ free_irq(irq, dev); -#else - free_irq(irq); -#endif } } #endif @@ -1438,12 +1402,7 @@ outw(INT_MASK, ioaddr + SCBCmd); outw(INT_MASK | RX_ABORT, ioaddr + SCBCmd); -#ifdef SA_SHIRQ free_irq(dev->irq, dev); -#else - free_irq(dev->irq); - irq2dev_map[dev->irq] = 0; -#endif /* Free all the skbuffs in the Rx and Tx queues. */ for (i = 0; i < RX_RING_SIZE; i++) { diff -u --recursive --new-file v2.1.59/linux/drivers/net/eexpress.c linux/drivers/net/eexpress.c --- v2.1.59/linux/drivers/net/eexpress.c Sun Jul 27 12:11:00 1997 +++ linux/drivers/net/eexpress.c Wed Oct 22 08:27:32 1997 @@ -346,9 +346,7 @@ if (!irq || !irqrmap[irq]) return -ENXIO; - if (irq2dev_map[irq] || - ((irq2dev_map[irq]=dev),0) || - request_irq(irq,&eexp_irq,0,"EtherExpress",NULL)) + if (request_irq(irq,&eexp_irq,0,"EtherExpress",dev)) return -EAGAIN; request_region(ioaddr, EEXP_IO_EXTENT, "EtherExpress"); @@ -391,7 +389,6 @@ scb_command(dev, SCB_CUsuspend|SCB_RUsuspend); outb(0,ioaddr+SIGNAL_CA); free_irq(irq,NULL); - irq2dev_map[irq] = NULL; outb(i586_RST,ioaddr+EEPROM_Ctrl); release_region(ioaddr,16); @@ -628,7 +625,7 @@ static void eexp_irq(int irq, void *dev_info, struct pt_regs *regs) { - struct device *dev = irq2dev_map[irq]; + struct device *dev = dev_info; struct net_local *lp; unsigned short ioaddr,status,ack_cmd; unsigned short old_read_ptr, old_write_ptr; diff -u --recursive --new-file v2.1.59/linux/drivers/net/es3210.c linux/drivers/net/es3210.c --- v2.1.59/linux/drivers/net/es3210.c Wed Apr 23 19:01:19 1997 +++ linux/drivers/net/es3210.c Wed Oct 22 08:27:32 1997 @@ -214,7 +214,7 @@ printk(" assigning IRQ %d", dev->irq); } - if (request_irq(dev->irq, ei_interrupt, 0, "es3210", NULL)) { + if (request_irq(dev->irq, ei_interrupt, 0, "es3210", dev)) { printk (" unable to get IRQ %d.\n", dev->irq); return EAGAIN; } @@ -433,7 +433,6 @@ kfree(dev->priv); dev->priv = NULL; free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = NULL; release_region(dev->base_addr, ES_IO_EXTENT); unregister_netdev(dev); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/eth16i.c linux/drivers/net/eth16i.c --- v2.1.59/linux/drivers/net/eth16i.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/eth16i.c Wed Oct 22 08:27:32 1997 @@ -434,7 +434,7 @@ dev->irq = irq; /* Try to obtain interrupt vector */ - if(request_irq(dev->irq, ð16i_interrupt, 0, "eth16i", NULL)) { + if(request_irq(dev->irq, ð16i_interrupt, 0, "eth16i", dev)) { printk("%s: %s at %#3x, but is unusable due conflict on IRQ %d.\n", dev->name, cardname, ioaddr, irq); return EAGAIN; @@ -807,8 +807,6 @@ struct eth16i_local *lp = (struct eth16i_local *)dev->priv; int ioaddr = dev->base_addr; - irq2dev_map[dev->irq] = dev; - /* Powerup the chip */ outb(0xc0 | POWERUP, ioaddr + CONFIG_REG_1); @@ -1106,7 +1104,7 @@ static void eth16i_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct eth16i_local *lp; int ioaddr = 0, status; @@ -1228,7 +1226,6 @@ { unregister_netdev( &dev_eth16i ); free_irq( dev_eth16i.irq, NULL ); - irq2dev_map[ dev_eth16i.irq ] = NULL; release_region( dev_eth16i.base_addr, ETH16I_IO_EXTENT ); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/ewrk3.c linux/drivers/net/ewrk3.c --- v2.1.59/linux/drivers/net/ewrk3.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/ewrk3.c Wed Oct 22 08:27:32 1997 @@ -628,9 +628,7 @@ STOP_EWRK3; if (!lp->hard_strapped) { - irq2dev_map[dev->irq] = dev; /* For latched interrupts */ - - if (request_irq(dev->irq, (void *)ewrk3_interrupt, 0, "ewrk3", NULL)) { + if (request_irq(dev->irq, (void *)ewrk3_interrupt, 0, "ewrk3", dev)) { printk("ewrk3_open(): Requested IRQ%d is busy\n",dev->irq); status = -EAGAIN; } else { @@ -877,7 +875,7 @@ static void ewrk3_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct ewrk3_private *lp; u_long iobase; u_char icr, cr, csr; @@ -1151,8 +1149,6 @@ if (!lp->hard_strapped) { free_irq(dev->irq, NULL); - - irq2dev_map[dev->irq] = 0; } MOD_DEC_USE_COUNT; @@ -1177,24 +1173,22 @@ u_long iobase = dev->base_addr; u_char csr; - if (irq2dev_map[dev->irq] != NULL) { - csr = inb(EWRK3_CSR); + csr = inb(EWRK3_CSR); - if (lp->shmem_length == IO_ONLY) { - lp->mctbl = (char *) PAGE0_HTE; - } else { - lp->mctbl = (char *)(lp->shmem_base + PAGE0_HTE); - } + if (lp->shmem_length == IO_ONLY) { + lp->mctbl = (char *) PAGE0_HTE; + } else { + lp->mctbl = (char *)(lp->shmem_base + PAGE0_HTE); + } - csr &= ~(CSR_PME | CSR_MCE); - if (dev->flags & IFF_PROMISC) { /* set promiscuous mode */ - csr |= CSR_PME; - outb(csr, EWRK3_CSR); - } else { - SetMulticastFilter(dev); - csr |= CSR_MCE; - outb(csr, EWRK3_CSR); - } + csr &= ~(CSR_PME | CSR_MCE); + if (dev->flags & IFF_PROMISC) { /* set promiscuous mode */ + csr |= CSR_PME; + outb(csr, EWRK3_CSR); + } else { + SetMulticastFilter(dev); + csr |= CSR_MCE; + outb(csr, EWRK3_CSR); } } diff -u --recursive --new-file v2.1.59/linux/drivers/net/fmv18x.c linux/drivers/net/fmv18x.c --- v2.1.59/linux/drivers/net/fmv18x.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/fmv18x.c Wed Oct 22 08:27:32 1997 @@ -180,7 +180,7 @@ irq = irqmap[(inb(ioaddr + FJ_CONFIG0)>>6) & 0x03]; /* Snarf the interrupt vector now. */ - if (request_irq(irq, &net_interrupt, 0, "fmv18x", NULL)) { + if (request_irq(irq, &net_interrupt, 0, "fmv18x", dev)) { printk ("FMV-18x found at %#3x, but it's unusable due to a conflict on" "IRQ %d.\n", ioaddr, irq); return EAGAIN; @@ -199,7 +199,6 @@ dev->base_addr = ioaddr; dev->irq = irq; - irq2dev_map[irq] = dev; for(i = 0; i < 6; i++) { unsigned char val = inb(ioaddr + FJ_MACADDR + i); @@ -399,7 +398,7 @@ static void net_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct net_local *lp; int ioaddr, status; @@ -643,7 +642,6 @@ /* If we don't do this, we can't re-insmod it later. */ free_irq(dev_fmv18x.irq, NULL); - irq2dev_map[dev_fmv18x.irq] = NULL; release_region(dev_fmv18x.base_addr, FMV18X_IO_EXTENT); } #endif /* MODULE */ diff -u --recursive --new-file v2.1.59/linux/drivers/net/hp-plus.c linux/drivers/net/hp-plus.c --- v2.1.59/linux/drivers/net/hp-plus.c Wed Apr 23 19:01:19 1997 +++ linux/drivers/net/hp-plus.c Wed Oct 22 08:27:32 1997 @@ -259,7 +259,7 @@ int ioaddr = dev->base_addr - NIC_OFFSET; int option_reg; - if (request_irq(dev->irq, &ei_interrupt, 0, "hp-plus", NULL)) { + if (request_irq(dev->irq, &ei_interrupt, 0, "hp-plus", dev)) { return -EAGAIN; } @@ -289,7 +289,6 @@ int option_reg = inw(ioaddr + HPP_OPTION); free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = NULL; ei_close(dev); outw((option_reg & ~EnableIRQ) | MemDisable | NICReset | ChipReset, ioaddr + HPP_OPTION); @@ -465,7 +464,7 @@ for (this_dev = 0; this_dev < MAX_HPP_CARDS; this_dev++) { struct device *dev = &dev_hpp[this_dev]; if (dev->priv != NULL) { - /* NB: hpp_close() handles free_irq + irq2dev map */ + /* NB: hpp_close() handles free_irq */ int ioaddr = dev->base_addr - NIC_OFFSET; kfree(dev->priv); dev->priv = NULL; diff -u --recursive --new-file v2.1.59/linux/drivers/net/hp.c linux/drivers/net/hp.c --- v2.1.59/linux/drivers/net/hp.c Wed Apr 23 19:01:19 1997 +++ linux/drivers/net/hp.c Wed Oct 22 08:27:32 1997 @@ -157,7 +157,7 @@ outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE); outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE); if (irq == autoirq_report(0) /* It's a good IRQ line! */ - && request_irq (irq, &ei_interrupt, 0, "hp", NULL) == 0) { + && request_irq (irq, &ei_interrupt, 0, "hp", dev) == 0) { printk(" selecting IRQ %d.\n", irq); dev->irq = *irqp; break; @@ -171,7 +171,7 @@ } else { if (dev->irq == 2) dev->irq = 9; - if (request_irq(dev->irq, ei_interrupt, 0, "hp", NULL)) { + if (request_irq(dev->irq, ei_interrupt, 0, "hp", dev)) { printk (" unable to get IRQ %d.\n", dev->irq); return EBUSY; } @@ -436,7 +436,6 @@ kfree(dev->priv); dev->priv = NULL; free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = NULL; release_region(ioaddr, HP_IO_EXTENT); unregister_netdev(dev); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/hp100.c linux/drivers/net/hp100.c --- v2.1.59/linux/drivers/net/hp100.c Sat May 24 09:10:23 1997 +++ linux/drivers/net/hp100.c Wed Oct 22 08:27:32 1997 @@ -1022,14 +1022,12 @@ } } else - if(request_irq(dev->irq, hp100_interrupt, SA_INTERRUPT, lp->id->name, NULL)) + if(request_irq(dev->irq, hp100_interrupt, SA_INTERRUPT, lp->id->name, dev)) { printk( "%s: unable to get IRQ %d\n", dev->name, dev->irq ); return -EAGAIN; } - irq2dev_map[ dev->irq ] = dev; - MOD_INC_USE_COUNT; dev->tbusy = 0; @@ -1077,7 +1075,6 @@ free_irq( dev->irq, dev ); else free_irq( dev->irq, NULL ); - irq2dev_map[ dev->irq ] = NULL; MOD_DEC_USE_COUNT; return 0; } @@ -2104,7 +2101,7 @@ static void hp100_interrupt( int irq, void *dev_id, struct pt_regs *regs ) { - struct device *dev = (struct device *)irq2dev_map[ irq ]; + struct device *dev = dev_id; struct hp100_private *lp = (struct hp100_private *)dev->priv; int ioaddr; diff -u --recursive --new-file v2.1.59/linux/drivers/net/ibmtr.c linux/drivers/net/ibmtr.c --- v2.1.59/linux/drivers/net/ibmtr.c Thu Sep 4 17:07:30 1997 +++ linux/drivers/net/ibmtr.c Wed Oct 22 08:27:32 1997 @@ -567,12 +567,11 @@ DPRINTK("Using %dK shared RAM\n",ti->mapped_ram_size/2); #endif - if (request_irq (dev->irq = irq, &tok_interrupt,0,"ibmtr", NULL) != 0) { + if (request_irq (dev->irq = irq, &tok_interrupt,0,"ibmtr", dev) != 0) { DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n",irq); kfree_s(ti, sizeof(struct tok_info)); return -ENODEV; } - irq2dev_map[irq]=dev; /*?? Now, allocate some of the PIO PORTs for this driver.. */ request_region(PIOaddr,IBMTR_IO_EXTENT,"ibmtr"); /* record PIOaddr range @@ -701,7 +700,7 @@ #if TR_VERBOSE DPRINTK("Int from tok_driver, dev : %p\n",dev); #endif - dev = (struct device *)(irq2dev_map[irq]); + dev = dev_id; ti = (struct tok_info *) dev->priv; /* Disable interrupts till processing is finished */ @@ -1579,7 +1578,6 @@ if (dev_ibmtr[i]) { unregister_trdev(dev_ibmtr[i]); free_irq(dev_ibmtr[i]->irq, NULL); - irq2dev_map[dev_ibmtr[i]->irq] = NULL; release_region(dev_ibmtr[i]->base_addr, IBMTR_IO_EXTENT); kfree_s(dev_ibmtr[i]->priv, sizeof(struct tok_info)); kfree_s(dev_ibmtr[i], sizeof(struct device)); diff -u --recursive --new-file v2.1.59/linux/drivers/net/lance.c linux/drivers/net/lance.c --- v2.1.59/linux/drivers/net/lance.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/lance.c Wed Oct 22 08:27:32 1997 @@ -643,15 +643,13 @@ int i; if (dev->irq == 0 || - request_irq(dev->irq, &lance_interrupt, 0, lp->name, NULL)) { + request_irq(dev->irq, &lance_interrupt, 0, lp->name, dev)) { return -EAGAIN; } /* We used to allocate DMA here, but that was silly. DMA lines can't be shared! We now permanently allocate them. */ - irq2dev_map[dev->irq] = dev; - /* Reset the LANCE */ inw(ioaddr+LANCE_RESET); @@ -902,7 +900,7 @@ static void lance_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct lance_private *lp; int csr0, ioaddr, boguscnt=10; int must_restart; @@ -1132,8 +1130,6 @@ disable_dma(dev->dma); free_irq(dev->irq, NULL); - - irq2dev_map[dev->irq] = 0; return 0; } diff -u --recursive --new-file v2.1.59/linux/drivers/net/ltpc.c linux/drivers/net/ltpc.c --- v2.1.59/linux/drivers/net/ltpc.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/ltpc.c Wed Oct 22 08:27:32 1997 @@ -755,7 +755,7 @@ static void ltpc_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr) { - struct device *dev = (struct device *) irq2dev_map[irq]; + struct device *dev = dev_id; if (dev==NULL) { printk("ltpc_interrupt: unknown device.\n"); @@ -984,9 +984,9 @@ save_flags(flags); cli(); - probe3 = request_irq( 3, <_probe_handler, 0, "ltpc_probe",NULL); - probe4 = request_irq( 4, <_probe_handler, 0, "ltpc_probe",NULL); - probe9 = request_irq( 9, <_probe_handler, 0, "ltpc_probe",NULL); + probe3 = request_irq( 3, <_probe_handler, 0, "ltpc_probe",dev); + probe4 = request_irq( 4, <_probe_handler, 0, "ltpc_probe",dev); + probe9 = request_irq( 9, <_probe_handler, 0, "ltpc_probe",dev); irqhitmask = 0; @@ -1193,8 +1193,7 @@ ltpc_timer.data = (unsigned long) dev; if (irq) { - irq2dev_map[irq] = dev; - (void) request_irq( irq, <pc_interrupt, 0, "ltpc",NULL); + (void) request_irq( irq, <pc_interrupt, 0, "ltpc", dev); (void) inb_p(base+7); /* enable interrupts from board */ (void) inb_p(base+7); /* and reset irq line */ ltpc_timer.expires = 100; diff -u --recursive --new-file v2.1.59/linux/drivers/net/ne.c linux/drivers/net/ne.c --- v2.1.59/linux/drivers/net/ne.c Mon Oct 20 10:36:52 1997 +++ linux/drivers/net/ne.c Wed Oct 22 08:27:32 1997 @@ -427,7 +427,8 @@ /* Snarf the interrupt now. There's no point in waiting since we cannot share and the board will usually be enabled. */ { - int irqval = request_irq(dev->irq, ei_interrupt, SA_INTERRUPT, name, NULL); + int irqval = request_irq(dev->irq, ei_interrupt, + pci_irq_line ? SA_SHIRQ : 0, name, dev); if (irqval) { printk (" unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval); return EAGAIN; @@ -785,7 +786,6 @@ kfree(dev->priv); dev->priv = NULL; free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = NULL; release_region(dev->base_addr, NE_IO_EXTENT); unregister_netdev(dev); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/ni52.c linux/drivers/net/ni52.c --- v2.1.59/linux/drivers/net/ni52.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/ni52.c Wed Oct 22 08:27:32 1997 @@ -241,7 +241,6 @@ static int ni52_close(struct device *dev) { free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = NULL; ni_reset586(); /* the hard way to stop the receiver */ @@ -264,12 +263,11 @@ startrecv586(dev); ni_enaint(); - if(request_irq(dev->irq, &ni52_interrupt,0,"ni5210",NULL)) + if(request_irq(dev->irq, &ni52_interrupt,0,"ni5210",dev)) { ni_reset586(); return -EAGAIN; } - irq2dev_map[dev->irq] = dev; dev->interrupt = 0; dev->tbusy = 0; @@ -819,7 +817,7 @@ static void ni52_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr) { - struct device *dev = (struct device *) irq2dev_map[irq]; + struct device *dev = dev_id; unsigned short stat; int cnt=0; struct priv *p; diff -u --recursive --new-file v2.1.59/linux/drivers/net/ni65.c linux/drivers/net/ni65.c --- v2.1.59/linux/drivers/net/ni65.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/ni65.c Wed Oct 22 08:27:32 1997 @@ -268,13 +268,12 @@ { struct priv *p = (struct priv *) dev->priv; int irqval = request_irq(dev->irq, &ni65_interrupt,0, - cards[p->cardno].cardname,NULL); + cards[p->cardno].cardname,dev); if (irqval) { printk ("%s: unable to get IRQ %d (irqval=%d).\n", dev->name,dev->irq, irqval); return -EAGAIN; } - irq2dev_map[dev->irq] = dev; if(ni65_lance_reinit(dev)) { @@ -286,7 +285,6 @@ } else { - irq2dev_map[dev->irq] = NULL; free_irq(dev->irq,NULL); dev->start = 0; return -EAGAIN; @@ -314,7 +312,6 @@ } } #endif - irq2dev_map[dev->irq] = NULL; free_irq(dev->irq,NULL); dev->tbusy = 1; dev->start = 0; @@ -795,7 +792,7 @@ static void ni65_interrupt(int irq, void * dev_id, struct pt_regs * regs) { int csr0; - struct device *dev = (struct device *) irq2dev_map[irq]; + struct device *dev = dev_id; struct priv *p; int bcnt = 32; diff -u --recursive --new-file v2.1.59/linux/drivers/net/pi2.c linux/drivers/net/pi2.c --- v2.1.59/linux/drivers/net/pi2.c Thu May 29 21:53:07 1997 +++ linux/drivers/net/pi2.c Wed Oct 22 08:27:32 1997 @@ -1374,7 +1374,7 @@ now. There is no point in waiting since no other device can use the interrupt, and this marks the 'irqaction' as busy. */ { - int irqval = request_irq(dev->irq, &pi_interrupt,0, "pi2", NULL); + int irqval = request_irq(dev->irq, &pi_interrupt,0, "pi2", dev); if (irqval) { printk(KERN_ERR "PI: unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval); @@ -1442,7 +1442,6 @@ free_irq(dev->irq, NULL); return -EAGAIN; } - irq2dev_map[dev->irq] = dev; } /* Reset the hardware here. */ chipset_init(dev); @@ -1672,7 +1671,6 @@ { free_irq(pi0a.irq, NULL); /* IRQs and IO Ports are shared */ release_region(pi0a.base_addr & 0x3f0, PI_TOTAL_SIZE); - irq2dev_map[pi0a.irq] = NULL; kfree(pi0a.priv); pi0a.priv = NULL; diff -u --recursive --new-file v2.1.59/linux/drivers/net/plip.c linux/drivers/net/plip.c --- v2.1.59/linux/drivers/net/plip.c Mon Aug 11 14:47:04 1997 +++ linux/drivers/net/plip.c Wed Oct 22 08:27:32 1997 @@ -797,7 +797,7 @@ static void plip_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *) irq2dev_map[irq]; + struct device *dev = dev_id; struct net_local *nl; struct plip_local *rcv; unsigned char c0; @@ -981,7 +981,6 @@ dev->interrupt = 0; dev->start = 1; dev->tbusy = 0; - irq2dev_map[dev->irq] = dev; MOD_INC_USE_COUNT; return 0; @@ -998,7 +997,6 @@ dev->tbusy = 1; dev->start = 0; cli(); - irq2dev_map[dev->irq] = NULL; sti(); #ifdef NOTDEF outb(0x00, PAR_DATA(dev)); @@ -1067,7 +1065,6 @@ if (!parport_claim(nl->pardev)) { nl->port_owner = 1; - irq2dev_map[dev->irq] = dev; /* Clear the data port. */ outb (0x00, PAR_DATA(dev)); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/ppp.c linux/drivers/net/ppp.c --- v2.1.59/linux/drivers/net/ppp.c Wed Sep 24 20:05:47 1997 +++ linux/drivers/net/ppp.c Tue Oct 21 08:57:28 1997 @@ -190,10 +190,10 @@ * TTY callbacks */ -static int ppp_tty_read (struct tty_struct *, struct file *, __u8 *, - unsigned int); -static int ppp_tty_write (struct tty_struct *, struct file *, const __u8 *, - unsigned int); +static ssize_t ppp_tty_read (struct tty_struct *, struct file *, __u8 *, + size_t); +static ssize_t ppp_tty_write (struct tty_struct *, struct file *, + const __u8 *, size_t); static int ppp_tty_ioctl (struct tty_struct *, struct file *, unsigned int, unsigned long); static unsigned int ppp_tty_poll (struct tty_struct *tty, struct file *filp, poll_table * wait); @@ -1665,13 +1665,12 @@ waiting if necessary */ -static int -ppp_tty_read (struct tty_struct *tty, struct file *file, __u8 * buf, - unsigned int nr) +static ssize_t +ppp_tty_read (struct tty_struct *tty, struct file *file, __u8 * buf, size_t nr) { struct ppp *ppp = tty2ppp (tty); __u8 c; - int len, indx; + ssize_t len, indx; #define GETC(c) \ { \ @@ -1692,8 +1691,8 @@ if (ppp->flags & SC_DEBUG) printk (KERN_DEBUG - "ppp_tty_read: called buf=%p nr=%u\n", - buf, nr); + "ppp_tty_read: called buf=%p nr=%lu\n", + buf, (unsigned long)nr); /* * Acquire the read lock. */ @@ -1761,7 +1760,8 @@ * Reset the time of the last read operation. */ if (ppp->flags & SC_DEBUG) - printk (KERN_DEBUG "ppp_tty_read: len = %d\n", len); + printk (KERN_DEBUG "ppp_tty_read: len = %ld\n", + (long)len); /* * Ensure that the frame will fit within the caller's buffer. If not, then * discard the frame from the input buffer. @@ -1771,8 +1771,8 @@ if (ppp->flags & SC_DEBUG) printk (KERN_DEBUG - "ppp: read of %u bytes too small for %d " - "frame\n", nr, len + 2); + "ppp: read of %lu bytes too small for %ld " + "frame\n", (unsigned long)nr, (long)len + 2); ppp->ubuf->tail += len; ppp->ubuf->tail &= ppp->ubuf->size; clear_bit (0, &ppp->ubuf->locked); @@ -1811,7 +1811,8 @@ len += 2; /* Account for ADDRESS and CONTROL bytes */ if (ppp->flags & SC_DEBUG) printk (KERN_DEBUG - "ppp_tty_read: passing %d bytes up\n", len); + "ppp_tty_read: passing %ld bytes up\n", + (long) len); return len; } #undef GETC @@ -2051,13 +2052,13 @@ * we have to put the FCS field on ourselves */ -static int +static ssize_t ppp_tty_write (struct tty_struct *tty, struct file *file, const __u8 * data, - unsigned int count) + size_t count) { struct ppp *ppp = tty2ppp (tty); __u8 *new_data; - int status; + ssize_t status; /* * Verify the pointers. */ @@ -2075,7 +2076,8 @@ if (ppp->flags & SC_DEBUG) printk (KERN_WARNING "ppp_tty_write: truncating user packet " - "from %u to mtu %d\n", count, PPP_MTU); + "from %lu to mtu %d\n", + (unsigned long) count, PPP_MTU); count = PPP_MTU; } /* @@ -2129,7 +2131,7 @@ */ ppp_dev_xmit_frame (ppp, ppp->tbuf, new_data, count); kfree (new_data); - return (int) count; + return count; } /* diff -u --recursive --new-file v2.1.59/linux/drivers/net/pt.c linux/drivers/net/pt.c --- v2.1.59/linux/drivers/net/pt.c Thu May 29 21:53:07 1997 +++ linux/drivers/net/pt.c Wed Oct 22 08:27:32 1997 @@ -830,7 +830,7 @@ * the interrupt, and this marks the 'irqaction' as busy. */ { - int irqval = request_irq(dev->irq, &pt_interrupt,0, "pt", NULL); + int irqval = request_irq(dev->irq, &pt_interrupt,0, "pt", dev); if (irqval) { printk(KERN_ERR "PT: ERROR: Unable to get IRQ %d (irqval = %d).\n", dev->irq, irqval); @@ -900,7 +900,6 @@ return -EAGAIN; } } - irq2dev_map[dev->irq] = dev; /* Reset hardware */ chipset_init(dev); @@ -1772,7 +1771,6 @@ { free_irq(pt0a.irq, NULL); /* IRQs and IO Ports are shared */ release_region(pt0a.base_addr & 0x3f0, PT_TOTAL_SIZE); - irq2dev_map[pt0a.irq] = NULL; kfree(pt0a.priv); pt0a.priv = NULL; diff -u --recursive --new-file v2.1.59/linux/drivers/net/sdla.c linux/drivers/net/sdla.c --- v2.1.59/linux/drivers/net/sdla.c Tue May 13 22:41:09 1997 +++ linux/drivers/net/sdla.c Wed Oct 22 08:27:32 1997 @@ -872,7 +872,7 @@ struct frad_local *flp; char byte; - dev = irq2dev_map[irq]; + dev = dev_id; if (dev == NULL) { @@ -1475,10 +1475,8 @@ } dev->irq = map->irq; - if (request_irq(dev->irq, &sdla_isr, 0, dev->name, NULL)) + if (request_irq(dev->irq, &sdla_isr, 0, dev->name, dev)) return(-EAGAIN); - - irq2dev_map[dev->irq] = dev; if (flp->type == SDLA_S507) { diff -u --recursive --new-file v2.1.59/linux/drivers/net/seeq8005.c linux/drivers/net/seeq8005.c --- v2.1.59/linux/drivers/net/seeq8005.c Tue May 13 22:41:11 1997 +++ linux/drivers/net/seeq8005.c Wed Oct 22 08:27:32 1997 @@ -305,7 +305,7 @@ #if 0 { - int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", NULL); + int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", dev); if (irqval) { printk ("%s: unable to get IRQ %d (irqval=%d).\n", dev->name, dev->irq, irqval); @@ -351,14 +351,13 @@ struct net_local *lp = (struct net_local *)dev->priv; { - int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", NULL); + int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", dev); if (irqval) { printk ("%s: unable to get IRQ %d (irqval=%d).\n", dev->name, dev->irq, irqval); return EAGAIN; } } - irq2dev_map[dev->irq] = dev; /* Reset the hardware here. Don't forget to set the station address. */ seeq8005_init(dev, 1); @@ -413,7 +412,7 @@ static void seeq8005_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct net_local *lp; int ioaddr, status, boguscount = 0; @@ -575,8 +574,6 @@ outw( SEEQCMD_SET_ALL_OFF, SEEQ_CMD); free_irq(dev->irq, NULL); - - irq2dev_map[dev->irq] = 0; /* Update the statistics here. */ diff -u --recursive --new-file v2.1.59/linux/drivers/net/sk_g16.c linux/drivers/net/sk_g16.c --- v2.1.59/linux/drivers/net/sk_g16.c Tue May 13 22:41:11 1997 +++ linux/drivers/net/sk_g16.c Wed Oct 22 08:27:32 1997 @@ -451,8 +451,6 @@ /* IRQ map used to reserve a IRQ (see SK_open()) */ -/* extern void *irq2dev_map[16]; */ /* Declared in */ - /* static variables */ static SK_RAM *board; /* pointer to our memory mapped board components */ @@ -610,8 +608,7 @@ * Return Value : 0 = Initialization done * Errors : ENODEV - No SK_G16 found * -1 - Configuration problem - * Globals : irq2dev_map - Which device uses which IRQ - * : board - pointer to SK_RAM + * Globals : board - pointer to SK_RAM * Update History : * YY/MM/DD uid Description * 94/06/30 pwe SK_ADDR now checked and at the correct place @@ -838,7 +835,6 @@ * Parameters : I : struct device *dev - SK_G16 device structure * Return Value : 0 - Device opened * Errors : -EAGAIN - Open failed - * Globals : irq2dev_map - which device uses which irq * Side Effects : None * Update History : * YY/MM/DD uid Description @@ -872,7 +868,7 @@ do { - irqval = request_irq(irqtab[i], &SK_interrupt, 0, "sk_g16", NULL); + irqval = request_irq(irqtab[i], &SK_interrupt, 0, "sk_g16", dev); i++; } while (irqval && irqtab[i]); @@ -889,7 +885,7 @@ } else if (dev->irq == 2) /* IRQ2 is always IRQ9 */ { - if (request_irq(9, &SK_interrupt, 0, "sk_g16", NULL)) + if (request_irq(9, &SK_interrupt, 0, "sk_g16", dev)) { printk("%s: unable to get IRQ 9\n", dev->name); return -EAGAIN; @@ -910,7 +906,7 @@ /* check if IRQ free and valid. Then install Interrupt handler */ - if (request_irq(dev->irq, &SK_interrupt, 0, "sk_g16", NULL)) + if (request_irq(dev->irq, &SK_interrupt, 0, "sk_g16", dev)) { printk("%s: unable to get selected IRQ\n", dev->name); return -EAGAIN; @@ -937,8 +933,6 @@ outb(i<<2, SK_POS4); /* Set IRQ on card */ } - irq2dev_map[dev->irq] = dev; /* Set IRQ as used by us */ - printk("%s: Schneider & Koch G16 at %#3x, IRQ %d, shared mem at %#08x\n", dev->name, (unsigned int)dev->base_addr, (int) dev->irq, (unsigned int) p->ram); @@ -1282,7 +1276,7 @@ static void SK_interrupt(int irq, void *dev_id, struct pt_regs * regs) { int csr0; - struct device *dev = (struct device *) irq2dev_map[irq]; + struct device *dev = dev_id; struct priv *p = (struct priv *) dev->priv; @@ -1637,7 +1631,6 @@ SK_write_reg(CSR0, CSR0_STOP); /* STOP the LANCE */ free_irq(dev->irq, NULL); /* Free IRQ */ - irq2dev_map[dev->irq] = 0; /* Mark IRQ as unused */ return 0; /* always succeed */ diff -u --recursive --new-file v2.1.59/linux/drivers/net/skeleton.c linux/drivers/net/skeleton.c --- v2.1.59/linux/drivers/net/skeleton.c Tue May 13 22:41:11 1997 +++ linux/drivers/net/skeleton.c Wed Oct 22 08:27:32 1997 @@ -221,7 +221,7 @@ dev->irq = 9; { - int irqval = request_irq(dev->irq, &net_interrupt, 0, cardname, NULL); + int irqval = request_irq(dev->irq, &net_interrupt, 0, cardname, dev); if (irqval) { printk("%s: unable to get IRQ %d (irqval=%d).\n", dev->name, dev->irq, irqval); @@ -314,7 +314,7 @@ * This is used if the interrupt line can turned off (shared). * See 3c503.c for an example of selecting the IRQ at config-time. */ - if (request_irq(dev->irq, &net_interrupt, 0, cardname, NULL)) { + if (request_irq(dev->irq, &net_interrupt, 0, cardname, dev)) { return -EAGAIN; } /* @@ -325,7 +325,6 @@ free_irq(dev->irq, NULL); return -EAGAIN; } - irq2dev_map[dev->irq] = dev; /* Reset the hardware here. Don't forget to set the station address. */ /*chipset_init(dev, 1);*/ @@ -390,7 +389,7 @@ */ static void net_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; struct net_local *lp; int ioaddr, status, boguscount = 0; @@ -500,8 +499,6 @@ free_irq(dev->irq, NULL); free_dma(dev->dma); - - irq2dev_map[dev->irq] = 0; /* Update the statistics here. */ diff -u --recursive --new-file v2.1.59/linux/drivers/net/smc-mca.c linux/drivers/net/smc-mca.c --- v2.1.59/linux/drivers/net/smc-mca.c Wed Apr 23 19:01:20 1997 +++ linux/drivers/net/smc-mca.c Wed Oct 22 08:27:32 1997 @@ -192,7 +192,7 @@ { int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC addr */ - if (request_irq(dev->irq, ei_interrupt, 0, ei_status.name, NULL)) + if (request_irq(dev->irq, ei_interrupt, 0, ei_status.name, dev)) return -EAGAIN; outb(ULTRA_MEMENB, ioaddr); /* Enable memory */ @@ -290,7 +290,6 @@ outb(0x00, ioaddr + 6); /* Disable interrupts. */ free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = 0; NS8390_init(dev, 0); /* We should someday disable shared memory and change to 8-bit mode @@ -366,7 +365,7 @@ struct device *dev = &dev_ultra[this_dev]; if (dev->priv != NULL) { - /* NB: ultra_close_card() does free_irq + irq2dev */ + /* NB: ultra_close_card() does free_irq */ int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; kfree(dev->priv); dev->priv = NULL; diff -u --recursive --new-file v2.1.59/linux/drivers/net/smc-ultra.c linux/drivers/net/smc-ultra.c --- v2.1.59/linux/drivers/net/smc-ultra.c Wed Apr 23 19:01:20 1997 +++ linux/drivers/net/smc-ultra.c Wed Oct 22 08:27:32 1997 @@ -253,7 +253,7 @@ { int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC addr */ - if (request_irq(dev->irq, ei_interrupt, 0, ei_status.name, NULL)) + if (request_irq(dev->irq, ei_interrupt, 0, ei_status.name, dev)) return -EAGAIN; outb(0x00, ioaddr); /* Disable shared memory for safety. */ @@ -406,7 +406,6 @@ outb(0x00, ioaddr + 6); /* Disable interrupts. */ free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = 0; NS8390_init(dev, 0); @@ -474,7 +473,7 @@ for (this_dev = 0; this_dev < MAX_ULTRA_CARDS; this_dev++) { struct device *dev = &dev_ultra[this_dev]; if (dev->priv != NULL) { - /* NB: ultra_close_card() does free_irq + irq2dev */ + /* NB: ultra_close_card() does free_irq */ int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; kfree(dev->priv); dev->priv = NULL; diff -u --recursive --new-file v2.1.59/linux/drivers/net/smc9194.c linux/drivers/net/smc9194.c --- v2.1.59/linux/drivers/net/smc9194.c Tue May 13 22:41:11 1997 +++ linux/drivers/net/smc9194.c Wed Oct 22 08:27:32 1997 @@ -1102,13 +1102,12 @@ ether_setup(dev); /* Grab the IRQ */ - irqval = request_irq(dev->irq, &smc_interrupt, 0, CARDNAME, NULL); + irqval = request_irq(dev->irq, &smc_interrupt, 0, CARDNAME, dev); if (irqval) { printk(CARDNAME": unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval); return -EAGAIN; } - irq2dev_map[dev->irq] = dev; /* Grab the region so that no one else tries to probe our ioports. */ request_region(ioaddr, SMC_IO_EXTENT, CARDNAME); @@ -1274,7 +1273,7 @@ static void smc_interrupt(int irq, struct pt_regs * regs) #endif { - struct device *dev = (struct device *)(irq2dev_map[irq]); + struct device *dev = dev_id; int ioaddr = dev->base_addr; struct smc_local *lp = (struct smc_local *)dev->priv; @@ -1765,7 +1764,6 @@ unregister_netdev(&devSMC9194); free_irq(devSMC9194.irq, NULL ); - irq2dev_map[devSMC9194.irq] = NULL; release_region(devSMC9194.base_addr, SMC_IO_EXTENT); if (devSMC9194.priv) diff -u --recursive --new-file v2.1.59/linux/drivers/net/wavelan.c linux/drivers/net/wavelan.c --- v2.1.59/linux/drivers/net/wavelan.c Tue May 13 22:41:12 1997 +++ linux/drivers/net/wavelan.c Wed Oct 22 08:27:32 1997 @@ -3666,14 +3666,7 @@ u_short status; u_short ack_cmd; - if((dev = (device *) (irq2dev_map[irq])) == (device *) NULL) - { -#ifdef DEBUG_INTERRUPT_ERROR - printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n", - irq); -#endif - return; - } + dev = dev_id; #ifdef DEBUG_INTERRUPT_TRACE printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name); @@ -3913,12 +3906,8 @@ return -ENXIO; } - if((irq2dev_map[dev->irq] != (device *) NULL) || - /* This is always true, but avoid the false IRQ. */ - ((irq2dev_map[dev->irq] = dev) == (device *) NULL) || - (request_irq(dev->irq, &wavelan_interrupt, 0, "WaveLAN", NULL) != 0)) + if(request_irq(dev->irq, &wavelan_interrupt, 0, "WaveLAN", dev) != 0) { - irq2dev_map[dev->irq] = (device *) NULL; #ifdef DEBUG_CONFIG_ERRORS printk(KERN_WARNING "%s: wavelan_open(): invalid irq\n", dev->name); #endif @@ -3934,7 +3923,6 @@ else { free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = (device *) NULL; #ifdef DEBUG_CONFIG_ERRORS printk(KERN_INFO "%s: wavelan_open(): impossible to start the card\n", dev->name); @@ -3983,7 +3971,6 @@ wv_82586_stop(dev); free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = (device *) NULL; MOD_DEC_USE_COUNT; diff -u --recursive --new-file v2.1.59/linux/drivers/net/wd.c linux/drivers/net/wd.c --- v2.1.59/linux/drivers/net/wd.c Wed Apr 23 19:01:20 1997 +++ linux/drivers/net/wd.c Wed Oct 22 08:27:32 1997 @@ -254,7 +254,7 @@ /* Snarf the interrupt now. There's no point in waiting since we cannot share and the board will usually be enabled. */ - if (request_irq(dev->irq, ei_interrupt, 0, model_name, NULL)) { + if (request_irq(dev->irq, ei_interrupt, 0, model_name, dev)) { printk (" unable to get IRQ %d.\n", dev->irq); return EAGAIN; } @@ -500,7 +500,6 @@ kfree(dev->priv); dev->priv = NULL; free_irq(dev->irq, NULL); - irq2dev_map[dev->irq] = NULL; release_region(ioaddr, WD_IO_EXTENT); unregister_netdev(dev); } diff -u --recursive --new-file v2.1.59/linux/drivers/net/znet.c linux/drivers/net/znet.c --- v2.1.59/linux/drivers/net/znet.c Tue May 13 22:41:12 1997 +++ linux/drivers/net/znet.c Wed Oct 22 08:27:32 1997 @@ -247,13 +247,12 @@ zn.tx_dma = netinfo->dma2; /* These should never fail. You can't add devices to a sealed box! */ - if (request_irq(dev->irq, &znet_interrupt, 0, "ZNet", NULL) + if (request_irq(dev->irq, &znet_interrupt, 0, "ZNet", dev) || request_dma(zn.rx_dma,"ZNet rx") || request_dma(zn.tx_dma,"ZNet tx")) { printk(KERN_WARNING "%s: Not opened -- resource busy?!?\n", dev->name); return EBUSY; } - irq2dev_map[dev->irq] = dev; /* Allocate buffer memory. We can cross a 128K boundary, so we must be careful about the allocation. It's easiest to waste 8K. */ @@ -403,7 +402,7 @@ /* The ZNET interrupt handler. */ static void znet_interrupt(int irq, void *dev_id, struct pt_regs * regs) { - struct device *dev = irq2dev_map[irq]; + struct device *dev = dev_id; int ioaddr; int boguscnt = 20; diff -u --recursive --new-file v2.1.59/linux/drivers/pci/pci.c linux/drivers/pci/pci.c --- v2.1.59/linux/drivers/pci/pci.c Sun Sep 7 13:10:42 1997 +++ linux/drivers/pci/pci.c Mon Oct 20 17:25:16 1997 @@ -42,10 +42,15 @@ */ struct pci_dev_info dev_info[] = { DEVICE( COMPAQ, COMPAQ_1280, "QVision 1280/p"), - DEVICE( COMPAQ, COMPAQ_NETELL100,"Netelligent 10/100"), - DEVICE( COMPAQ, COMPAQ_NETELL10,"Netelligent 10"), - DEVICE( COMPAQ, COMPAQ_NETFLEX3,"NetFlex 3"), + DEVICE( COMPAQ, COMPAQ_SMART2P, "Smart-2/P RAID Controller"), + DEVICE( COMPAQ, COMPAQ_NETEL100,"Netelligent 10/100"), + DEVICE( COMPAQ, COMPAQ_NETEL10, "Netelligent 10"), + DEVICE( COMPAQ, COMPAQ_NETFLEX3I,"NetFlex 3"), + DEVICE( COMPAQ, COMPAQ_NETEL100D,"Netelligent 10/100 Dual"), + DEVICE( COMPAQ, COMPAQ_NETEL100PI,"Netelligent 10/100 ProLiant"), + DEVICE( COMPAQ, COMPAQ_NETEL100I,"Netelligent 10/100 Integrated"), DEVICE( COMPAQ, COMPAQ_THUNDER, "ThunderLAN"), + DEVICE( COMPAQ, COMPAQ_NETFLEX3B,"NetFlex 3 BNC"), DEVICE( NCR, NCR_53C810, "53c810"), DEVICE( NCR, NCR_53C820, "53c820"), DEVICE( NCR, NCR_53C825, "53c825"), @@ -58,7 +63,9 @@ DEVICE( ATI, ATI_68800, "68800AX"), DEVICE( ATI, ATI_215CT222, "215CT222"), DEVICE( ATI, ATI_210888CX, "210888CX"), + DEVICE( ATI, ATI_215GP, "Mach64 GP (Rage Pro)"), DEVICE( ATI, ATI_215GT, "Mach64 GT (Rage II)"), + DEVICE( ATI, ATI_215GTB, "Mach64 GT (Rage II)"), DEVICE( ATI, ATI_210888GX, "210888GX"), DEVICE( ATI, ATI_264VT, "Mach64 VT"), DEVICE( VLSI, VLSI_82C592, "82C592-FC1"), @@ -134,7 +141,7 @@ DEVICE( SI, SI_5571, "5571"), DEVICE( SI, SI_7001, "7001"), DEVICE( HP, HP_J2585A, "J2585A"), - DEVICE( HP, HP_J2585B, "J2585B"), + DEVICE( HP, HP_J2585B, "J2585B (Lassen)"), DEVICE( PCTECH, PCTECH_RZ1000, "RZ1000 (buggy)"), DEVICE( PCTECH, PCTECH_RZ1001, "RZ1001 (buggy?)"), DEVICE( DPT, DPT, "SmartCache/Raid"), @@ -156,9 +163,6 @@ DEVICE( MOTOROLA, MOTOROLA_MPC106,"MPC106 Grackle"), DEVICE( MOTOROLA, MOTOROLA_RAVEN, "Raven"), DEVICE( PROMISE, PROMISE_5300, "DC5030"), - DEVICE( APPLE, APPLE_BANDIT, "Bandit"), - DEVICE( APPLE, APPLE_GC, "Grand Central"), - DEVICE( APPLE, APPLE_HYDRA, "Hydra"), DEVICE( N9, N9_I128, "Imagine 128"), DEVICE( N9, N9_I128_2, "Imagine 128v2"), DEVICE( UMC, UMC_UM8673F, "UM8673F"), @@ -171,6 +175,10 @@ DEVICE( UMC, UMC_UM8886N, "UM8886N"), DEVICE( UMC, UMC_UM8891N, "UM8891N"), DEVICE( X, X_AGX016, "ITT AGX016"), + DEVICE( PICOP, PICOP_PT86C52X, "PT86C52x Vesuvius"), + DEVICE( APPLE, APPLE_BANDIT, "Bandit"), + DEVICE( APPLE, APPLE_GC, "Grand Central"), + DEVICE( APPLE, APPLE_HYDRA, "Hydra"), DEVICE( NEXGEN, NEXGEN_82C501, "82C501"), DEVICE( QLOGIC, QLOGIC_ISP1020, "ISP1020"), DEVICE( QLOGIC, QLOGIC_ISP1022, "ISP1022"), @@ -191,7 +199,7 @@ DEVICE( CMD, CMD_670, "670"), DEVICE( VISION, VISION_QD8500, "QD-8500"), DEVICE( VISION, VISION_QD8580, "QD-8580"), - DEVICE( BROOKTREE, BT848, "Brooktree 848"), + DEVICE( BROOKTREE, BROOKTREE_848, "Bt848"), DEVICE( SIERRA, SIERRA_STB, "STB Horizon 64"), DEVICE( ACC, ACC_2056, "2056"), DEVICE( WINBOND, WINBOND_83769, "W83769F"), @@ -205,6 +213,7 @@ DEVICE( 3COM, 3COM_3C900TPO, "3C900 10bTPO"), DEVICE( 3COM, 3COM_3C900COMBO,"3C900 10b Combo"), DEVICE( 3COM, 3COM_3C905TX, "3C905 100bTX"), + DEVICE( SMC, SMC_EPIC100, "9432 TX"), DEVICE( AL, AL_M1445, "M1445"), DEVICE( AL, AL_M1449, "M1449"), DEVICE( AL, AL_M1451, "M1451"), @@ -212,9 +221,16 @@ DEVICE( AL, AL_M1489, "M1489"), DEVICE( AL, AL_M1511, "M1511"), DEVICE( AL, AL_M1513, "M1513"), + DEVICE( AL, AL_M1521, "M1521"), + DEVICE( AL, AL_M1523, "M1523"), + DEVICE( AL, AL_M1531, "M1531 Aladdin IV"), + DEVICE( AL, AL_M1533, "M1533 Aladdin IV"), DEVICE( AL, AL_M4803, "M4803"), + DEVICE( AL, AL_M5219, "M5219"), + DEVICE( AL, AL_M5229, "M5229 TXpro"), DEVICE( NEOMAGIC, NEOMAGIC_MAGICGRAPH_NM2070, "Magicgraph NM2070"), DEVICE( NEOMAGIC, NEOMAGIC_MAGICGRAPH_128V, "MagicGraph 128V"), + DEVICE( NEOMAGIC, NEOMAGIC_MAGICGRAPH_128ZV, "MagicGraph 128ZV"), DEVICE( ASP, ASP_ABP940, "ABP940"), DEVICE( ASP, ASP_ABP940U, "ABP940U"), DEVICE( CERN, CERN_SPSB_PMC, "STAR/RD24 SCI-PCI (PMC)"), @@ -232,12 +248,16 @@ DEVICE( INIT, INIT_320P, "320 P"), DEVICE( VIA, VIA_82C505, "VT 82C505"), DEVICE( VIA, VIA_82C561, "VT 82C561"), - DEVICE( VIA, VIA_82C586_1, "VT 82C586 Apollo VP-1"), + DEVICE( VIA, VIA_82C586_1, "VT 82C586 Apollo IDE"), DEVICE( VIA, VIA_82C576, "VT 82C576 3V"), - DEVICE( VIA, VIA_82C585, "VT 82C585VP Apollo VP-1"), - DEVICE( VIA, VIA_82C586, "VT 82C586 Apollo VP-1"), + DEVICE( VIA, VIA_82C585, "VT 82C585 Apollo VP1/VPX"), + DEVICE( VIA, VIA_82C586_0, "VT 82C586 Apollo ISA"), + DEVICE( VIA, VIA_82C595, "VT 82C595 Apollo VP2"), DEVICE( VIA, VIA_82C416, "VT 82C416MV"), DEVICE( VIA, VIA_82C926, "VT 82C926 Amazon"), + DEVICE( VIA, VIA_82C595_97, "VT 82C595 Apollo VP2/97"), + DEVICE( VIA, VIA_82C586_2, "VT 82C586 Apollo USB"), + DEVICE( VIA, VIA_82C586_3, "VT 82C586B Apollo ACPI"), DEVICE( VORTEX, VORTEX_GDT60x0, "GDT 60x0"), DEVICE( VORTEX, VORTEX_GDT6000B,"GDT 6000b"), DEVICE( VORTEX, VORTEX_GDT6x10, "GDT 6110/6510"), @@ -252,6 +272,24 @@ DEVICE( VORTEX, VORTEX_GDT6x25, "GDT 6125/6525"), DEVICE( VORTEX, VORTEX_GDT6535, "GDT 6535"), DEVICE( VORTEX, VORTEX_GDT6555, "GDT 6555"), + DEVICE( VORTEX, VORTEX_GDT6x17RP,"GDT 6117RP/6517RP"), + DEVICE( VORTEX, VORTEX_GDT6x27RP,"GDT 6127RP/6527RP"), + DEVICE( VORTEX, VORTEX_GDT6537RP,"GDT 6537RP"), + DEVICE( VORTEX, VORTEX_GDT6557RP,"GDT 6557RP"), + DEVICE( VORTEX, VORTEX_GDT6x11RP,"GDT 6111RP/6511RP"), + DEVICE( VORTEX, VORTEX_GDT6x21RP,"GDT 6121RP/6521RP"), + DEVICE( VORTEX, VORTEX_GDT6x17RP1,"GDT 6117RP1/6517RP1"), + DEVICE( VORTEX, VORTEX_GDT6x27RP1,"GDT 6127RP1/6527RP1"), + DEVICE( VORTEX, VORTEX_GDT6537RP1,"GDT 6537RP1"), + DEVICE( VORTEX, VORTEX_GDT6557RP1,"GDT 6557RP1"), + DEVICE( VORTEX, VORTEX_GDT6x11RP1,"GDT 6111RP1/6511RP1"), + DEVICE( VORTEX, VORTEX_GDT6x21RP1,"GDT 6121RP1/6521RP1"), + DEVICE( VORTEX, VORTEX_GDT6x17RP2,"GDT 6117RP2/6517RP2"), + DEVICE( VORTEX, VORTEX_GDT6x27RP2,"GDT 6127RP2/6527RP2"), + DEVICE( VORTEX, VORTEX_GDT6537RP2,"GDT 6537RP2"), + DEVICE( VORTEX, VORTEX_GDT6557RP2,"GDT 6557RP2"), + DEVICE( VORTEX, VORTEX_GDT6x11RP2,"GDT 6111RP2/6511RP2"), + DEVICE( VORTEX, VORTEX_GDT6x21RP2,"GDT 6121RP2/6521RP2"), DEVICE( EF, EF_ATM_FPGA, "155P-MF1 (FPGA)"), DEVICE( EF, EF_ATM_ASIC, "155P-MF1 (ASIC)"), DEVICE( FORE, FORE_PCA200PC, "PCA-200PC"), @@ -261,6 +299,7 @@ DEVICE( PLX, PLX_9060, "PCI9060 i960 bridge"), DEVICE( ALLIANCE, ALLIANCE_PROMOTIO, "Promotion-6410"), DEVICE( ALLIANCE, ALLIANCE_PROVIDEO, "Provideo"), + DEVICE( ALLIANCE, ALLIANCE_AT24, "AT24"), DEVICE( VMIC, VMIC_VME, "VMIVME-7587"), DEVICE( DIGI, DIGI_RIGHTSWITCH, "RightSwitch SE-6"), DEVICE( MUTECH, MUTECH_MV1000, "MV-1000"), @@ -277,6 +316,7 @@ DEVICE( IKON, IKON_10117, "10117 Greensheet"), DEVICE( ZORAN, ZORAN_36057, "ZR36057"), DEVICE( ZORAN, ZORAN_36120, "ZR36120"), + DEVICE( COMPEX, COMPEX_ENET100VG4, "Readylink ENET100-VG4"), DEVICE( COMPEX, COMPEX_RL2000, "ReadyLink 2000"), DEVICE( RP, RP8OCTA, "RocketPort 8 Oct"), DEVICE( RP, RP8INTF, "RocketPort 8 Intf"), @@ -293,6 +333,9 @@ DEVICE( OPTIBASE, OPTIBASE_VPLEX, "VideoPlex"), DEVICE( OPTIBASE, OPTIBASE_VPLEXCC,"VideoPlex CC"), DEVICE( OPTIBASE, OPTIBASE_VQUEST,"VideoQuest"), + DEVICE( ENSONIQ, ENSONIQ_AUDIOPCI,"AudioPCI"), + DEVICE( PICTUREL, PICTUREL_PCIVST,"PCIVST"), + DEVICE( NVIDIA, NVIDIA_RIVA128, "Riva 128"), DEVICE( SYMPHONY, SYMPHONY_101, "82C101"), DEVICE( TEKRAM, TEKRAM_DC290, "DC-290"), DEVICE( 3DLABS, 3DLABS_300SX, "GLINT 300SX"), @@ -301,6 +344,8 @@ DEVICE( 3DLABS, 3DLABS_PERMEDIA,"PERMEDIA"), DEVICE( AVANCE, AVANCE_ALG2064, "ALG2064i"), DEVICE( AVANCE, AVANCE_2302, "ALG-2302"), + DEVICE( NETVIN, NETVIN_NV5000SC,"NV5000"), + DEVICE( S3, S3_PLATO_PXS, "PLATO/PX (system)"), DEVICE( S3, S3_ViRGE, "ViRGE"), DEVICE( S3, S3_TRIO, "Trio32/Trio64"), DEVICE( S3, S3_AURORA64VP, "Aurora64V+"), @@ -313,9 +358,10 @@ DEVICE( S3, S3_964_1, "Vision 964-P"), DEVICE( S3, S3_964_2, "Vision 964-P"), DEVICE( S3, S3_968, "Vision 968"), - DEVICE( S3, S3_TRIO64V2, "Trio64V2"), - DEVICE( S3, S3_PLATO_PXG, "Plato"), - DEVICE( S3, S3_ViRGE_DXGX, "ViRGE/DX"), + DEVICE( S3, S3_TRIO64V2, "Trio64V2/DX or /GX"), + DEVICE( S3, S3_PLATO_PXG, "PLATO/PX (graphics)"), + DEVICE( S3, S3_ViRGE_DXGX, "ViRGE/DX or /GX"), + DEVICE( S3, S3_ViRGE_GX2, "ViRGE/GX2"), DEVICE( INTEL, INTEL_82375, "82375EB"), BRIDGE( INTEL, INTEL_82424, "82424ZX Saturn", 0x00), DEVICE( INTEL, INTEL_82378, "82378IB"), @@ -339,12 +385,12 @@ DEVICE( INTEL, INTEL_82371SB_2,"82371SB Natoma/Triton II PIIX3"), DEVICE( INTEL, INTEL_82437VX, "82437VX Triton II"), DEVICE( INTEL, INTEL_82439TX, "82439TX"), - DEVICE( INTEL, INTEL_82371AB_0,"82371AB PIIX4"), - DEVICE( INTEL, INTEL_82371AB, "82371AB 430TX PIIX4"), - DEVICE( INTEL, INTEL_82371AB_2,"82371AB PIIX4"), - DEVICE( INTEL, INTEL_82371AB_3,"82371AB PIIX4 Power Management"), + DEVICE( INTEL, INTEL_82371AB_0,"82371AB PIIX4 ISA"), + DEVICE( INTEL, INTEL_82371AB, "82371AB PIIX4 IDE"), + DEVICE( INTEL, INTEL_82371AB_2,"82371AB PIIX4 USB"), + DEVICE( INTEL, INTEL_82371AB_3,"82371AB PIIX4 ACPI"), DEVICE( INTEL, INTEL_P6, "Orion P6"), - DEVICE( INTEL, INTEL_P6_2, "82450GX Orion P6"), + DEVICE( INTEL, INTEL_82450GX, "82450GX Orion P6"), DEVICE( KTI, KTI_ET32P2, "ET32P2"), DEVICE( ADAPTEC, ADAPTEC_7850, "AIC-7850"), DEVICE( ADAPTEC, ADAPTEC_7855, "AIC-7855"), @@ -577,6 +623,7 @@ case PCI_VENDOR_ID_MATROX: return "Matrox"; case PCI_VENDOR_ID_CT: return "Chips & Technologies"; case PCI_VENDOR_ID_MIRO: return "Miro"; + case PCI_VENDOR_ID_NEC: return "NEC"; case PCI_VENDOR_ID_FD: return "Future Domain"; case PCI_VENDOR_ID_SI: return "Silicon Integrated Systems"; case PCI_VENDOR_ID_HP: return "Hewlett Packard"; @@ -590,10 +637,11 @@ case PCI_VENDOR_ID_WINBOND2: return "Winbond"; case PCI_VENDOR_ID_MOTOROLA: return "Motorola"; case PCI_VENDOR_ID_PROMISE: return "Promise Technology"; - case PCI_VENDOR_ID_APPLE: return "Apple"; case PCI_VENDOR_ID_N9: return "Number Nine"; case PCI_VENDOR_ID_UMC: return "UMC"; case PCI_VENDOR_ID_X: return "X TECHNOLOGY"; + case PCI_VENDOR_ID_PICOP: return "PicoPower"; + case PCI_VENDOR_ID_APPLE: return "Apple"; case PCI_VENDOR_ID_NEXGEN: return "Nexgen"; case PCI_VENDOR_ID_QLOGIC: return "Q Logic"; case PCI_VENDOR_ID_LEADTEK: return "Leadtek Research"; @@ -649,10 +697,14 @@ case PCI_VENDOR_ID_3DFX: return "3Dfx"; case PCI_VENDOR_ID_SIGMADES: return "Sigma Designs"; case PCI_VENDOR_ID_OPTIBASE: return "Optibase"; + case PCI_VENDOR_ID_ENSONIQ: return "Ensoniq"; + case PCI_VENDOR_ID_PICTUREL: return "Picture Elements"; + case PCI_VENDOR_ID_NVIDIA: return "NVidia/SGS Thomson"; case PCI_VENDOR_ID_SYMPHONY: return "Symphony"; case PCI_VENDOR_ID_TEKRAM: return "Tekram"; case PCI_VENDOR_ID_3DLABS: return "3Dlabs"; case PCI_VENDOR_ID_AVANCE: return "Avance"; + case PCI_VENDOR_ID_NETVIN: return "NetVin"; case PCI_VENDOR_ID_S3: return "S3 Inc."; case PCI_VENDOR_ID_INTEL: return "Intel"; case PCI_VENDOR_ID_KTI: return "KTI"; @@ -691,10 +743,10 @@ case PCIBIOS_BAD_REGISTER_NUMBER: return "BAD_REGISTER_NUMBER"; - case PCIBIOS_SET_FAILED: + case PCIBIOS_SET_FAILED: return "SET_FAILED"; - case PCIBIOS_BUFFER_TOO_SMALL: + case PCIBIOS_BUFFER_TOO_SMALL: return "BUFFER_TOO_SMALL"; default: diff -u --recursive --new-file v2.1.59/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c --- v2.1.59/linux/drivers/scsi/sg.c Wed Sep 24 20:05:47 1997 +++ linux/drivers/scsi/sg.c Tue Oct 21 08:57:28 1997 @@ -200,12 +200,19 @@ * complete semaphores to tell us whether the buffer is available for us * and whether the command is actually done. */ -static long sg_read(struct inode *inode,struct file *filp,char *buf,unsigned long count) +static ssize_t sg_read(struct file *filp, char *buf, + size_t count, loff_t *ppos) { + struct inode *inode = filp->f_dentry->d_inode; int dev=MINOR(inode->i_rdev); int i; unsigned long flags; struct scsi_generic *device=&scsi_generics[dev]; + + if (ppos != &filp->f_pos) { + /* FIXME: Hmm. Seek to the right place, or fail? */ + } + if ((i=verify_area(VERIFY_WRITE,buf,count))) return i; @@ -322,8 +329,10 @@ wake_up(&scsi_generics[dev].read_wait); } -static long sg_write(struct inode *inode,struct file *filp,const char *buf,unsigned long count) +static ssize_t sg_write(struct file *filp, const char *buf, + size_t count, loff_t *ppos) { + struct inode *inode = filp->f_dentry->d_inode; int bsize,size,amt,i; unsigned char cmnd[MAX_COMMAND_SIZE]; kdev_t devt = inode->i_rdev; @@ -332,6 +341,10 @@ int input_size; unsigned char opcode; Scsi_Cmnd * SCpnt; + + if (ppos != &filp->f_pos) { + /* FIXME: Hmm. Seek to the right place, or fail? */ + } if ((i=verify_area(VERIFY_READ,buf,count))) return i; diff -u --recursive --new-file v2.1.59/linux/drivers/scsi/st.c linux/drivers/scsi/st.c --- v2.1.59/linux/drivers/scsi/st.c Wed May 28 10:51:32 1997 +++ linux/drivers/scsi/st.c Tue Oct 21 08:57:28 1997 @@ -955,12 +955,12 @@ /* Write command */ - static long -st_write(struct inode * inode, struct file * filp, const char * buf, - unsigned long count) +static ssize_t +st_write(struct file * filp, const char * buf, size_t count, loff_t *ppos) { - long total; - int i, do_count, blks, retval, transfer; + struct inode *inode = filp->f_dentry->d_inode; + ssize_t total; + ssize_t i, do_count, blks, retval, transfer; int write_threshold; int doing_write = 0; static unsigned char cmd[10]; @@ -971,6 +971,11 @@ ST_partstat * STps; int dev = TAPE_NR(inode->i_rdev); + if (ppos != &filp->f_pos) { + /* "A request was outside the capabilities of the device." */ + return -ENXIO; + } + STp = &(scsi_tapes[dev]); if (STp->ready != ST_READY) return (-EIO); @@ -1254,7 +1259,7 @@ /* Read data from the tape. Returns zero in the normal case, one if the eof status has changed, and the negative error code in case of a fatal error. Otherwise updates the buffer and the eof state. */ - static long +static long read_tape(struct inode *inode, long count, Scsi_Cmnd **aSCpnt) { int transfer, blks, bytes; @@ -1441,17 +1446,23 @@ /* Read command */ - static long -st_read(struct inode * inode, struct file * filp, char * buf, unsigned long count) +static ssize_t +st_read(struct file * filp, char * buf, size_t count, loff_t *ppos) { - long total; - int i, transfer; + struct inode * inode = filp->f_dentry->d_inode; + ssize_t total; + ssize_t i, transfer; int special; Scsi_Cmnd * SCpnt = NULL; Scsi_Tape * STp; ST_mode * STm; ST_partstat * STps; int dev = TAPE_NR(inode->i_rdev); + + if (ppos != &filp->f_pos) { + /* "A request was outside the capabilities of the device." */ + return -ENXIO; + } STp = &(scsi_tapes[dev]); if (STp->ready != ST_READY) diff -u --recursive --new-file v2.1.59/linux/fs/Config.in linux/fs/Config.in --- v2.1.59/linux/fs/Config.in Mon Aug 18 18:19:46 1997 +++ linux/fs/Config.in Thu Oct 23 14:00:14 1997 @@ -9,11 +9,19 @@ tristate 'Minix fs support' CONFIG_MINIX_FS tristate 'Second extended fs support' CONFIG_EXT2_FS -# msdos filesystems -tristate 'DOS FAT fs support' CONFIG_FAT_FS -dep_tristate 'MSDOS fs support' CONFIG_MSDOS_FS $CONFIG_FAT_FS -dep_tristate 'VFAT (Windows-95) fs support' CONFIG_VFAT_FS $CONFIG_FAT_FS -dep_tristate 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS +tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS +tristate 'Native language support (Unicode, codepages)' CONFIG_NLS +if [ "$CONFIG_NLS" = "y" -o "$CONFIG_NLS" = "m" ]; then + if [ "$CONFIG_ISO9660_FS" = "y" -o "$CONFIG_ISO9660_FS" = "m" ]; then + bool 'Microsoft Joliet cdrom extensions' CONFIG_JOLIET + fi + + # msdos filesystems + dep_tristate 'DOS FAT fs support' CONFIG_FAT_FS $CONFIG_NLS + dep_tristate 'MSDOS fs support' CONFIG_MSDOS_FS $CONFIG_FAT_FS + dep_tristate 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS + dep_tristate 'VFAT (Windows-95) fs support' CONFIG_VFAT_FS $CONFIG_FAT_FS +fi bool '/proc filesystem support' CONFIG_PROC_FS if [ "$CONFIG_INET" = "y" ]; then @@ -46,7 +54,6 @@ if [ "$CONFIG_IPX" != "n" ]; then tristate 'NCP filesystem support (to mount NetWare volumes)' CONFIG_NCP_FS fi -tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS tristate 'Amiga FFS filesystem support' CONFIG_AFFS_FS diff -u --recursive --new-file v2.1.59/linux/fs/Makefile linux/fs/Makefile --- v2.1.59/linux/fs/Makefile Tue Sep 23 16:48:48 1997 +++ linux/fs/Makefile Thu Oct 23 14:00:14 1997 @@ -17,7 +17,7 @@ MOD_LIST_NAME := FS_MODULES ALL_SUB_DIRS = minix ext2 fat msdos vfat proc isofs nfs umsdos \ - hpfs sysv smbfs ncpfs ufs affs romfs autofs lockd nfsd + hpfs sysv smbfs ncpfs ufs affs romfs autofs lockd nfsd nls ifeq ($(CONFIG_QUOTA),y) O_OBJS += dquot.o @@ -107,6 +107,18 @@ else ifeq ($(CONFIG_LOCKD),m) MOD_SUB_DIRS := lockd $(MOD_SUB_DIRS) + endif +endif + +# Since CONFIG_NLS might be set to y while there are modules +# to be build in the nls/ directory, we need to enter the nls +# directory every time, but with different rules. +ifeq ($(CONFIG_NLS),y) +SUB_DIRS += nls +MOD_IN_SUB_DIRS += nls +else + ifeq ($(CONFIG_NLS),m) + MOD_SUB_DIRS += nls endif endif diff -u --recursive --new-file v2.1.59/linux/fs/affs/dir.c linux/fs/affs/dir.c --- v2.1.59/linux/fs/affs/dir.c Tue Sep 23 16:48:48 1997 +++ linux/fs/affs/dir.c Tue Oct 21 08:57:28 1997 @@ -24,8 +24,8 @@ #include static int affs_readdir(struct file *, void *, filldir_t); -static long affs_dir_read(struct inode * inode, struct file * filp, char * buf, - unsigned long count); +static ssize_t affs_dir_read(struct file * filp, char * buf, + size_t count, loff_t *ppos); static struct file_operations affs_dir_operations = { NULL, /* lseek - default */ @@ -62,8 +62,8 @@ NULL /* permissions */ }; -static long -affs_dir_read(struct inode *inode, struct file *filp, char *buf, unsigned long count) +static ssize_t +affs_dir_read(struct file *filp, char *buf, size_t count, loff_t *ppos) { return -EISDIR; } diff -u --recursive --new-file v2.1.59/linux/fs/affs/file.c linux/fs/affs/file.c --- v2.1.59/linux/fs/affs/file.c Mon Aug 18 18:19:46 1997 +++ linux/fs/affs/file.c Tue Oct 21 08:57:29 1997 @@ -37,12 +37,12 @@ static int affs_bmap(struct inode *inode, int block); static struct buffer_head * affs_getblock(struct inode *inode, s32 block); -static long affs_file_read_ofs(struct inode *inode, struct file *filp, char *buf, - unsigned long count); -static long affs_file_write(struct inode *inode, struct file *filp, const char *buf, - unsigned long count); -static long affs_file_write_ofs(struct inode *inode, struct file *filp, const char *buf, - unsigned long count); +static ssize_t affs_file_read_ofs(struct file *filp, char *buf, + size_t count, loff_t *ppos); +static ssize_t affs_file_write(struct file *filp, const char *buf, + size_t count, loff_t *ppos); +static ssize_t affs_file_write_ofs(struct file *filp, const char *buf, + size_t count, loff_t *ppos); static int affs_release_file(struct inode *inode, struct file *filp); static int alloc_ext_cache(struct inode *inode); @@ -496,16 +496,17 @@ return affs_bread(inode->i_dev,key,AFFS_I2BSIZE(inode)); } -static long -affs_file_read_ofs(struct inode *inode, struct file *filp, char *buf, unsigned long count) +static ssize_t +affs_file_read_ofs(struct file *filp, char *buf, size_t count, loff_t *ppos) { + struct inode *inode = filp->f_dentry->d_inode; char *start; - int left, offset, size, sector; - int blocksize; + ssize_t left, offset, size, sector; + ssize_t blocksize; struct buffer_head *bh; void *data; - pr_debug("AFFS: file_read_ofs(ino=%lu,pos=%lu,%d)\n",inode->i_ino,(long)filp->f_pos,count); + pr_debug("AFFS: file_read_ofs(ino=%lu,pos=%lu,%d)\n",inode->i_ino,(long)*ppos,count); if (!inode) { affs_error(inode->i_sb,"file_read_ofs","Inode = NULL"); @@ -516,24 +517,24 @@ pr_debug("affs_file_read: mode = %07o",inode->i_mode); return -EINVAL; } - if (filp->f_pos >= inode->i_size || count <= 0) + if (*ppos >= inode->i_size || count <= 0) return 0; start = buf; for (;;) { - left = MIN (inode->i_size - filp->f_pos,count - (buf - start)); + left = MIN (inode->i_size - *ppos,count - (buf - start)); if (!left) break; - sector = affs_bmap(inode,(u32)filp->f_pos / blocksize); + sector = affs_bmap(inode,(u32)*ppos / blocksize); if (!sector) break; - offset = (u32)filp->f_pos % blocksize; + offset = (u32)*ppos % blocksize; bh = affs_bread(inode->i_dev,sector,AFFS_I2BSIZE(inode)); if (!bh) break; data = bh->b_data + 24; size = MIN(blocksize - offset,left); - filp->f_pos += size; + *ppos += size; copy_to_user(buf,data + offset,size); buf += size; affs_brelse(bh); @@ -543,13 +544,14 @@ return buf - start; } -static long -affs_file_write(struct inode *inode, struct file *filp, const char *buf, unsigned long count) +static ssize_t +affs_file_write(struct file *filp, const char *buf, size_t count, loff_t *ppos) { + struct inode *inode = filp->f_dentry->d_inode; off_t pos; - int written; - int c; - int blocksize; + ssize_t written; + ssize_t c; + ssize_t blocksize; struct buffer_head *bh; struct inode *ino; char *p; @@ -558,7 +560,7 @@ if (!count) return 0; pr_debug("AFFS: file_write(ino=%lu,pos=%lu,count=%d)\n",inode->i_ino, - (unsigned long)filp->f_pos,count); + (unsigned long)*ppos,count); ino = NULL; if (!inode) { @@ -591,7 +593,7 @@ if (filp->f_flags & O_APPEND) { pos = inode->i_size; } else - pos = filp->f_pos; + pos = *ppos; written = 0; blocksize = AFFS_I2BSIZE(inode); @@ -628,25 +630,26 @@ if (pos > inode->i_size) inode->i_size = pos; inode->i_mtime = inode->i_ctime = CURRENT_TIME; - filp->f_pos = pos; + *ppos = pos; mark_inode_dirty(inode); iput(ino); return written; } -static long -affs_file_write_ofs(struct inode *inode, struct file *filp, const char *buf, unsigned long count) +static ssize_t +affs_file_write_ofs(struct file *filp, const char *buf, size_t count, loff_t *ppos) { + struct inode *inode = filp->f_dentry->d_inode; off_t pos; - int written; - int c; - int blocksize; + ssize_t written; + ssize_t c; + ssize_t blocksize; struct buffer_head *bh; struct inode *ino; char *p; pr_debug("AFFS: file_write_ofs(ino=%lu,pos=%lu,count=%d)\n",inode->i_ino, - (unsigned long)filp->f_pos,count); + (unsigned long)*ppos,count); if (!count) return 0; @@ -675,7 +678,7 @@ if (filp->f_flags & O_APPEND) pos = inode->i_size; else - pos = filp->f_pos; + pos = *ppos; bh = NULL; blocksize = AFFS_I2BSIZE(inode) - 24; @@ -715,7 +718,7 @@ } if (pos > inode->i_size) inode->i_size = pos; - filp->f_pos = pos; + *ppos = pos; inode->i_mtime = inode->i_ctime = CURRENT_TIME; mark_inode_dirty(inode); iput(ino); diff -u --recursive --new-file v2.1.59/linux/fs/autofs/waitq.c linux/fs/autofs/waitq.c --- v2.1.59/linux/fs/autofs/waitq.c Sun Sep 7 13:10:43 1997 +++ linux/fs/autofs/waitq.c Tue Oct 21 08:57:29 1997 @@ -55,7 +55,7 @@ old_signal = current->signal; - while ( bytes && (written = file->f_op->write(file->f_dentry->d_inode,file,data,bytes)) > 0 ) { + while ( bytes && (written = file->f_op->write(file,data,bytes,&file->f_pos)) > 0 ) { data += written; bytes -= written; } diff -u --recursive --new-file v2.1.59/linux/fs/binfmt_aout.c linux/fs/binfmt_aout.c --- v2.1.59/linux/fs/binfmt_aout.c Tue Sep 23 16:48:48 1997 +++ linux/fs/binfmt_aout.c Tue Oct 21 08:57:29 1997 @@ -58,7 +58,7 @@ * macros to write out all the necessary info. */ #define DUMP_WRITE(addr,nr) \ -while (file.f_op->write(inode,&file,(char *)(addr),(nr)) != (nr)) goto close_coredump +while (file.f_op->write(&file,(char *)(addr),(nr),&file.f_pos) != (nr)) goto close_coredump #define DUMP_SEEK(offset) \ if (file.f_op->llseek) { \ @@ -306,6 +306,7 @@ unsigned long p = bprm->p; unsigned long fd_offset; unsigned long rlim; + int retval; ex = *((struct exec *) bprm->buf); /* exec-header */ if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && @@ -341,8 +342,12 @@ if (ex.a_data + ex.a_bss > rlim) return -ENOMEM; + /* Flush all traces of the currently running executable */ + retval = flush_old_exec(bprm); + if (retval) + return retval; + /* OK, This is the point of no return */ - flush_old_exec(bprm); #ifdef __sparc__ memcpy(¤t->tss.core_exec, &ex, sizeof(struct exec)); #endif @@ -498,7 +503,7 @@ file->f_pos = 0; set_fs(KERNEL_DS); - error = file->f_op->read(inode, file, (char *) &ex, sizeof(ex)); + error = file->f_op->read(file, (char *) &ex, sizeof(ex), &file->f_pos); set_fs(USER_DS); if (error != sizeof(ex)) return -ENOEXEC; diff -u --recursive --new-file v2.1.59/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c --- v2.1.59/linux/fs/binfmt_elf.c Tue Sep 23 16:48:48 1997 +++ linux/fs/binfmt_elf.c Tue Oct 21 08:57:29 1997 @@ -584,9 +584,12 @@ } } - /* OK, This is the point of no return */ - flush_old_exec(bprm); + /* Flush all traces of the currently running executable */ + retval = flush_old_exec(bprm); + if (retval) + return retval; + /* OK, This is the point of no return */ current->mm->end_data = 0; current->mm->end_code = 0; current->mm->start_mmap = ELF_START_MMAP; @@ -821,7 +824,8 @@ file->f_pos = 0; set_fs(KERNEL_DS); - error = file->f_op->read(inode, file, (char *) &elf_ex, sizeof(elf_ex)); + error = file->f_op->read(file, (char *) &elf_ex, + sizeof(elf_ex), &file->f_pos); set_fs(USER_DS); if (error != sizeof(elf_ex)) return -ENOEXEC; @@ -918,7 +922,7 @@ */ static int dump_write(struct file *file, const void *addr, int nr) { - return file->f_op->write(file->f_dentry->d_inode, file, addr, nr) == nr; + return file->f_op->write(file, addr, nr, &file->f_pos) == nr; } static int dump_seek(struct file *file, off_t off) diff -u --recursive --new-file v2.1.59/linux/fs/block_dev.c linux/fs/block_dev.c --- v2.1.59/linux/fs/block_dev.c Tue Sep 23 16:48:48 1997 +++ linux/fs/block_dev.c Tue Oct 21 08:57:29 1997 @@ -20,16 +20,17 @@ #define MAX_BUF_PER_PAGE (PAGE_SIZE / 512) #define NBUF 64 -long block_write(struct inode * inode, struct file * filp, - const char * buf, unsigned long count) +ssize_t block_write(struct file * filp, const char * buf, + size_t count, loff_t *ppos) { - int blocksize, blocksize_bits, i, buffercount,write_error; - int block, blocks; + struct inode * inode = filp->f_dentry->d_inode; + ssize_t blocksize, blocksize_bits, i, buffercount, write_error; + ssize_t block, blocks; loff_t offset; - int chars; - int written = 0; + ssize_t chars; + ssize_t written = 0; struct buffer_head * bhlist[NBUF]; - unsigned int size; + size_t size; kdev_t dev; struct buffer_head * bh, *bufferlist[NBUF]; register char * p; @@ -49,8 +50,8 @@ i >>= 1; } - block = filp->f_pos >> blocksize_bits; - offset = filp->f_pos & (blocksize-1); + block = *ppos >> blocksize_bits; + offset = *ppos & (blocksize-1); if (blk_size[MAJOR(dev)]) size = ((loff_t) blk_size[MAJOR(dev)][MINOR(dev)] << BLOCK_SIZE_BITS) >> blocksize_bits; @@ -105,7 +106,7 @@ return written ? written : -EIO; p = offset + bh->b_data; offset = 0; - filp->f_pos += chars; + *ppos += chars; written += chars; count -= chars; copy_from_user(p,buf,chars); @@ -145,14 +146,14 @@ return written; } -long block_read(struct inode * inode, struct file * filp, - char * buf, unsigned long count) +ssize_t block_read(struct file * filp, char * buf, size_t count, loff_t *ppos) { - unsigned int block; + struct inode * inode = filp->f_dentry->d_inode; + size_t block; loff_t offset; - int blocksize; - int blocksize_bits, i; - unsigned int blocks, rblocks, left; + ssize_t blocksize; + ssize_t blocksize_bits, i; + size_t blocks, rblocks, left; int bhrequest, uptodate; struct buffer_head ** bhb, ** bhe; struct buffer_head * buflist[NBUF]; @@ -160,7 +161,7 @@ unsigned int chars; loff_t size; kdev_t dev; - int read; + ssize_t read; dev = inode->i_rdev; blocksize = BLOCK_SIZE; @@ -173,7 +174,7 @@ i >>= 1; } - offset = filp->f_pos; + offset = *ppos; if (blk_size[MAJOR(dev)]) size = (loff_t) blk_size[MAJOR(dev)][MINOR(dev)] << BLOCK_SIZE_BITS; else @@ -258,7 +259,7 @@ chars = left; else chars = blocksize - offset; - filp->f_pos += chars; + *ppos += chars; left -= chars; read += chars; if (*bhe) { diff -u --recursive --new-file v2.1.59/linux/fs/dcache.c linux/fs/dcache.c --- v2.1.59/linux/fs/dcache.c Wed Oct 15 16:04:23 1997 +++ linux/fs/dcache.c Thu Oct 23 13:30:14 1997 @@ -19,8 +19,13 @@ #include #include +#define DCACHE_PARANOIA 1 +/* #define DCACHE_DEBUG 1 */ + /* For managing the dcache */ -extern int nr_free_pages, free_pages_low; +extern unsigned long num_physpages, page_cache_size; +extern int inodes_stat[]; +#define nr_inodes (inodes_stat[0]) /* * This is the single most critical data structure when it comes @@ -37,6 +42,14 @@ static struct list_head dentry_hashtable[D_HASHSIZE]; static LIST_HEAD(dentry_unused); +struct { + int nr_dentry; + int nr_unused; + int age_limit; /* age in seconds */ + int want_pages; /* pages requested by system */ + int dummy[2]; +} dentry_stat = {0, 0, 45, 0,}; + static inline void d_free(struct dentry *dentry) { kfree(dentry->d_name.name); @@ -84,12 +97,16 @@ goto out; } + if (!list_empty(&dentry->d_lru)) + dentry_stat.nr_unused--; list_del(&dentry->d_lru); if (list_empty(&dentry->d_hash)) { struct inode *inode = dentry->d_inode; struct dentry * parent; - if (inode) + if (inode) { + dentry->d_inode = NULL; iput(inode); + } parent = dentry->d_parent; d_free(dentry); if (dentry == parent) @@ -98,6 +115,7 @@ goto repeat; } list_add(&dentry->d_lru, &dentry_unused); + dentry_stat.nr_unused++; out: if (count >= 0) { dentry->d_count = count; @@ -132,6 +150,94 @@ } /* + * Selects less valuable dentries to be pruned when + * we need inodes or memory. The selected dentries + * are moved to the old end of the list where + * prune_dcache() can find them. + */ +int select_dcache(int count, int page_count) +{ + struct list_head *tail = &dentry_unused; + struct list_head *next = dentry_unused.prev; + int forward = 0, young = 0, depth = dentry_stat.nr_unused >> 1; + int found = 0, pages = 0; + +#ifdef DCACHE_DEBUG +printk("select_dcache: %d unused, count=%d, pages=%d\n", +dentry_stat.nr_unused, count, page_count); +#endif + while (next != &dentry_unused && depth--) { + struct list_head *tmp = next; + struct dentry *dentry = list_entry(tmp, struct dentry, d_lru); + struct inode *inode = dentry->d_inode; + unsigned long value = 0; + + next = tmp->prev; + if (forward) + next = tmp->next; + if (dentry->d_count) { + dentry_stat.nr_unused--; + list_del(tmp); + INIT_LIST_HEAD(tmp); + continue; + } + /* + * Select dentries based on the page cache count ... + * should factor in number of uses as well. + */ + if (inode) { + if (inode->i_state) + continue; + value = inode->i_nrpages; + } + /* + * Consider various exemptions ... + */ + if (!page_count) { + if (!inode) + continue; + if (value >= 3) + continue; + } else if (!forward) { + if (inode) { + int age = CURRENT_TIME - inode->i_atime; + if (age < dentry_stat.age_limit) { + if (++young > 8) { + forward = 1; + next = dentry_unused.next; +#ifdef DCACHE_DEBUG +printk("select_dcache: age=%d, pages=%d, scanning forward\n", age, pages); +#endif + } + continue; + } + } + } else { + /* + * If we're scanning from the front, don't take + * files with only a trivial amount of memory. + */ + if (value < 3 || value > 15) + continue; + } + /* + * Move the dentry behind the tail + */ + if (tmp != tail->prev) { + list_del(tmp); + list_add(tmp, tail->prev); + } + tail = tmp; + pages += value; + if (++found >= count) + break; + if (page_count && pages >= page_count) + break; + } + return found; +} + +/* * Throw away a dentry - free the inode, dput the parent. * This requires that the LRU list has already been * removed. @@ -166,6 +272,7 @@ if (tmp == &dentry_unused) break; + dentry_stat.nr_unused--; list_del(tmp); INIT_LIST_HEAD(tmp); dentry = list_entry(tmp, struct dentry, d_lru); @@ -222,6 +329,7 @@ continue; if (dentry->d_count) continue; + dentry_stat.nr_unused--; list_del(tmp); INIT_LIST_HEAD(tmp); prune_one_dentry(dentry); @@ -229,6 +337,45 @@ } } +/* + * This is called from do_try_to_free_page() to indicate + * that we should reduce the dcache and inode cache memory. + */ +void shrink_dcache_memory() +{ + dentry_stat.want_pages++; +} + +/* + * This carries out the request received by the above routine. + */ +void check_dcache_memory() +{ + if (dentry_stat.want_pages) { + unsigned int count, goal = 0; + /* + * Set the page goal. We don't necessarily need to trim + * the dcache just because the system needs memory ... + */ + if (page_cache_size > (num_physpages >> 1)) + goal = (dentry_stat.want_pages * page_cache_size) + / num_physpages; + dentry_stat.want_pages = 0; + if (goal) { + if (goal > 50) + goal = 50; + count = select_dcache(128, goal); +#ifdef DCACHE_DEBUG +printk("check_dcache_memory: goal=%d, count=%d\n", goal, count); +#endif + if (count) { + prune_dcache(count); + free_inode_memory(count); + } + } + } +} + #define NAME_ALLOC_LEN(len) ((len+16) & ~15) struct dentry * d_alloc(struct dentry * parent, const struct qstr *name) @@ -237,11 +384,15 @@ struct dentry *dentry; /* - * Check whether to shrink the dcache ... this greatly reduces - * the likelyhood that kmalloc() will need additional memory. + * Prune the dcache if there are too many unused dentries. */ - if (nr_free_pages < free_pages_low) - shrink_dcache(); + if (dentry_stat.nr_unused > 3*(nr_inodes >> 1)) { +#ifdef DCACHE_PARANOIA +printk("d_alloc: %d unused, pruning dcache\n", dentry_stat.nr_unused); +#endif + prune_dcache(8); + free_inode_memory(8); + } dentry = kmalloc(sizeof(struct dentry), GFP_KERNEL); if (!dentry) diff -u --recursive --new-file v2.1.59/linux/fs/exec.c linux/fs/exec.c --- v2.1.59/linux/fs/exec.c Tue Sep 23 16:48:48 1997 +++ linux/fs/exec.c Tue Oct 21 08:57:29 1997 @@ -372,13 +372,13 @@ if (to_kmem) { unsigned long old_fs = get_fs(); set_fs(get_ds()); - result = file.f_op->read(inode, &file, addr, count); + result = file.f_op->read(&file, addr, count, &file.f_pos); set_fs(old_fs); } else { result = verify_area(VERIFY_WRITE, addr, count); if (result) goto close_readexec; - result = file.f_op->read(inode, &file, addr, count); + result = file.f_op->read(&file, addr, count, &file.f_pos); } close_readexec: if (file.f_op->release) @@ -427,16 +427,34 @@ current->mm = old_mm; mmput(mm); - /* - * N.B. binfmt_xxx needs to handle the error instead of oom() - */ fail_nomem: - /* this is wrong, I think. */ - oom(current); return retval; } /* + * This function makes sure the current process has its own signal table, + * so that flush_old_signals can later reset the signals without disturbing + * other processes. (Other processes might share the signal table via + * the CLONE_SIGHAND option to clone().) + */ + +static inline int make_private_signals(void) +{ + struct signal_struct * newsig; + + if (atomic_read(¤t->sig->count) <= 1) + return 0; + newsig = kmalloc(sizeof(*newsig), GFP_KERNEL); + if (newsig == NULL) + return -ENOMEM; + spin_lock_init(&newsig->siglock); + atomic_set(&newsig->count, 1); + memcpy(newsig->action, current->sig->action, sizeof(newsig->action)); + current->sig = newsig; + return 0; +} + +/* * These functions flushes out all traces of the currently running executable * so that a new one can be started */ @@ -476,18 +494,24 @@ } } -void flush_old_exec(struct linux_binprm * bprm) +int flush_old_exec(struct linux_binprm * bprm) { char * name; int i, ch, retval; + struct signal_struct * oldsig; + + /* + * Make sure we have a private signal table + */ + oldsig = current->sig; + retval = make_private_signals(); + if (retval) goto flush_failed; /* - * Release all of the old mmap stuff ... do this first - * so we can bail out on failure. + * Release all of the old mmap stuff */ retval = exec_mmap(); - if (retval) - goto out; + if (retval) goto flush_failed; if (current->euid == current->uid && current->egid == current->gid) current->dumpable = 1; @@ -509,8 +533,12 @@ flush_old_signals(current->sig); flush_old_files(current->files); -out: - return; /* retval; FIXME. */ + + return 0; + +flush_failed: + current->sig = oldsig; + return retval; } /* diff -u --recursive --new-file v2.1.59/linux/fs/ext2/dir.c linux/fs/ext2/dir.c --- v2.1.59/linux/fs/ext2/dir.c Thu Sep 11 09:02:23 1997 +++ linux/fs/ext2/dir.c Tue Oct 21 08:57:29 1997 @@ -26,8 +26,8 @@ #include #include -static long ext2_dir_read (struct inode * inode, struct file * filp, - char * buf, unsigned long count) +static ssize_t ext2_dir_read (struct file * filp, char * buf, + size_t count, loff_t *ppos) { return -EISDIR; } diff -u --recursive --new-file v2.1.59/linux/fs/ext2/file.c linux/fs/ext2/file.c --- v2.1.59/linux/fs/ext2/file.c Tue Sep 23 16:48:48 1997 +++ linux/fs/ext2/file.c Tue Oct 21 08:57:29 1997 @@ -37,7 +37,7 @@ #include static long long ext2_file_lseek(struct file *, long long, int); -static long ext2_file_write (struct inode *, struct file *, const char *, unsigned long); +static ssize_t ext2_file_write (struct file *, const char *, size_t, loff_t *); static int ext2_release_file (struct inode *, struct file *); /* @@ -127,9 +127,10 @@ } } -static long ext2_file_write (struct inode * inode, struct file * filp, - const char * buf, unsigned long count) +static ssize_t ext2_file_write (struct file * filp, const char * buf, + size_t count, loff_t *ppos) { + struct inode * inode = filp->f_dentry->d_inode; __u32 pos; long block; int offset; @@ -163,8 +164,12 @@ if (filp->f_flags & O_APPEND) pos = inode->i_size; - else - pos = filp->f_pos; + else { + pos = *ppos; + if (pos != *ppos) + return -EINVAL; + } + /* Check for overflow.. */ if (pos > (__u32) (pos + count)) { count = ~pos; /* == 0xFFFFFFFF - pos */ @@ -251,7 +256,7 @@ if (filp->f_flags & O_SYNC) inode->u.ext2_i.i_osync--; inode->i_ctime = inode->i_mtime = CURRENT_TIME; - filp->f_pos = pos; + *ppos = pos; mark_inode_dirty(inode); return written; } diff -u --recursive --new-file v2.1.59/linux/fs/fat/buffer.c linux/fs/fat/buffer.c --- v2.1.59/linux/fs/fat/buffer.c Mon Apr 7 11:35:30 1997 +++ linux/fs/fat/buffer.c Thu Oct 23 14:00:14 1997 @@ -10,22 +10,31 @@ #include #include +#if 0 +# define PRINTK(x) printk x +#else +# define PRINTK(x) +#endif + struct buffer_head *fat_bread ( struct super_block *sb, int block) { struct buffer_head *ret = NULL; - /* Note that the blocksize is 512, 1024 or 2048, but the first read - is always of size 1024 (or 2048). Doing readahead may be counterproductive - or just plain wrong. */ + PRINTK(("fat_bread: block=0x%x\n", block)); + /* + * Note that the blocksize is 512, 1024 or 2048, but the first read + * is always of size 1024 (or 2048). Doing readahead may be + * counterproductive or just plain wrong. + */ if (sb->s_blocksize == 512) { ret = bread (sb->s_dev,block,512); } else { struct buffer_head *real; if (sb->s_blocksize == 1024){ real = bread (sb->s_dev,block>>1,1024); - }else{ + } else { real = bread (sb->s_dev,block>>2,2048); } @@ -82,6 +91,7 @@ int block) { struct buffer_head *ret = NULL; + PRINTK(("fat_getblk: block=0x%x\n", block)); if (sb->s_blocksize == 512){ ret = getblk (sb->s_dev,block,512); }else{ diff -u --recursive --new-file v2.1.59/linux/fs/fat/cache.c linux/fs/fat/cache.c --- v2.1.59/linux/fs/fat/cache.c Mon Aug 4 16:25:39 1997 +++ linux/fs/fat/cache.c Thu Oct 23 14:00:14 1997 @@ -12,6 +12,11 @@ #include "msbuffer.h" +#if 0 +# define PRINTK(x) printk x +#else +# define PRINTK(x) +#endif static struct fat_cache *fat_cache,cache[FAT_CACHE]; @@ -22,11 +27,13 @@ { struct buffer_head *bh,*bh2,*c_bh,*c_bh2; unsigned char *p_first,*p_last; - int first,last,next,copy,b; + int copy,first,last,next,b; if ((unsigned) (nr-2) >= MSDOS_SB(sb)->clusters) return 0; - if (MSDOS_SB(sb)->fat_bits == 16) { + if (MSDOS_SB(sb)->fat_bits == 32) { + first = last = nr*4; + } else if (MSDOS_SB(sb)->fat_bits == 16) { first = last = nr*2; } else { first = nr*3/2; @@ -46,13 +53,19 @@ return 0; } } - if (MSDOS_SB(sb)->fat_bits == 16) { + if (MSDOS_SB(sb)->fat_bits == 32) { + p_first = p_last = NULL; /* GCC needs that stuff */ + next = CF_LE_L(((unsigned long *) bh->b_data)[(first & + (SECTOR_SIZE-1)) >> 2]); + if (next >= 0xffffff7) next = -1; + PRINTK(("fat_bread: 0x%x, nr=0x%x, first=0x%x, next=0x%d\n", b, nr, first, next)); + + } else if (MSDOS_SB(sb)->fat_bits == 16) { p_first = p_last = NULL; /* GCC needs that stuff */ next = CF_LE_W(((unsigned short *) bh->b_data)[(first & (SECTOR_SIZE-1)) >> 1]); if (next >= 0xfff7) next = -1; - } - else { + } else { p_first = &((unsigned char *) bh->b_data)[first & (SECTOR_SIZE-1)]; p_last = &((unsigned char *) bh2->b_data)[(first+1) & (SECTOR_SIZE-1)]; @@ -61,10 +74,13 @@ if (next >= 0xff7) next = -1; } if (new_value != -1) { - if (MSDOS_SB(sb)->fat_bits == 16) + if (MSDOS_SB(sb)->fat_bits == 32) { + ((unsigned long *) bh->b_data)[(first & (SECTOR_SIZE-1)) >> + 2] = CT_LE_L(new_value); + } else if (MSDOS_SB(sb)->fat_bits == 16) { ((unsigned short *) bh->b_data)[(first & (SECTOR_SIZE-1)) >> 1] = CT_LE_W(new_value); - else { + } else { if (nr & 1) { *p_first = (*p_first & 0xf) | (new_value << 4); *p_last = new_value >> 4; @@ -239,16 +255,17 @@ return nr; } - int fat_smap(struct inode *inode,int sector) { struct msdos_sb_info *sb; int cluster,offset; sb = MSDOS_SB(inode->i_sb); - if (inode->i_ino == MSDOS_ROOT_INO || (S_ISDIR(inode->i_mode) && - !MSDOS_I(inode)->i_start)) { - if (sector >= sb->dir_entries >> MSDOS_DPS_BITS) return 0; + if ((sb->fat_bits != 32) && + (inode->i_ino == MSDOS_ROOT_INO || (S_ISDIR(inode->i_mode) && + !MSDOS_I(inode)->i_start))) { + if (sector >= sb->dir_entries >> MSDOS_DPS_BITS) + return 0; return sector+sb->dir_start; } cluster = sector/sb->cluster_size; @@ -279,6 +296,7 @@ fat_access(inode->i_sb,last,EOF_FAT(inode->i_sb)); else { MSDOS_I(inode)->i_start = 0; + MSDOS_I(inode)->i_logstart = 0; mark_inode_dirty(inode); } lock_fat(inode->i_sb); @@ -287,8 +305,12 @@ fat_fs_panic(inode->i_sb,"fat_free: deleting beyond EOF"); break; } - if (MSDOS_SB(inode->i_sb)->free_clusters != -1) + if (MSDOS_SB(inode->i_sb)->free_clusters != -1) { MSDOS_SB(inode->i_sb)->free_clusters++; + if (MSDOS_SB(inode->i_sb)->fat_bits == 32) { + fat_clusters_flush(inode->i_sb); + } + } inode->i_blocks -= MSDOS_SB(inode->i_sb)->cluster_size; } unlock_fat(inode->i_sb); diff -u --recursive --new-file v2.1.59/linux/fs/fat/dir.c linux/fs/fat/dir.c --- v2.1.59/linux/fs/fat/dir.c Thu Sep 11 09:02:23 1997 +++ linux/fs/fat/dir.c Thu Oct 23 14:02:36 1997 @@ -11,8 +11,12 @@ * Merged with msdos fs by Henrik Storner */ +#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) + +#include #include #include +#include #include #include #include @@ -24,13 +28,11 @@ #include #include "msbuffer.h" -#include "tables.h" - #define PRINTK(X) -static long fat_dir_read(struct inode * inode,struct file * filp, - char * buf, unsigned long count) +static ssize_t fat_dir_read(struct file * filp, char * buf, + size_t count, loff_t *ppos) { return -EISDIR; } @@ -40,7 +42,7 @@ fat_dir_read, /* read */ NULL, /* write - bad */ fat_readdir, /* readdir */ - NULL, /* poll - default */ + NULL, /* select v2.0.x/poll v2.1.x - default */ fat_dir_ioctl, /* ioctl - default */ NULL, /* mmap */ NULL, /* no special open code */ @@ -48,7 +50,9 @@ file_fsync /* fsync */ }; -/* Convert Unicode string to ASCII. If uni_xlate is enabled and we +/* + * Convert Unicode 16 to UTF8, translated unicode, or ascii. + * If uni_xlate is enabled and we * can't get a 1:1 conversion, use a colon as an escape character since * it is normally invalid on the vfat filesystem. The following three * characters are a sort of uuencoded 16 bit Unicode value. This lets @@ -56,10 +60,11 @@ * into some trouble with long Unicode names, but ignore that right now. */ static int -uni2ascii(unsigned char *uni, unsigned char *ascii, int uni_xlate) +uni16_to_x8(unsigned char *ascii, unsigned char *uni, int uni_xlate, + struct nls_table *nls) { unsigned char *ip, *op; - unsigned char page, pg_off; + unsigned char ch, cl; unsigned char *uni_page; unsigned short val; @@ -67,21 +72,21 @@ op = ascii; while (*ip || ip[1]) { - pg_off = *ip++; - page = *ip++; - - uni_page = fat_uni2asc_pg[page]; - if (uni_page && uni_page[pg_off]) { - *op++ = uni_page[pg_off]; + cl = *ip++; + ch = *ip++; + + uni_page = nls->page_uni2charset[ch]; + if (uni_page && uni_page[cl]) { + *op++ = uni_page[cl]; } else { if (uni_xlate == 1) { *op++ = ':'; - val = (pg_off << 8) + page; - op[2] = fat_uni2code[val & 0x3f]; + val = (cl << 8) + ch; + op[2] = fat_uni2esc[val & 0x3f]; val >>= 6; - op[1] = fat_uni2code[val & 0x3f]; + op[1] = fat_uni2esc[val & 0x3f]; val >>= 6; - *op = fat_uni2code[val & 0x3f]; + *op = fat_uni2esc[val & 0x3f]; op += 3; } else { *op++ = '?'; @@ -92,6 +97,19 @@ return (op - ascii); } + +static void dump_de(struct msdos_dir_entry *de) +{ + int i; + unsigned char *p = (unsigned char *) de; + printk("["); + + for (i = 0; i < 32; i++, p++) { + printk("%02x ", *p); + } + printk("]\n"); +} + int fat_readdirx( struct inode *inode, struct file *filp, @@ -115,7 +133,9 @@ unsigned char alias_checksum = 0; /* Make compiler warning go away */ unsigned char long_slots = 0; int uni_xlate = MSDOS_SB(sb)->options.unicode_xlate; + int utf8 = MSDOS_SB(sb)->options.utf8; unsigned char *unicode = NULL; + struct nls_table *nls = MSDOS_SB(sb)->nls_io; if (!inode || !S_ISDIR(inode->i_mode)) return -EBADF; @@ -138,6 +158,9 @@ is_long = 0; ino = fat_get_entry(inode,&filp->f_pos,&bh,&de); while (ino > -1) { +#if 0 + dump_de(de); +#endif /* Check for long filename entry */ if (MSDOS_SB(sb)->options.isvfat && (de->name[0] == (__s8) DELETED_FLAG)) { is_long = 0; @@ -217,7 +240,6 @@ if (is_long) { unsigned char sum; - long_len = uni2ascii(unicode, longname, uni_xlate); for (sum = 0, i = 0; i < 11; i++) { sum = (((sum&1)<<7)|((sum&0xfe)>>1)) + de->name[i]; } @@ -226,6 +248,11 @@ PRINTK(("Checksums don't match %d != %d\n", sum, alias_checksum)); is_long = 0; } + if (utf8) { + long_len = utf8_wcstombs(longname, (__u16 *) unicode, sizeof(longname)); + } else { + long_len = uni16_to_x8(longname, unicode, uni_xlate, nls); + } } if ((de->attr & ATTR_HIDDEN) && MSDOS_SB(sb)->options.dotsOK) { @@ -390,7 +417,7 @@ switch (cmd) { case VFAT_IOCTL_READDIR_BOTH: { struct dirent *d1 = (struct dirent *)arg; - err = verify_area(VERIFY_WRITE, d1, sizeof (*d1)); + err = verify_area(VERIFY_WRITE, d1, sizeof(struct dirent[2])); if (err) return err; put_user(0, &d1->d_reclen); @@ -400,7 +427,7 @@ case VFAT_IOCTL_READDIR_SHORT: { struct dirent *d1 = (struct dirent *)arg; put_user(0, &d1->d_reclen); - err = verify_area(VERIFY_WRITE, d1, sizeof (*d1)); + err = verify_area(VERIFY_WRITE, d1, sizeof(struct dirent[2])); if (err) return err; return fat_readdirx(inode,filp,(void *)arg, diff -u --recursive --new-file v2.1.59/linux/fs/fat/fatfs_syms.c linux/fs/fat/fatfs_syms.c --- v2.1.59/linux/fs/fat/fatfs_syms.c Mon Aug 4 16:25:39 1997 +++ linux/fs/fat/fatfs_syms.c Thu Oct 23 14:00:14 1997 @@ -4,6 +4,8 @@ * Exported kernel symbols for the low-level FAT-based fs support. * */ +#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) +#include #include #include @@ -15,16 +17,14 @@ extern struct file_operations fat_dir_operations; -EXPORT_SYMBOL(fat_a2alias); -EXPORT_SYMBOL(fat_a2uni); EXPORT_SYMBOL(fat_add_cluster); EXPORT_SYMBOL(fat_bmap); EXPORT_SYMBOL(fat_brelse); EXPORT_SYMBOL(fat_cache_inval_inode); -EXPORT_SYMBOL(fat_code2uni); EXPORT_SYMBOL(fat_date_unix2dos); EXPORT_SYMBOL(fat_delete_inode); EXPORT_SYMBOL(fat_dir_operations); +EXPORT_SYMBOL(fat_esc2uni); EXPORT_SYMBOL(fat_file_read); EXPORT_SYMBOL(fat_file_write); EXPORT_SYMBOL(fat_fs_panic); @@ -44,8 +44,7 @@ EXPORT_SYMBOL(fat_smap); EXPORT_SYMBOL(fat_statfs); EXPORT_SYMBOL(fat_truncate); -EXPORT_SYMBOL(fat_uni2asc_pg); -EXPORT_SYMBOL(fat_uni2code); +EXPORT_SYMBOL(fat_uni2esc); EXPORT_SYMBOL(fat_unlock_creation); EXPORT_SYMBOL(fat_write_inode); diff -u --recursive --new-file v2.1.59/linux/fs/fat/file.c linux/fs/fat/file.c --- v2.1.59/linux/fs/fat/file.c Thu Jul 17 10:06:06 1997 +++ linux/fs/fat/file.c Thu Oct 23 14:05:21 1997 @@ -6,6 +6,8 @@ * regular file handling primitives for fat-based filesystems */ +#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) +#include #include #include #include @@ -32,7 +34,7 @@ fat_file_read, /* read */ fat_file_write, /* write */ NULL, /* readdir - bad */ - NULL, /* poll - default */ + NULL, /* select v2.0.x/poll v2.1.x - default */ NULL, /* ioctl - default */ generic_file_mmap, /* mmap */ NULL, /* no special open is needed */ @@ -60,6 +62,7 @@ NULL, /* permission */ NULL /* smap */ }; + /* #Specification: msdos / special devices / mmap Mmapping does work because a special mmap is provide in that case. Note that it is much less efficient than the generic_file_mmap normally @@ -71,7 +74,7 @@ fat_file_read, /* read */ fat_file_write, /* write */ NULL, /* readdir - bad */ - NULL, /* poll - default */ + NULL, /* select v2.0.x/poll v2.1.x - default */ NULL, /* ioctl - default */ fat_mmap, /* mmap */ NULL, /* no special open is needed */ @@ -152,12 +155,13 @@ /* Read a file into user space */ -long fat_file_read( - struct inode *inode, +ssize_t fat_file_read( struct file *filp, char *buf, - unsigned long count) + size_t count, + loff_t *ppos) { + struct inode *inode = filp->f_dentry->d_inode; struct super_block *sb = inode->i_sb; char *start = buf; char *end = buf + count; @@ -175,7 +179,7 @@ printk("fat_file_read: mode = %07o\n",inode->i_mode); return -EINVAL; } - if (filp->f_pos >= inode->i_size || count == 0) return 0; + if (*ppos >= inode->i_size || count == 0) return 0; /* Tell the buffer cache which block we expect to read in advance Since we are limited with the stack, we preread only MSDOS_PREFETCH @@ -185,15 +189,15 @@ Each time we process one block in bhlist, we replace it by a new prefetch block if needed. */ - PRINTK (("#### ino %ld pos %ld size %ld count %d\n",inode->i_ino,filp->f_pos,inode->i_size,count)); + PRINTK (("#### ino %ld pos %ld size %ld count %d\n",inode->i_ino,*ppos,inode->i_size,count)); { /* We must prefetch complete block, so we must take in account the offset in the first block. */ - int count_max = (filp->f_pos & (SECTOR_SIZE-1)) + count; + int count_max = (*ppos & (SECTOR_SIZE-1)) + count; int to_reada; /* How many block to read all at once */ - pre.file_sector = filp->f_pos >> SECTOR_BITS; + pre.file_sector = *ppos >> SECTOR_BITS; to_reada = count_max / SECTOR_SIZE; if (count_max & (SECTOR_SIZE-1)) to_reada++; if (filp->f_reada || !MSDOS_I(inode)->i_binary){ @@ -211,7 +215,7 @@ } pre.nolist = 0; PRINTK (("count %d ahead %d nblist %d\n",count,read_ahead[MAJOR(inode->i_dev)],pre.nblist)); - while ((left_in_file = inode->i_size - filp->f_pos) > 0 + while ((left_in_file = inode->i_size - *ppos) > 0 && buf < end){ struct buffer_head *bh = pre.bhlist[pre.nolist]; char *data; @@ -226,27 +230,27 @@ fat_prefetch (inode,&pre,MSDOS_PREFETCH/2); pre.nolist = 0; } - PRINTK (("file_read pos %ld nblist %d %d %d\n",filp->f_pos,pre.nblist,pre.fetched,count)); + PRINTK (("file_read pos %ld nblist %d %d %d\n",*ppos,pre.nblist,pre.fetched,count)); wait_on_buffer(bh); if (!fat_is_uptodate(sb,bh)){ /* read error ? */ fat_brelse (sb, bh); break; } - offset = filp->f_pos & (SECTOR_SIZE-1); + offset = *ppos & (SECTOR_SIZE-1); data = bh->b_data + offset; size = MIN(SECTOR_SIZE-offset,left_in_file); if (MSDOS_I(inode)->i_binary) { size = MIN(size,end-buf); copy_to_user(buf,data,size); buf += size; - filp->f_pos += size; + *ppos += size; }else{ for (; size && buf < end; size--) { char ch = *data++; - filp->f_pos++; + ++*ppos; if (ch == 26){ - filp->f_pos = inode->i_size; + *ppos = inode->i_size; break; }else if (ch != '\r'){ put_user(ch,buf++); @@ -269,12 +273,13 @@ /* Write to a file either from user space */ -long fat_file_write( - struct inode *inode, +ssize_t fat_file_write( struct file *filp, const char *buf, - unsigned long count) + size_t count, + loff_t *ppos) { + struct inode *inode = filp->f_dentry->d_inode; struct super_block *sb = inode->i_sb; int sector,offset,size,left,written; int error,carry; @@ -300,23 +305,23 @@ * but so what. That way leads to madness anyway. */ if (filp->f_flags & O_APPEND) - filp->f_pos = inode->i_size; + *ppos = inode->i_size; if (count == 0) return 0; error = carry = 0; for (start = buf; count || carry; count -= size) { - while (!(sector = fat_smap(inode,filp->f_pos >> SECTOR_BITS))) + while (!(sector = fat_smap(inode,*ppos >> SECTOR_BITS))) if ((error = fat_add_cluster(inode)) < 0) break; if (error) { fat_truncate(inode); break; } - offset = filp->f_pos & (SECTOR_SIZE-1); + offset = *ppos & (SECTOR_SIZE-1); size = MIN(SECTOR_SIZE-offset,MAX(carry,count)); if (binary_mode && offset == 0 && (size == SECTOR_SIZE - || filp->f_pos + size >= inode->i_size)){ + || *ppos + size >= inode->i_size)){ /* No need to read the block first since we will */ /* completely overwrite it */ /* or at least write past the end of file */ @@ -333,7 +338,7 @@ buf += size; } else { written = left = SECTOR_SIZE-offset; - to = (char *) bh->b_data+(filp->f_pos & (SECTOR_SIZE-1)); + to = (char *) bh->b_data+(*ppos & (SECTOR_SIZE-1)); if (carry) { *to++ = '\n'; left--; @@ -353,10 +358,10 @@ } written -= left; } - update_vm_cache(inode, filp->f_pos, bh->b_data + (filp->f_pos & (SECTOR_SIZE-1)), written); - filp->f_pos += written; - if (filp->f_pos > inode->i_size) { - inode->i_size = filp->f_pos; + update_vm_cache(inode, *ppos, bh->b_data + (*ppos & (SECTOR_SIZE-1)), written); + *ppos += written; + if (*ppos > inode->i_size) { + inode->i_size = *ppos; mark_inode_dirty(inode); } fat_set_uptodate(sb, bh, 1); diff -u --recursive --new-file v2.1.59/linux/fs/fat/inode.c linux/fs/fat/inode.c --- v2.1.59/linux/fs/fat/inode.c Sun Jul 27 12:11:00 1997 +++ linux/fs/fat/inode.c Thu Oct 23 14:00:15 1997 @@ -5,10 +5,13 @@ * VFAT extensions by Gordon Chaffee, merged with msdos fs by Henrik Storner */ +#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) +#include #define __NO_VERSION__ #include #include +#include #include #include #include @@ -18,14 +21,24 @@ #include #include #include +#include #include "msbuffer.h" -#include "tables.h" +#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0) #include +#define FAT_COPY_TO_USER(uaddr, kaddr, len) copy_to_user(uaddr, kaddr, len) +#else +#include +#define FAT_COPY_TO_USER(uaddr, kaddr, len) memcpy_tofs(uaddr, kaddr, len) +#endif #include - +#if 0 +# define PRINTK(x) printk x +#else +# define PRINTK(x) +#endif void fat_put_inode(struct inode *inode) { @@ -85,8 +98,24 @@ void fat_put_super(struct super_block *sb) { + if (MSDOS_SB(sb)->fat_bits == 32) { + fat_clusters_flush(sb); + } fat_cache_inval_dev(sb->s_dev); set_blocksize (sb->s_dev,BLOCK_SIZE); + if (MSDOS_SB(sb)->nls_disk) { + unload_nls(MSDOS_SB(sb)->nls_disk); + MSDOS_SB(sb)->nls_disk = NULL; + MSDOS_SB(sb)->options.codepage = 0; + } + if (MSDOS_SB(sb)->nls_io) { + unload_nls(MSDOS_SB(sb)->nls_io); + MSDOS_SB(sb)->nls_io = NULL; + if (MSDOS_SB(sb)->options.iocharset) { + kfree(MSDOS_SB(sb)->options.iocharset); + MSDOS_SB(sb)->options.iocharset = NULL; + } + } lock_super(sb); sb->s_dev = 0; unlock_super(sb); @@ -98,27 +127,38 @@ static int parse_options(char *options,int *fat, int *blksize, int *debug, struct fat_mount_options *opts) { - char *this_char,*value; + char *this_char,*value,save,*savep; + char *p; + int ret, len; opts->name_check = 'n'; opts->conversion = 'b'; opts->fs_uid = current->uid; opts->fs_gid = current->gid; opts->fs_umask = current->fs->umask; - opts->quiet = opts->sys_immutable = opts->dotsOK = opts->showexec = opts->isvfat = 0; + opts->quiet = opts->sys_immutable = opts->dotsOK = opts->showexec = 0; + opts->codepage = 0; + opts->utf8 = 0; + opts->iocharset = NULL; *debug = *fat = 0; if (!options) return 1; + save = 0; + savep = NULL; + ret = 1; for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) { - if ((value = strchr(this_char,'=')) != NULL) + if ((value = strchr(this_char,'=')) != NULL) { + save = *value; + savep = value; *value++ = 0; + } if (!strcmp(this_char,"check") && value) { if (value[0] && !value[1] && strchr("rns",*value)) opts->name_check = *value; else if (!strcmp(value,"relaxed")) opts->name_check = 'r'; else if (!strcmp(value,"normal")) opts->name_check = 'n'; else if (!strcmp(value,"strict")) opts->name_check = 's'; - else return 0; + else ret = 0; } else if (!strcmp(this_char,"conv") && value) { if (value[0] && !value[1] && strchr("bta",*value)) @@ -126,7 +166,7 @@ else if (!strcmp(value,"binary")) opts->conversion = 'b'; else if (!strcmp(value,"text")) opts->conversion = 't'; else if (!strcmp(value,"auto")) opts->conversion = 'a'; - else return 0; + else ret = 0; } else if (!strcmp(this_char,"dots")) { opts->dotsOK = 1; @@ -140,57 +180,80 @@ else if (!strcmp(this_char,"dotsOK") && value) { if (!strcmp(value,"yes")) opts->dotsOK = 1; else if (!strcmp(value,"no")) opts->dotsOK = 0; - else return 0; + else ret = 0; } else if (!strcmp(this_char,"uid")) { - if (!value || !*value) - return 0; - opts->fs_uid = simple_strtoul(value,&value,0); - if (*value) - return 0; + if (!value || !*value) ret = 0; + else { + opts->fs_uid = simple_strtoul(value,&value,0); + if (*value) ret = 0; + } } else if (!strcmp(this_char,"gid")) { - if (!value || !*value) - return 0; - opts->fs_gid = simple_strtoul(value,&value,0); - if (*value) - return 0; + if (!value || !*value) ret= 0; + else { + opts->fs_gid = simple_strtoul(value,&value,0); + if (*value) ret = 0; + } } else if (!strcmp(this_char,"umask")) { - if (!value || !*value) - return 0; - opts->fs_umask = simple_strtoul(value,&value,8); - if (*value) - return 0; + if (!value || !*value) ret = 0; + else { + opts->fs_umask = simple_strtoul(value,&value,8); + if (*value) ret = 0; + } } else if (!strcmp(this_char,"debug")) { - if (value) return 0; - *debug = 1; + if (value) ret = 0; + else *debug = 1; } else if (!strcmp(this_char,"fat")) { - if (!value || !*value) - return 0; - *fat = simple_strtoul(value,&value,0); - if (*value || (*fat != 12 && *fat != 16)) - return 0; + if (!value || !*value) ret = 0; + else { + *fat = simple_strtoul(value,&value,0); + if (*value || (*fat != 12 && *fat != 16 && + *fat != 32)) + ret = 0; + } } else if (!strcmp(this_char,"quiet")) { - if (value) return 0; - opts->quiet = 1; + if (value) ret = 0; + else opts->quiet = 1; } else if (!strcmp(this_char,"blocksize")) { - *blksize = simple_strtoul(value,&value,0); - if (*value) - return 0; - if (*blksize != 512 && *blksize != 1024 && *blksize != 2048){ - printk ("MSDOS FS: Invalid blocksize (512, 1024 or 2048)\n"); + if (*value) ret = 0; + else if (*blksize != 512 && *blksize != 1024 && *blksize != 2048){ + printk ("MSDOS FS: Invalid blocksize (512, 1024, or 2048)\n"); } } else if (!strcmp(this_char,"sys_immutable")) { - if (value) - return 0; - opts->sys_immutable = 1; + if (value) ret = 0; + else opts->sys_immutable = 1; } + else if (!strcmp(this_char,"codepage")) { + opts->codepage = simple_strtoul(value,&value,0); + if (*value) ret = 0; + else printk ("MSDOS FS: Using codepage %d\n", opts->codepage); + } + else if (!strcmp(this_char,"iocharset")) { + p = value; + while (*value && *value != ',') value++; + len = value - p; + if (len) { + opts->iocharset = kmalloc(len+1, GFP_KERNEL); + memcpy(opts->iocharset, p, len); + opts->iocharset[len] = 0; + printk ("MSDOS FS: Using IO charset %s\n", + opts->iocharset); + } else { + opts->iocharset = NULL; + ret = 0; + } + } + + if (this_char != options) *(this_char-1) = ','; + if (value) *savep = save; + if (ret == 0) return 0; } return 1; } @@ -201,11 +264,14 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent) { struct buffer_head *bh; - struct msdos_boot_sector *b; + struct fat_boot_sector *b; int data_sectors,logical_sector_size,sector_mult,fat_clusters=0; - int debug,error,fat; + int debug,error,fat,cp; int blksize = 512; + int fat32; struct fat_mount_options opts; + char buf[50]; + char *p; struct inode *root_inode; MOD_INC_USE_COUNT; @@ -215,6 +281,7 @@ printk ("MSDOS: Hardware sector size is %d\n",blksize); } } + opts.isvfat = MSDOS_SB(sb)->options.isvfat; if (!parse_options((char *) data, &fat, &blksize, &debug, &opts) || (blksize != 512 && blksize != 1024 && blksize != 2048)) { @@ -245,8 +312,8 @@ MOD_DEC_USE_COUNT; return NULL; } - b = (struct msdos_boot_sector *) bh->b_data; set_blocksize(sb->s_dev, blksize); + /* * The DOS3 partition size limit is *not* 32M as many people think. * Instead, it is 64K sectors (with the usual sector size being @@ -265,15 +332,37 @@ #define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0) /* don't divide by zero */ + b = (struct fat_boot_sector *) bh->b_data; logical_sector_size = CF_LE_W(get_unaligned((unsigned short *) &b->sector_size)); sector_mult = logical_sector_size >> SECTOR_BITS; MSDOS_SB(sb)->cluster_size = b->cluster_size*sector_mult; MSDOS_SB(sb)->fats = b->fats; MSDOS_SB(sb)->fat_start = CF_LE_W(b->reserved)*sector_mult; - MSDOS_SB(sb)->fat_length = CF_LE_W(b->fat_length)*sector_mult; - MSDOS_SB(sb)->dir_start = (CF_LE_W(b->reserved)+b->fats*CF_LE_W( - b->fat_length))*sector_mult; + if (!b->fat_length && b->fat32_length) { + struct fat_boot_fsinfo *fsinfo; + + /* Must be FAT32 */ + fat32 = 1; + MSDOS_SB(sb)->fat_length= CF_LE_W(b->fat32_length)*sector_mult; + MSDOS_SB(sb)->root_cluster = CF_LE_L(b->root_cluster); + MSDOS_SB(sb)->fsinfo_offset = + CF_LE_W(b->info_sector) * logical_sector_size + 0x1e0; + fsinfo = (struct fat_boot_fsinfo *) + &bh->b_data[MSDOS_SB(sb)->fsinfo_offset]; + if (CF_LE_L(fsinfo->signature) != 0x61417272) { + printk("fat_read_super: Did not find valid FSINFO signature. Found 0x%x\n", CF_LE_L(fsinfo->signature)); + } else { + MSDOS_SB(sb)->free_clusters = CF_LE_L(fsinfo->free_clusters); + } + } else { + fat32 = 0; + MSDOS_SB(sb)->fat_length = CF_LE_W(b->fat_length)*sector_mult; + MSDOS_SB(sb)->root_cluster = 0; + MSDOS_SB(sb)->free_clusters = -1; /* Don't know yet */ + } + MSDOS_SB(sb)->dir_start= CF_LE_W(b->reserved)*sector_mult+ + b->fats*MSDOS_SB(sb)->fat_length; MSDOS_SB(sb)->dir_entries = CF_LE_W(get_unaligned((unsigned short *) &b->dir_entries)); MSDOS_SB(sb)->data_start = MSDOS_SB(sb)->dir_start+ROUND_TO_MULTIPLE(( @@ -288,8 +377,9 @@ if (!error) { MSDOS_SB(sb)->clusters = b->cluster_size ? data_sectors/ b->cluster_size/sector_mult : 0; - MSDOS_SB(sb)->fat_bits = fat ? fat : MSDOS_SB(sb)->clusters > - MSDOS_FAT12 ? 16 : 12; + MSDOS_SB(sb)->fat_bits = fat32 ? 32 : + (fat ? fat : + (MSDOS_SB(sb)->clusters > MSDOS_FAT12 ? 16 : 12)); fat_clusters = MSDOS_SB(sb)->fat_length*SECTOR_SIZE*8/ MSDOS_SB(sb)->fat_bits; error = !MSDOS_SB(sb)->fats || (MSDOS_SB(sb)->dir_entries & @@ -315,12 +405,13 @@ opts.conversion,opts.fs_uid,opts.fs_gid,opts.fs_umask, MSDOS_CAN_BMAP(MSDOS_SB(sb)) ? ",bmap" : ""); printk("[me=0x%x,cs=%d,#f=%d,fs=%d,fl=%d,ds=%d,de=%d,data=%d," - "se=%d,ts=%d,ls=%d]\n",b->media,MSDOS_SB(sb)->cluster_size, + "se=%d,ts=%ld,ls=%d,rc=%ld,fc=%u]\n",b->media,MSDOS_SB(sb)->cluster_size, MSDOS_SB(sb)->fats,MSDOS_SB(sb)->fat_start,MSDOS_SB(sb)->fat_length, MSDOS_SB(sb)->dir_start,MSDOS_SB(sb)->dir_entries, MSDOS_SB(sb)->data_start, - CF_LE_W(get_unaligned((unsigned short *) &b->sectors)), - CF_LE_L(b->total_sect),logical_sector_size); + CF_LE_W(*(unsigned short *) &b->sectors), + (unsigned long)b->total_sect,logical_sector_size, + MSDOS_SB(sb)->root_cluster,MSDOS_SB(sb)->free_clusters); printk ("Transaction block size = %d\n",blksize); } if (MSDOS_SB(sb)->clusters+2 > fat_clusters) @@ -335,17 +426,51 @@ } sb->s_magic = MSDOS_SUPER_MAGIC; /* set up enough so that it can read an inode */ - MSDOS_SB(sb)->free_clusters = -1; /* don't know yet */ MSDOS_SB(sb)->fat_wait = NULL; MSDOS_SB(sb)->fat_lock = 0; MSDOS_SB(sb)->prev_free = 0; memcpy(&(MSDOS_SB(sb)->options), &opts, sizeof(struct fat_mount_options)); + cp = opts.codepage ? opts.codepage : 437; + sprintf(buf, "cp%d", cp); + MSDOS_SB(sb)->nls_disk = load_nls(buf); + if (! MSDOS_SB(sb)->nls_disk) { + /* Fail only if explicit charset specified */ + if (opts.codepage == 0) { + MSDOS_SB(sb)->options.codepage = 0; + MSDOS_SB(sb)->nls_disk = load_nls_default(); + } else { + sb->s_dev = 0; + MOD_DEC_USE_COUNT; + return NULL; + } + } + + p = opts.iocharset ? opts.iocharset : "iso8859-1"; + if (MSDOS_SB(sb)->options.isvfat && !opts.utf8) { + MSDOS_SB(sb)->nls_io = load_nls(p); + if (! MSDOS_SB(sb)->nls_io) { + /* Fail only if explicit charset specified */ + if (opts.iocharset) { + kfree(opts.iocharset); + unload_nls(MSDOS_SB(sb)->nls_disk); + sb->s_dev = 0; + MOD_DEC_USE_COUNT; + return NULL; + } else { + MSDOS_SB(sb)->nls_io = load_nls_default(); + } + } + } + root_inode = iget(sb,MSDOS_ROOT_INO); sb->s_root = d_alloc_root(root_inode, NULL); if (!sb->s_root) { sb->s_dev = 0; printk("get root inode failed\n"); + unload_nls(MSDOS_SB(sb)->nls_disk); + if (MSDOS_SB(sb)->nls_io) unload_nls(MSDOS_SB(sb)->nls_io); + if (opts.iocharset) kfree(opts.iocharset); MOD_DEC_USE_COUNT; return NULL; } @@ -386,7 +511,7 @@ int cluster,offset; sb = MSDOS_SB(inode->i_sb); - if (inode->i_ino == MSDOS_ROOT_INO) { + if ((inode->i_ino == MSDOS_ROOT_INO) && (sb->fat_bits != 32)) { return sb->dir_start + block; } cluster = block/sb->cluster_size; @@ -412,6 +537,8 @@ struct msdos_dir_entry *raw_entry; int nr; + PRINTK(("fat_read_inode: inode=%p, sb->dir_start=0x%x\n", + inode, MSDOS_SB(sb)->dir_start)); MSDOS_I(inode)->i_busy = 0; MSDOS_I(inode)->i_depend = MSDOS_I(inode)->i_old = NULL; MSDOS_I(inode)->i_linked = MSDOS_I(inode)->i_oldlink = NULL; @@ -423,17 +550,33 @@ inode->i_mode = (S_IRWXUGO & ~MSDOS_SB(sb)->options.fs_umask) | S_IFDIR; inode->i_op = fs_dir_inode_ops; - inode->i_nlink = fat_subdirs(inode)+2; - /* subdirs (neither . nor ..) plus . and "self" */ - inode->i_size = MSDOS_SB(sb)->dir_entries* - sizeof(struct msdos_dir_entry); + if (MSDOS_SB(sb)->fat_bits == 32) { + MSDOS_I(inode)->i_start = MSDOS_SB(sb)->root_cluster; + if ((nr = MSDOS_I(inode)->i_start) != 0) { + while (nr != -1) { + inode->i_size += SECTOR_SIZE*MSDOS_SB(sb)->cluster_size; + if (!(nr = fat_access(sb,nr,-1))) { + printk("Directory %ld: bad FAT\n", + inode->i_ino); + break; + } + } + } + } else { + MSDOS_I(inode)->i_start = 0; + inode->i_size = MSDOS_SB(sb)->dir_entries* + sizeof(struct msdos_dir_entry); + } inode->i_blksize = MSDOS_SB(sb)->cluster_size* SECTOR_SIZE; inode->i_blocks = (inode->i_size+inode->i_blksize-1)/ inode->i_blksize*MSDOS_SB(sb)->cluster_size; - MSDOS_I(inode)->i_start = 0; + MSDOS_I(inode)->i_logstart = 0; + MSDOS_I(inode)->i_attrs = 0; inode->i_mtime = inode->i_atime = inode->i_ctime = 0; + inode->i_nlink = fat_subdirs(inode)+2; + /* subdirs (neither . nor ..) plus . and "self" */ return; } if (!(bh = fat_bread(sb, inode->i_ino >> MSDOS_DPB_BITS))) { @@ -449,6 +592,11 @@ inode->i_op = fs_dir_inode_ops; MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start); + if (MSDOS_SB(sb)->fat_bits == 32) { + MSDOS_I(inode)->i_start |= + (CF_LE_W(raw_entry->starthi) << 16); + } + MSDOS_I(inode)->i_logstart = MSDOS_I(inode)->i_start; inode->i_nlink = fat_subdirs(inode); /* includes .., compensating for "self" */ #ifdef DEBUG @@ -458,7 +606,7 @@ } #endif inode->i_size = 0; - if ((nr = CF_LE_W(raw_entry->start)) != 0) + if ((nr = MSDOS_I(inode)->i_start) != 0) while (nr != -1) { inode->i_size += SECTOR_SIZE*MSDOS_SB(inode-> i_sb)->cluster_size; @@ -479,6 +627,11 @@ ? &fat_file_inode_operations_1024 : &fat_file_inode_operations; MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start); + if (MSDOS_SB(sb)->fat_bits == 32) { + MSDOS_I(inode)->i_start |= + (CF_LE_W(raw_entry->starthi) << 16); + } + MSDOS_I(inode)->i_logstart = MSDOS_I(inode)->i_start; inode->i_nlink = 1; inode->i_size = CF_LE_L(raw_entry->size); } @@ -549,7 +702,8 @@ } raw_entry->attr |= MSDOS_MKATTR(inode->i_mode) | MSDOS_I(inode)->i_attrs; - raw_entry->start = CT_LE_W(MSDOS_I(inode)->i_start); + raw_entry->start = CT_LE_W(MSDOS_I(inode)->i_logstart); + raw_entry->starthi = CT_LE_W(MSDOS_I(inode)->i_logstart >> 16); fat_date_unix2dos(inode->i_mtime,&raw_entry->time,&raw_entry->date); raw_entry->time = CT_LE_W(raw_entry->time); raw_entry->date = CT_LE_W(raw_entry->date); diff -u --recursive --new-file v2.1.59/linux/fs/fat/misc.c linux/fs/fat/misc.c --- v2.1.59/linux/fs/fat/misc.c Mon Aug 4 16:25:39 1997 +++ linux/fs/fat/misc.c Thu Oct 23 14:00:15 1997 @@ -14,7 +14,11 @@ #include "msbuffer.h" -#define PRINTK(x) +#if 0 +# define PRINTK(x) printk x +#else +# define PRINTK(x) +#endif #define Printk(x) printk x /* Well-known binary file extensions - of course there are many more */ @@ -106,6 +110,34 @@ wake_up(&MSDOS_SB(sb)->fat_wait); } +/* Flushes the number of free clusters on FAT32 */ +/* XXX: Need to write one per FSINFO block. Currently only writes 1 */ +void fat_clusters_flush(struct super_block *sb) +{ + int offset; + struct buffer_head *bh; + struct fat_boot_fsinfo *fsinfo; + + /* The fat32 boot fs info is at offset 0x3e0 by observation */ + offset = MSDOS_SB(sb)->fsinfo_offset; + bh = fat_bread(sb, (offset >> SECTOR_BITS)); + if (bh == NULL) { + printk("FAT bread failed in fat_clusters_flush\n"); + return; + } + fsinfo = (struct fat_boot_fsinfo *) + &bh->b_data[offset & (SECTOR_SIZE-1)]; + + /* Sanity check */ + if (CF_LE_L(fsinfo->signature) != 0x61417272) { + printk("fat_clusters_flush: Did not find valid FSINFO signature. Found 0x%x. offset=0x%x\n", CF_LE_L(fsinfo->signature), offset); + fat_brelse(sb, bh); + return; + } + fsinfo->free_clusters = CF_LE_L(MSDOS_SB(sb)->free_clusters); + fat_mark_buffer_dirty(sb, bh, 1); + fat_brelse(sb, bh); +} /* * fat_add_cluster tries to allocate a new cluster and adds it to the file @@ -119,7 +151,9 @@ struct buffer_head *bh; int cluster_size = MSDOS_SB(sb)->cluster_size; - if (inode->i_ino == MSDOS_ROOT_INO) return -ENOSPC; + if (MSDOS_SB(sb)->fat_bits != 32) { + if (inode->i_ino == MSDOS_ROOT_INO) return -ENOSPC; + } if (!MSDOS_SB(sb)->free_clusters) return -ENOSPC; lock_fat(sb); limit = MSDOS_SB(sb)->clusters; @@ -141,6 +175,8 @@ fat_access(sb,nr,EOF_FAT(sb)); if (MSDOS_SB(sb)->free_clusters != -1) MSDOS_SB(sb)->free_clusters--; + if (MSDOS_SB(sb)->fat_bits == 32) + fat_clusters_flush(sb); unlock_fat(sb); #ifdef DEBUG printk("set to %x\n",fat_access(sb,nr,-1)); @@ -177,6 +213,7 @@ if (last) fat_access(sb,last,nr); else { MSDOS_I(inode)->i_start = nr; + MSDOS_I(inode)->i_logstart = nr; mark_inode_dirty(inode); } #ifdef DEBUG @@ -260,6 +297,8 @@ unix_date += 3600; } unix_date -= sys_tz.tz_minuteswest*60; + if (sys_tz.tz_dsttime) unix_date += 3600; + *time = (unix_date % 60)/2+(((unix_date/60) % 60) << 5)+ (((unix_date/3600) % 24) << 11); day = unix_date/86400-3652; @@ -302,7 +341,7 @@ fat_brelse(sb, *bh); PRINTK (("get_entry sector apres brelse\n")); if (!(*bh = fat_bread(sb, sector))) { - printk("Directory sread (sector %d) failed\n",sector); + printk("Directory sread (sector 0x%x) failed\n",sector); continue; } PRINTK (("get_entry apres sread\n")); @@ -344,7 +383,13 @@ !(data[entry].attr & ATTR_VOLUME); #define RSS_START /* search for start cluster */ \ - done = !IS_FREE(data[entry].name) && CF_LE_W(data[entry].start) == *number; + done = !IS_FREE(data[entry].name) \ + && ( \ + ( \ + (MSDOS_SB(sb)->fat_bits != 32) ? 0 : (CF_LE_W(data[entry].starthi) << 16) \ + ) \ + | CF_LE_W(data[entry].start) \ + ) == *number; #define RSS_FREE /* search for free entry */ \ { \ @@ -397,6 +442,9 @@ if (done) { if (ino) *ino = sector*MSDOS_DPS+entry; start = CF_LE_W(data[entry].start); + if (MSDOS_SB(sb)->fat_bits == 32) { + start |= (CF_LE_W(data[entry].starthi) << 16); + } if (!res_bh) fat_brelse(sb, bh); else { @@ -492,6 +540,7 @@ static int zero = 0; int error,curr,prev,nr; + PRINTK(("fat_parent_ino: Debug 0\n")); if (!S_ISDIR(dir->i_mode)) panic("Non-directory fed to m_p_i"); if (dir->i_ino == MSDOS_ROOT_INO) return dir->i_ino; if (!locked) fat_lock_creation(); /* prevent renames */ @@ -500,18 +549,27 @@ if (!locked) fat_unlock_creation(); return curr; } + PRINTK(("fat_parent_ino: Debug 1 curr=%d\n", curr)); if (!curr) nr = MSDOS_ROOT_INO; else { + PRINTK(("fat_parent_ino: Debug 2\n")); if ((prev = raw_scan(dir->i_sb,curr,MSDOS_DOTDOT,&zero,NULL, NULL,NULL,SCAN_ANY)) < 0) { + PRINTK(("fat_parent_ino: Debug 3 prev=%d\n", prev)); if (!locked) fat_unlock_creation(); return prev; } + PRINTK(("fat_parent_ino: Debug 4 prev=%d\n", prev)); + if (prev == 0 && MSDOS_SB(dir->i_sb)->fat_bits == 32) { + prev = MSDOS_SB(dir->i_sb)->root_cluster; + } if ((error = raw_scan(dir->i_sb,prev,NULL,&curr,&nr,NULL, NULL,SCAN_ANY)) < 0) { + PRINTK(("fat_parent_ino: Debug 5 error=%d\n", error)); if (!locked) fat_unlock_creation(); return error; } + PRINTK(("fat_parent_ino: Debug 6 nr=%d\n", nr)); } if (!locked) fat_unlock_creation(); return nr; @@ -528,10 +586,12 @@ int count; count = 0; - if (dir->i_ino == MSDOS_ROOT_INO) + if ((dir->i_ino == MSDOS_ROOT_INO) && + (MSDOS_SB(dir->i_sb)->fat_bits != 32)) { (void) raw_scan_root(dir->i_sb,NULL,&count,NULL,NULL,NULL,SCAN_ANY); - else { - if (!MSDOS_I(dir)->i_start) return 0; /* in mkdir */ + } else { + if ((dir->i_ino != MSDOS_ROOT_INO) && + !MSDOS_I(dir)->i_start) return 0; /* in mkdir */ else (void) raw_scan_nonroot(dir->i_sb,MSDOS_I(dir)->i_start, NULL,&count,NULL,NULL,NULL,SCAN_ANY); } @@ -549,10 +609,7 @@ { int res; - res = (name) - ? raw_scan(dir->i_sb,MSDOS_I(dir)->i_start, - name, NULL, ino, res_bh, res_de, scantype) - : raw_scan(dir->i_sb,MSDOS_I(dir)->i_start, - NULL, NULL, ino, res_bh, res_de, scantype); + res = raw_scan(dir->i_sb,MSDOS_I(dir)->i_start, + name, NULL, ino, res_bh, res_de, scantype); return res<0 ? res : 0; } diff -u --recursive --new-file v2.1.59/linux/fs/fat/mmap.c linux/fs/fat/mmap.c --- v2.1.59/linux/fs/fat/mmap.c Tue Sep 23 16:48:48 1997 +++ linux/fs/fat/mmap.c Thu Oct 23 14:00:15 1997 @@ -7,6 +7,9 @@ * mmap handling for fat-based filesystems */ +#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) +#include + #include #include #include @@ -18,7 +21,11 @@ #include #include +#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0) #include +#else +#include +#endif #include /* @@ -59,8 +66,8 @@ { unsigned long cur_fs = get_fs(); set_fs (KERNEL_DS); - cur_read = fat_file_read (inode,&filp,(char*)page - ,need_read); + cur_read = fat_file_read (&filp, (char*)page, + need_read, &filp.f_pos); set_fs (cur_fs); } if (cur_read != need_read){ diff -u --recursive --new-file v2.1.59/linux/fs/fat/tables.c linux/fs/fat/tables.c --- v2.1.59/linux/fs/fat/tables.c Tue Mar 5 03:03:26 1996 +++ linux/fs/fat/tables.c Thu Oct 23 14:00:15 1997 @@ -1,7 +1,7 @@ /* * linux/fs/fat/tables.c * - * ASCII / Unicode translation tables for VFAT filename handling. + * Unicode escape translation tables for VFAT filename handling. * By Gordon Chaffee. * * Note: This file is used by all fat-based filesystems. @@ -9,10 +9,9 @@ #include #include +#include -#include "tables.h" - -unsigned char fat_uni2code[64] = { +unsigned char fat_uni2esc[64] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', @@ -23,7 +22,7 @@ 'u', 'v', 'w', 'x', 'y', 'z', '+', '-' }; -unsigned char fat_code2uni[256] = { +unsigned char fat_esc2uni[256] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -58,209 +57,6 @@ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; -static unsigned char page00[256] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 0x08-0x0F */ - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, /* 0x18-0x1F */ - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ - 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, /* 0x28-0x2F */ - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ - 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, /* 0x38-0x3F */ - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, /* 0x48-0x4F */ - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ - 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, /* 0x58-0x5F */ - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ - 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, /* 0x68-0x6F */ - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ - 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, /* 0x78-0x7F */ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8F */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, /* 0x98-0x9F */ - 0xFF, 0xAD, 0xBD, 0x9C, 0xCF, 0xBE, 0xDD, 0xF5, /* 0xA0-0xA7 */ - 0xF9, 0xB8, 0x00, 0xAE, 0xAA, 0xF0, 0x00, 0xEE, /* 0xA8-0xAF */ - 0xF8, 0xF1, 0xFD, 0xFC, 0xEF, 0xE6, 0xF4, 0xFA, /* 0xB0-0xB7 */ - 0xF7, 0xFB, 0x00, 0xAF, 0xAC, 0xAB, 0xF3, 0x00, /* 0xB8-0xBF */ - 0xB7, 0xB5, 0xB6, 0xC7, 0x8E, 0x8F, 0x92, 0x80, /* 0xC0-0xC7 */ - 0xD4, 0x90, 0xD2, 0xD3, 0xDE, 0xD6, 0xD7, 0xD8, /* 0xC8-0xCF */ - 0x00, 0xA5, 0xE3, 0xE0, 0xE2, 0xE5, 0x99, 0x9E, /* 0xD0-0xD7 */ - 0x9D, 0xEB, 0xE9, 0xEA, 0x9A, 0xED, 0xE8, 0xE1, /* 0xD8-0xDF */ - 0xA1, 0xA0, 0x83, 0xC6, 0x84, 0x86, 0x91, 0x87, /* 0xE0-0xE7 */ - 0x8A, 0x82, 0x88, 0x89, 0x8D, 0x00, 0x8C, 0x8B, /* 0xE8-0xEF */ - 0xD0, 0xA4, 0x95, 0xA2, 0x93, 0xE4, 0x94, 0xF6, /* 0xF0-0xF7 */ - 0x9B, 0x97, 0xA3, 0x96, 0x81, 0xEC, 0xE7, 0x98 /* 0xF8-0xFF */ -}; - - -static unsigned char page25[256] = { - 0xC4, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ - 0x00, 0x00, 0x00, 0x00, 0xDA, 0x00, 0x00, 0x00, /* 0x08-0x0F */ - 0xBF, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ - 0xD9, 0x00, 0x00, 0x00, 0xC3, 0x00, 0x00, 0x00, /* 0x18-0x1F */ - 0x00, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ - 0x00, 0x00, 0x00, 0x00, 0xC2, 0x00, 0x00, 0x00, /* 0x28-0x2F */ - 0x00, 0x00, 0x00, 0x00, 0xC1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ - 0x00, 0x00, 0x00, 0x00, 0xC5, 0x00, 0x00, 0x00, /* 0x38-0x3F */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4F */ - 0xCD, 0xBA, 0x00, 0x00, 0xC9, 0x00, 0x00, 0xBB, /* 0x50-0x57 */ - 0x00, 0x00, 0xC8, 0x00, 0x00, 0xBC, 0x00, 0x00, /* 0x58-0x5F */ - 0xCC, 0x00, 0x00, 0xB9, 0x00, 0x00, 0xCB, 0x00, /* 0x60-0x67 */ - 0x00, 0xCA, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, /* 0x68-0x6F */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7F */ - - 0xDF, 0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, /* 0x80-0x87 */ - 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8F */ - 0x00, 0xB0, 0xB1, 0xB2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9F */ - 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA7 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAF */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB7 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBF */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC7 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCF */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD7 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDF */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE7 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEF */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF7 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 0xF8-0xFF */ -}; - - -unsigned char *fat_uni2asc_pg[256] = { - page00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, page25 -}; - -/* Conversion from ASCII name characters to the shortname character - * should probably just just use XXX - */ -unsigned char fat_a2alias[256] = -{ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 0x08-0x0F */ - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ - 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, /* 0x18-0x1F */ - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ - 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, /* 0x28-0x2F */ - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ - 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, /* 0x38-0x3F */ - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ - 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, /* 0x48-0x4F */ - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ - 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, /* 0x58-0x5F */ - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ - 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, /* 0x68-0x6F */ - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ - 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, /* 0x78-0x7F */ - - 0x80, 0x9A, 0x90, 0xB6, 0x8E, 0xB7, 0x8F, 0x80, /* 0x80-0x87 */ - 0xD2, 0xD3, 0xD4, 0xD8, 0xD7, 0xDE, 0x8E, 0x8F, /* 0x88-0x8F */ - 0x90, 0x92, 0x92, 0xE2, 0x99, 0xE3, 0xEA, 0xEB, /* 0x90-0x97 */ -/*_~1*/ 0x98, 0x99, 0x9A, 0x9D, 0x9C, 0x9D, 0x9E, 0x9F, /* 0x98-0x9F */ - 0xB5, 0xD6, 0xE0, 0xE9, 0xA5, 0xA5, 0xA6, 0xA7, /* 0xA0-0xA7 */ - 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, /* 0xA8-0xAF */ - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, /* 0xB0-0xB7 */ - 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, /* 0xB8-0xBF */ - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 0xC0-0xC7 */ - 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, /* 0xC8-0xCF */ - 0xD1, 0xD1, 0xD2, 0xD3, 0xD4, 0x49, 0xD6, 0xD7, /* 0xD0-0xD7 */ - 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, /* 0xD8-0xDF */ - 0xE0, 0xE1, 0xE2, 0xE3, 0x05, 0x05, 0xE6, 0xE8, /* 0xE0-0xE7 */ - 0xE8, 0xE9, 0xEA, 0xEB, 0xED, 0xED, 0xEE, 0xEF, /* 0xE8-0xEF */ - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 0xF0-0xF7 */ - 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF /* 0xF8-0xFF */ -}; - -struct unicode_value fat_a2uni[256] = { -/* 0x00 */ -{0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, -{0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, -{0x08, 0x00}, {0x09, 0x00}, {0x0A, 0x00}, {0x0B, 0x00}, -{0x0C, 0x00}, {0x0D, 0x00}, {0x0E, 0x00}, {0x0F, 0x00}, -/* 0x10 */ -{0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, -{0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, -{0x18, 0x00}, {0x19, 0x00}, {0x1A, 0x00}, {0x1B, 0x00}, -{0x1C, 0x00}, {0x1D, 0x00}, {0x1E, 0x00}, {0x1F, 0x00}, -/* 0x20 */ -{0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, -{0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, -{0x28, 0x00}, {0x29, 0x00}, {0x2A, 0x00}, {0x2B, 0x00}, -{0x2C, 0x00}, {0x2D, 0x00}, {0x2E, 0x00}, {0x2F, 0x00}, -/* 0x30 */ -{0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, -{0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, -{0x38, 0x00}, {0x39, 0x00}, {0x3A, 0x00}, {0x3B, 0x00}, -{0x3C, 0x00}, {0x3D, 0x00}, {0x3E, 0x00}, {0x3F, 0x00}, -/* 0x40 */ -{0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, -{0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, -{0x48, 0x00}, {0x49, 0x00}, {0x4A, 0x00}, {0x4B, 0x00}, -{0x4C, 0x00}, {0x4D, 0x00}, {0x4E, 0x00}, {0x4F, 0x00}, -/* 0x50 */ -{0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, -{0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, -{0x58, 0x00}, {0x59, 0x00}, {0x5A, 0x00}, {0x5B, 0x00}, -{0x5C, 0x00}, {0x5D, 0x00}, {0x5E, 0x00}, {0x5F, 0x00}, -/* 0x60 */ -{0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, -{0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, -{0x68, 0x00}, {0x69, 0x00}, {0x6A, 0x00}, {0x6B, 0x00}, -{0x6C, 0x00}, {0x6D, 0x00}, {0x6E, 0x00}, {0x6F, 0x00}, -/* 0x70 */ -{0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, -{0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, -{0x78, 0x00}, {0x79, 0x00}, {0x7A, 0x00}, {0x7B, 0x00}, -{0x7C, 0x00}, {0x7D, 0x00}, {0x7E, 0x00}, {0x7F, 0x00}, -/* 0x80 */ -{0xC7, 0x00}, {0xFC, 0x00}, {0xE9, 0x00}, {0xE2, 0x00}, -{0xE4, 0x00}, {0xE0, 0x00}, {0xE5, 0x00}, {0xE7, 0x00}, -{0xEA, 0x00}, {0xEB, 0x00}, {0xE8, 0x00}, {0xEF, 0x00}, -{0xEE, 0x00}, {0xEC, 0x00}, {0xC4, 0x00}, {0xC5, 0x00}, -/* 0x90 */ -{0xC9, 0x00}, {0xE6, 0x00}, {0xC6, 0x00}, {0xF4, 0x00}, -{0xF6, 0x00}, {0xF2, 0x00}, {0xFB, 0x00}, {0xF9, 0x00}, -{0xFF, 0x00}, {0xD6, 0x00}, {0xDC, 0x00}, {0xF8, 0x00}, -{0xA3, 0x00}, {0xD8, 0x00}, {0xD7, 0x00}, {0x92, 0x00}, -/* 0xA0 */ -{0xE1, 0x00}, {0xE0, 0x00}, {0xF3, 0x00}, {0xFA, 0x00}, -{0xF1, 0x00}, {0xD1, 0x00}, {0xAA, 0x00}, {0xBA, 0x00}, -{0xBF, 0x00}, {0xAE, 0x00}, {0xAC, 0x00}, {0xBD, 0x00}, -{0xBC, 0x00}, {0xA1, 0x00}, {0xAB, 0x00}, {0xBB, 0x00}, -/* 0xB0 */ -{0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, -{0x24, 0x25}, {0xC1, 0x00}, {0xC2, 0x00}, {0xC0, 0x00}, -{0xA9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, -{0x5D, 0x25}, {0xA2, 0x00}, {0xA5, 0x00}, {0x10, 0x25}, -/* 0xC0 */ -{0x14, 0x25}, {0x34, 0x25}, {0x2C, 0x25}, {0x1C, 0x25}, -{0x00, 0x25}, {0x3C, 0x25}, {0xE3, 0x00}, {0xC3, 0x00}, -{0x5A, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, -{0x60, 0x25}, {0x50, 0x25}, {0x6C, 0x25}, {0xA4, 0x00}, -/* 0xD0 */ -{0xF0, 0x00}, {0xD0, 0x00}, {0xCA, 0x00}, {0xCB, 0x00}, -{0xC8, 0x00}, {0x31, 0x01}, {0xCD, 0x00}, {0xCE, 0x00}, -{0xCF, 0x00}, {0x18, 0x25}, {0x0C, 0x25}, {0x88, 0x25}, -{0x84, 0x25}, {0xA6, 0x00}, {0xCC, 0x00}, {0x80, 0x25}, -/* 0xE0 */ -{0xD3, 0x00}, {0xDF, 0x00}, {0xD4, 0x00}, {0xD2, 0x00}, -{0xF5, 0x00}, {0xD5, 0x00}, {0xB5, 0x00}, {0xFE, 0x00}, -{0xDE, 0x00}, {0xDA, 0x00}, {0xDB, 0x00}, {0xD9, 0x00}, -{0xFD, 0x00}, {0xDD, 0x00}, {0xAF, 0x00}, {0xB4, 0x00}, -/* 0xF0 */ -{0xAD, 0x00}, {0xB1, 0x00}, {0x17, 0x20}, {0xBE, 0x00}, -{0xB6, 0x00}, {0xA7, 0x00}, {0xF7, 0x00}, {0xB8, 0x00}, -{0xB0, 0x00}, {0xA8, 0x00}, {0xB7, 0x00}, {0xB9, 0x00}, -{0xB3, 0x00}, {0xB2, 0x00}, {0xA0, 0x25}, {0xA0, 0x00}}; /* * Overrides for Emacs so that we follow Linus's tabbing style. diff -u --recursive --new-file v2.1.59/linux/fs/filesystems.c linux/fs/filesystems.c --- v2.1.59/linux/fs/filesystems.c Thu Jul 17 10:06:07 1997 +++ linux/fs/filesystems.c Thu Oct 23 14:00:15 1997 @@ -116,6 +116,10 @@ init_autofs_fs(); #endif +#ifdef CONFIG_NLS + init_nls(); +#endif + mount_root(); } diff -u --recursive --new-file v2.1.59/linux/fs/hpfs/hpfs_fs.c linux/fs/hpfs/hpfs_fs.c --- v2.1.59/linux/fs/hpfs/hpfs_fs.c Thu Sep 11 09:02:23 1997 +++ linux/fs/hpfs/hpfs_fs.c Tue Oct 21 08:57:29 1997 @@ -146,7 +146,7 @@ /* file ops */ -static long hpfs_file_read(struct inode *, struct file *, char *, unsigned long); +static ssize_t hpfs_file_read(struct file *, char *, size_t, loff_t *); static secno hpfs_bmap(struct inode *, unsigned); static const struct file_operations hpfs_file_ops = @@ -187,8 +187,8 @@ /* directory ops */ -static long hpfs_dir_read(struct inode *inode, struct file *filp, - char *buf, unsigned long count); +static ssize_t hpfs_dir_read(struct file *filp, char *buf, + size_t count, loff_t *ppos); static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir); static int hpfs_lookup(struct inode *, struct dentry *); @@ -881,10 +881,11 @@ * read. Read the bytes, put them in buf, return the count. */ -static long hpfs_file_read(struct inode *inode, struct file *filp, - char *buf, unsigned long count) +static ssize_t hpfs_file_read(struct file *filp, char *buf, + size_t count, loff_t *ppos) { - unsigned q, r, n, n0; + struct inode *inode = filp->f_dentry->d_inode; + size_t q, r, n, n0; struct buffer_head *bh; char *block; char *start; @@ -895,8 +896,8 @@ /* * truncate count at EOF */ - if (count > inode->i_size - (off_t) filp->f_pos) - count = inode->i_size - filp->f_pos; + if (count > inode->i_size - (off_t) *ppos) + count = inode->i_size - *ppos; start = buf; while (count > 0) { @@ -904,8 +905,8 @@ * get file sector number, offset in sector, length to end of * sector */ - q = filp->f_pos >> 9; - r = filp->f_pos & 511; + q = *ppos >> 9; + r = *ppos & 511; n = 512 - r; /* @@ -941,8 +942,8 @@ * squeeze out \r, output length varies */ n0 = convcpy_tofs(buf, block + r, n); - if (count > inode->i_size - (off_t) filp->f_pos - n + n0) - count = inode->i_size - filp->f_pos - n + n0; + if (count > inode->i_size - (off_t) *ppos - n + n0) + count = inode->i_size - *ppos - n + n0; } brelse(bh); @@ -950,7 +951,7 @@ /* * advance input n bytes, output n0 bytes */ - filp->f_pos += n; + *ppos += n; buf += n0; count -= n0; } @@ -1578,8 +1579,8 @@ return 0; } -static long hpfs_dir_read(struct inode *inode, struct file *filp, - char *buf, unsigned long count) +static ssize_t hpfs_dir_read(struct file *filp, char *buf, + size_t count, loff_t *ppos) { return -EISDIR; } diff -u --recursive --new-file v2.1.59/linux/fs/inode.c linux/fs/inode.c --- v2.1.59/linux/fs/inode.c Tue Sep 23 16:48:48 1997 +++ linux/fs/inode.c Thu Oct 23 13:30:18 1997 @@ -7,6 +7,7 @@ #include #include #include +#include /* * New inode.c implementation. @@ -18,6 +19,9 @@ * Famous last words. */ +#define INODE_PARANOIA 1 +/* #define INODE_DEBUG 1 */ + /* * Inode lookup is no longer as critical as it used to be: * most of the lookups are going to be through the dcache. @@ -51,13 +55,14 @@ spinlock_t inode_lock = SPIN_LOCK_UNLOCKED; /* - * Statistics gathering.. Not actually done yet. + * Statistics gathering.. */ struct { int nr_inodes; int nr_free_inodes; - int dummy[10]; -} inodes_stat; + int preshrink; /* pre-shrink dcache? */ + int dummy[4]; +} inodes_stat = {0, 0, 0,}; int max_inodes = NR_INODE; @@ -138,8 +143,11 @@ __wait_on_inode(inode); spin_lock(&inode_lock); } else { + struct list_head *insert = &inode_in_use; + if (!inode->i_count) + insert = inode_in_use.prev; list_del(&inode->i_list); - list_add(&inode->i_list, &inode_in_use); + list_add(&inode->i_list, insert); /* Set I_LOCK, reset I_DIRTY */ inode->i_state ^= I_DIRTY | I_LOCK; @@ -196,7 +204,7 @@ if (sb) { spin_lock(&inode_lock); - if (inode->i_state & I_DIRTY) + while (inode->i_state & I_DIRTY) sync_one(inode); spin_unlock(&inode_lock); } @@ -307,6 +315,9 @@ * the in-use for the specified number of freeable inodes. * Freeable inodes are moved to a temporary list and then * placed on the unused list by dispose_list. + * + * Note that we do not expect to have to search very hard: + * the freeable inodes will be at the old end of the list. * * N.B. The spinlock is released to call dispose_list. */ @@ -314,18 +325,15 @@ (((inode)->i_count == 0) && \ (!(inode)->i_state)) -static void try_to_free_inodes(int goal) +static int free_inodes(int goal) { - struct list_head * tmp; - struct list_head *head = &inode_in_use; + struct list_head *tmp, *head = &inode_in_use; LIST_HEAD(freeable); - int found = 0, search = goal << 1; - - while ((tmp = head->prev) != head && search--) { - struct inode * inode; + int found = 0, depth = goal << 1; + while ((tmp = head->prev) != head && depth--) { + struct inode * inode = list_entry(tmp, struct inode, i_list); list_del(tmp); - inode = list_entry(tmp, struct inode, i_list); if (CAN_UNUSE(inode)) { list_del(&inode->i_hash); INIT_LIST_HEAD(&inode->i_hash); @@ -336,18 +344,61 @@ } list_add(tmp, head); } + if (found) { + spin_unlock(&inode_lock); + dispose_list(&freeable); + spin_lock(&inode_lock); + } + return found; +} + +/* + * Searches the inodes list for freeable inodes, + * possibly shrinking the dcache before or after. + */ +static void try_to_free_inodes(int goal) +{ + int retried = 0, found; + + /* + * Check whether to preshrink the dcache ... + */ + if (inodes_stat.preshrink) { + spin_unlock(&inode_lock); + select_dcache(goal, 0); + prune_dcache(goal); + spin_lock(&inode_lock); + } + +repeat: + found = free_inodes(goal); + /* * If we didn't free any inodes, do a limited * pruning of the dcache to help the next time. */ - spin_unlock(&inode_lock); - if (found) - dispose_list(&freeable); - else + if (!found) { + spin_unlock(&inode_lock); + select_dcache(goal, 0); prune_dcache(goal); + spin_lock(&inode_lock); + if (inodes_stat.preshrink && !retried++) + goto repeat; + } +} + +/* + * This is the externally visible routine for + * inode memory management. + */ +void free_inode_memory(int goal) +{ spin_lock(&inode_lock); + free_inodes(goal); + spin_unlock(&inode_lock); } +#define INODES_PER_PAGE PAGE_SIZE/sizeof(struct inode) /* * This is called with the spinlock held, but releases * the lock when freeing or allocating inodes. @@ -358,27 +409,6 @@ { struct inode * inode; - /* - * Check whether to shrink the dcache ... if we've - * allocated more than half of the nominal maximum, - * try shrinking before allocating more. - */ - if (inodes_stat.nr_inodes >= (max_inodes >> 1)) { - struct list_head * tmp; - - spin_unlock(&inode_lock); - prune_dcache(128); - spin_lock(&inode_lock); - try_to_free_inodes(128); - tmp = inode_unused.next; - if (tmp != &inode_unused) { - inodes_stat.nr_free_inodes--; - list_del(tmp); - inode = list_entry(tmp, struct inode, i_list); - return inode; - } - } - spin_unlock(&inode_lock); inode = (struct inode *)__get_free_page(GFP_KERNEL); if (inode) { @@ -392,13 +422,42 @@ tmp++; init_once(tmp); list_add(&tmp->i_list, &inode_unused); - inodes_stat.nr_free_inodes++; size -= sizeof(struct inode); } while (size >= 0); init_once(inode); - inodes_stat.nr_inodes += PAGE_SIZE / sizeof(struct inode); + /* + * Update the inode statistics + */ + inodes_stat.nr_inodes += INODES_PER_PAGE; + inodes_stat.nr_free_inodes += INODES_PER_PAGE - 1; + inodes_stat.preshrink = 0; + if (inodes_stat.nr_inodes > max_inodes) + inodes_stat.preshrink = 1; + return inode; } - return inode; + + /* + * If the allocation failed, do an extensive pruning of + * the dcache and then try again to free some inodes. + */ + prune_dcache(128); + inodes_stat.preshrink = 1; + + spin_lock(&inode_lock); + free_inodes(128); + { + struct list_head *tmp = inode_unused.next; + if (tmp != &inode_unused) { + inodes_stat.nr_free_inodes--; + list_del(tmp); + inode = list_entry(tmp, struct inode, i_list); + return inode; + } + } + spin_unlock(&inode_lock); + + printk("grow_inodes: allocation failed\n"); + return NULL; } /* @@ -627,6 +686,18 @@ list_add(&inode->i_list, &inode_unused); inodes_stat.nr_free_inodes++; } + else if (!(inode->i_state & I_DIRTY)) { + list_del(&inode->i_list); + list_add(&inode->i_list, inode_in_use.prev); + } +#ifdef INODE_PARANOIA +if (inode->i_count) +printk("iput: device %s inode %ld count changed, count=%d\n", +kdevname(inode->i_dev), inode->i_ino, inode->i_count); +if (atomic_read(&inode->i_sem.count) != 1) +printk("iput: Aieee, semaphore in use device %s, count=%d\n", +kdevname(inode->i_dev), atomic_read(&inode->i_sem.count)); +#endif } if (inode->i_count > (1<<15)) { printk("iput: device %s inode %ld count wrapped\n", diff -u --recursive --new-file v2.1.59/linux/fs/isofs/Makefile linux/fs/isofs/Makefile --- v2.1.59/linux/fs/isofs/Makefile Tue Aug 15 05:07:02 1995 +++ linux/fs/isofs/Makefile Thu Oct 23 14:00:15 1997 @@ -9,6 +9,11 @@ O_TARGET := isofs.o O_OBJS := namei.o inode.o file.o dir.o util.o rock.o symlink.o + +ifdef CONFIG_JOLIET +O_OBJS += joliet.o +endif + M_OBJS := $(O_TARGET) include $(TOPDIR)/Rules.make diff -u --recursive --new-file v2.1.59/linux/fs/isofs/dir.c linux/fs/isofs/dir.c --- v2.1.59/linux/fs/isofs/dir.c Thu Sep 11 09:02:23 1997 +++ linux/fs/isofs/dir.c Thu Oct 23 14:00:15 1997 @@ -102,15 +102,14 @@ unsigned int block, offset; int inode_number; struct buffer_head *bh; - int len, rrflag; + int len; + int map; int high_sierra = 0; - char *name; + char *p = NULL; /* Quiet GCC */ struct iso_directory_record *de; - if( filp->f_pos >= inode->i_size ) { - return 0; - - } + if (filp->f_pos >= inode->i_size) + return 0; offset = filp->f_pos & (bufsize - 1); block = isofs_bmap(inode, filp->f_pos >> bufbits); @@ -141,15 +140,19 @@ CDROM sector. If we are at the end of the directory, we kick out of the while loop. */ - if ((de_len == 0) || (offset == bufsize) ) { + if ((de_len == 0) || (offset >= bufsize) ) { brelse(bh); - filp->f_pos = ((filp->f_pos & ~(ISOFS_BLOCK_SIZE - 1)) - + ISOFS_BLOCK_SIZE); - offset = 0; - if( filp->f_pos >= inode->i_size ) - { - return 0; - } + if (de_len == 0) { + filp->f_pos = ((filp->f_pos & ~(ISOFS_BLOCK_SIZE - 1)) + + ISOFS_BLOCK_SIZE); + offset = 0; + } else { + offset -= bufsize; + filp->f_pos += offset; + } + + if (filp->f_pos >= inode->i_size) + return 0; block = isofs_bmap(inode, (filp->f_pos) >> bufbits); if (!block) @@ -181,6 +184,8 @@ continue; } + len = 0; + /* Handle the case of the '..' directory */ if (de->name_len[0] == 1 && de->name[0] == 1) { inode_number = filp->f_dentry->d_parent->d_inode->i_ino; @@ -192,7 +197,6 @@ /* Handle everything else. Do name translation if there is no Rock Ridge NM field. */ - if (inode->i_sb->u.isofs_sb.s_unhide == 'n') { /* Do not report hidden or associated files */ high_sierra = inode->i_sb->u.isofs_sb.s_high_sierra; @@ -202,34 +206,35 @@ } } - /* Check Rock Ridge name translation.. */ - len = de->name_len[0]; - name = de->name; - rrflag = get_rock_ridge_filename(de, &name, &len, inode); - if (rrflag) { - /* rrflag == 1 means that we have a new name (kmalloced) */ - if (rrflag == 1) { - rrflag = filldir(dirent, name, len, filp->f_pos, inode_number); - kfree(name); /* this was allocated in get_r_r_filename.. */ - if (rrflag < 0) - break; + if (inode->i_sb->u.isofs_sb.s_joliet_level) { + len = get_joliet_filename(de, inode, tmpname); + p = tmpname; + } else { + map = 1; + if (inode->i_sb->u.isofs_sb.s_rock) { + len = get_rock_ridge_filename(de, tmpname, inode); + if (len != 0) { + p = tmpname; + map = 0; + } + } + if (map) { + if (inode->i_sb->u.isofs_sb.s_mapping == 'n') { + len = isofs_name_translate(de->name, de->name_len[0], + tmpname); + p = tmpname; + } else { + p = de->name; + len = de->name_len[0]; + } } - filp->f_pos += de_len; - continue; } - - if (inode->i_sb->u.isofs_sb.s_mapping == 'n') { - len = isofs_name_translate(name, len, tmpname); - if (filldir(dirent, tmpname, len, filp->f_pos, inode_number) < 0) + if (len > 0) { + if (filldir(dirent, p, len, filp->f_pos, inode_number) < 0) break; - filp->f_pos += de_len; - continue; } - - if (filldir(dirent, name, len, filp->f_pos, inode_number) < 0) - break; - filp->f_pos += de_len; + continue; } brelse(bh); @@ -255,7 +260,7 @@ tmpname = (char *) __get_free_page(GFP_KERNEL); if (!tmpname) return -ENOMEM; - tmpde = (struct iso_directory_record *) (tmpname+256); + tmpde = (struct iso_directory_record *) (tmpname+1024); result = do_isofs_readdir(inode, filp, dirent, filldir, tmpname, tmpde); diff -u --recursive --new-file v2.1.59/linux/fs/isofs/inode.c linux/fs/isofs/inode.c --- v2.1.59/linux/fs/isofs/inode.c Mon Aug 11 14:47:05 1997 +++ linux/fs/isofs/inode.c Thu Oct 23 14:00:15 1997 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -40,6 +41,12 @@ void isofs_put_super(struct super_block *sb) { +#ifdef CONFIG_JOLIET + if (sb->u.isofs_sb.s_nls_iocharset) { + unload_nls(sb->u.isofs_sb.s_nls_iocharset); + sb->u.isofs_sb.s_nls_iocharset = NULL; + } +#endif lock_super(sb); #ifdef LEAK_CHECK @@ -67,6 +74,7 @@ struct iso9660_options{ char map; char rock; + char joliet; char cruft; char unhide; unsigned char check; @@ -75,14 +83,18 @@ mode_t mode; gid_t gid; uid_t uid; + char *iocharset; + unsigned char utf8; }; static int parse_options(char *options, struct iso9660_options * popt) { - char *this_char,*value; + char *this_char,*value,*p; + int len; popt->map = 'n'; popt->rock = 'y'; + popt->joliet = 'y'; popt->cruft = 'n'; popt->unhide = 'n'; popt->check = 's'; /* default: strict */ @@ -94,12 +106,18 @@ a valid executable. */ popt->gid = 0; popt->uid = 0; + popt->iocharset = NULL; + popt->utf8 = 0; if (!options) return 1; for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) { if (strncmp(this_char,"norock",6) == 0) { popt->rock = 'n'; continue; } + if (strncmp(this_char,"nojoliet",8) == 0) { + popt->joliet = 'n'; + continue; + } if (strncmp(this_char,"unhide",6) == 0) { popt->unhide = 'y'; continue; @@ -108,8 +126,28 @@ popt->cruft = 'y'; continue; } + if (strncmp(this_char,"utf8",4) == 0) { + popt->utf8 = 1; + continue; + } if ((value = strchr(this_char,'=')) != NULL) *value++ = 0; + +#ifdef CONFIG_JOLIET + if (!strcmp(this_char,"iocharset")) { + p = value; + while (*value && *value != ',') value++; + len = value - p; + if (len) { + popt->iocharset = kmalloc(len+1, GFP_KERNEL); + memcpy(popt->iocharset, p, len); + popt->iocharset[len] = 0; + } else { + popt->iocharset = NULL; + return 0; + } + } else +#endif if (!strcmp(this_char,"map") && value) { if (value[0] && !value[1] && strchr("on",*value)) popt->map = *value; @@ -234,10 +272,13 @@ struct hs_primary_descriptor * h_pri = NULL; int high_sierra; int iso_blknum; + int joliet_level = 0; struct iso9660_options opt; int orig_zonesize; + char * p; struct iso_primary_descriptor * pri = NULL; struct iso_directory_record * rootp; + struct iso_supplementary_descriptor *sec = NULL; struct iso_volume_descriptor * vdp; unsigned int vol_desc_start; @@ -254,6 +295,7 @@ #if 0 printk("map = %c\n", opt.map); printk("rock = %c\n", opt.rock); + printk("joliet = %c\n", opt.joliet); printk("check = %c\n", opt.check); printk("cruft = %c\n", opt.cruft); printk("unhide = %c\n", opt.unhide); @@ -297,57 +339,91 @@ vol_desc_start = isofs_get_last_session(dev); - for (iso_blknum = vol_desc_start+16; - iso_blknum < vol_desc_start+100; iso_blknum++) { - int b = iso_blknum << (ISOFS_BLOCK_BITS-blocksize_bits); - - if (!(bh = bread(dev,b,opt.blocksize))) { - s->s_dev = 0; - printk("isofs_read_super: bread failed, dev " - "%s iso_blknum %d block %d\n", - kdevname(dev), iso_blknum, b); - unlock_super(s); - MOD_DEC_USE_COUNT; - return NULL; - } - - vdp = (struct iso_volume_descriptor *)bh->b_data; - hdp = (struct hs_volume_descriptor *)bh->b_data; - - - if (strncmp (hdp->id, HS_STANDARD_ID, sizeof hdp->id) == 0) { - if (isonum_711 (hdp->type) != ISO_VD_PRIMARY) - goto out; - if (isonum_711 (hdp->type) == ISO_VD_END) - goto out; - - s->u.isofs_sb.s_high_sierra = 1; - high_sierra = 1; - opt.rock = 'n'; - h_pri = (struct hs_primary_descriptor *)vdp; - break; - } - - if (strncmp (vdp->id, ISO_STANDARD_ID, sizeof vdp->id) == 0) { - if (isonum_711 (vdp->type) != ISO_VD_PRIMARY) - goto out; - if (isonum_711 (vdp->type) == ISO_VD_END) - goto out; - - pri = (struct iso_primary_descriptor *)vdp; - break; - } + for (iso_blknum = vol_desc_start+16; + iso_blknum < vol_desc_start+100; iso_blknum++) + { + int b = iso_blknum << (ISOFS_BLOCK_BITS-blocksize_bits); - brelse(bh); - } - if(iso_blknum == vol_desc_start + 100) { - if (!silent) - printk("Unable to identify CD-ROM format.\n"); + if (!(bh = bread(dev,b,opt.blocksize))) { s->s_dev = 0; + printk("isofs_read_super: bread failed, dev " + "%s iso_blknum %d block %d\n", + kdevname(dev), iso_blknum, b); unlock_super(s); MOD_DEC_USE_COUNT; return NULL; + } + + vdp = (struct iso_volume_descriptor *)bh->b_data; + hdp = (struct hs_volume_descriptor *)bh->b_data; + + if (strncmp (hdp->id, HS_STANDARD_ID, sizeof hdp->id) == 0) { + if (isonum_711 (hdp->type) != ISO_VD_PRIMARY) + goto out; + if (isonum_711 (hdp->type) == ISO_VD_END) + goto out; + + s->u.isofs_sb.s_high_sierra = 1; + high_sierra = 1; + opt.rock = 'n'; + h_pri = (struct hs_primary_descriptor *)vdp; + break; + } + + if (strncmp (vdp->id, ISO_STANDARD_ID, sizeof vdp->id) == 0) { + if (isonum_711 (vdp->type) == ISO_VD_END) + break; + if (isonum_711 (vdp->type) == ISO_VD_PRIMARY) { + if (pri == NULL) { + pri = (struct iso_primary_descriptor *)vdp; + } +#ifdef CONFIG_JOLIET + } else if (isonum_711 (vdp->type) == ISO_VD_SUPPLEMENTARY) { + sec = (struct iso_supplementary_descriptor *)vdp; + if (sec->escape[0] == 0x25 && sec->escape[1] == 0x2f) { + if (opt.joliet == 'y') { + opt.rock = 'n'; + if (sec->escape[2] == 0x40) { + joliet_level = 1; + } else if (sec->escape[2] == 0x43) { + joliet_level = 2; + } else if (sec->escape[2] == 0x45) { + joliet_level = 3; + } + printk("ISO9660 Extensions: Microsoft Joliet Level %d\n", + joliet_level); + } + break; + } else { + /* Unknown supplementary volume descriptor */ + sec = NULL; + } +#endif + } + /* Just skip any volume descriptors we don't recognize */ + } + + brelse(bh); + } + if ((pri == NULL) && (sec == NULL) && (h_pri == NULL)) { + if (!silent) + printk("Unable to identify CD-ROM format.\n"); + s->s_dev = 0; + unlock_super(s); + MOD_DEC_USE_COUNT; + return NULL; + } +#ifdef CONFIG_JOLIET + s->u.isofs_sb.s_joliet_level = joliet_level; + if (joliet_level) { + /* Note: In theory, it is possible to have Rock Ridge + * extensions mixed with Joliet. All character strings + * would just be saved as Unicode. Until someone sees such + * a disc, do not allow the two to be mixed + */ + pri = (struct iso_primary_descriptor *) sec; } +#endif if(high_sierra){ rootp = (struct iso_directory_record *) h_pri->root_directory_record; @@ -465,6 +541,27 @@ printk(KERN_DEBUG "Forcing new log zone size:%d\n", opt.blocksize); } +#ifdef CONFIG_JOLIET + s->u.isofs_sb.s_nls_iocharset = NULL; + if (joliet_level == 0) { + if (opt.iocharset) { + kfree(opt.iocharset); + opt.iocharset = NULL; + } + } else if (opt.utf8 == 0) { + p = opt.iocharset ? opt.iocharset : "iso8859-1"; + s->u.isofs_sb.s_nls_iocharset = load_nls(p); + if (! s->u.isofs_sb.s_nls_iocharset) { + /* Fail only if explicit charset specified */ + if (opt.iocharset) { + kfree(opt.iocharset); + goto out; + } else { + s->u.isofs_sb.s_nls_iocharset = load_nls_default(); + } + } + } +#endif s->s_dev = dev; s->s_op = &isofs_sops; s->u.isofs_sb.s_mapping = opt.map; @@ -475,6 +572,7 @@ s->u.isofs_sb.s_unhide = opt.unhide; s->u.isofs_sb.s_uid = opt.uid; s->u.isofs_sb.s_gid = opt.gid; + s->u.isofs_sb.s_utf8 = opt.utf8; /* * It would be incredibly stupid to allow people to mark every file on the disk * as suid, so we merely allow them to set the default permissions. @@ -490,13 +588,24 @@ if (!(s->s_root)) { s->s_dev = 0; printk("get root inode failed\n"); +#ifdef CONFIG_JOLIET + if (s->u.isofs_sb.s_nls_iocharset) + unload_nls(s->u.isofs_sb.s_nls_iocharset); + if (opt.iocharset) kfree(opt.iocharset); +#endif MOD_DEC_USE_COUNT; return NULL; } if(!check_disk_change(s->s_dev)) { - return s; + return s; } +#ifdef CONFIG_JOLIET + if (s->u.isofs_sb.s_nls_iocharset) + unload_nls(s->u.isofs_sb.s_nls_iocharset); +#endif + if (opt.iocharset) kfree(opt.iocharset); + out: /* Kick out for various error conditions */ brelse(bh); s->s_dev = 0; diff -u --recursive --new-file v2.1.59/linux/fs/isofs/joliet.c linux/fs/isofs/joliet.c --- v2.1.59/linux/fs/isofs/joliet.c Wed Dec 31 16:00:00 1969 +++ linux/fs/isofs/joliet.c Thu Oct 23 14:08:03 1997 @@ -0,0 +1,110 @@ +/* + * linux/fs/isofs/joliet.c + * + * (C) 1996 Gordon Chaffee + * + * Joliet: Microsoft's Unicode extensions to iso9660 + */ + +#include +#include +#include +#include + +/* + * Convert Unicode 16 to UTF8 or ascii. + */ +static int +uni16_to_x8(unsigned char *ascii, unsigned char *uni, int len, + struct nls_table *nls) +{ + unsigned char *ip, *op; + unsigned char ch, cl; + unsigned char *uni_page; + + ip = uni; + op = ascii; + + while ((*ip || ip[1]) && len) { + ch = *ip++; + cl = *ip++; + + uni_page = nls->page_uni2charset[ch]; + if (uni_page && uni_page[cl]) { + *op++ = uni_page[cl]; + } else { + *op++ = '?'; + } + len--; + } + *op = 0; + return (op - ascii); +} + +/* Convert big endian wide character string to utf8 */ +static int +wcsntombs_be(__u8 *s, const __u8 *pwcs, int inlen, int maxlen) +{ + const __u8 *ip; + __u8 *op; + int size; + __u16 c; + + op = s; + ip = pwcs; + while ((*ip || ip[1]) && (maxlen > 0) && (inlen > 0)) { + c = (*ip << 8) | ip[1]; + if (c > 0x7f) { + size = utf8_wctomb(op, c, maxlen); + if (size == -1) { + /* Ignore character and move on */ + maxlen--; + } else { + op += size; + maxlen -= size; + } + } else { + *op++ = (__u8) c; + } + ip += 2; + inlen--; + } + return (op - s); +} + +int +get_joliet_filename(struct iso_directory_record * de, struct inode * inode, + unsigned char *outname) +{ + unsigned char utf8; + struct nls_table *nls; + unsigned char len = 0; + int i; + char c; + + utf8 = inode->i_sb->u.isofs_sb.s_utf8; + nls = inode->i_sb->u.isofs_sb.s_nls_iocharset; + + if (utf8) { + len = wcsntombs_be(outname, de->name, + de->name_len[0] >> 1, PAGE_SIZE); + } else { + len = uni16_to_x8(outname, de->name, + de->name_len[0] >> 1, nls); + } + if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) { + len -= 2; + } + + if (inode->i_sb->u.isofs_sb.s_name_check == 'r') { + for (i = 0; i < len; i++) { + c = outname[i]; + /* lower case */ + if (c >= 'A' && c <= 'Z') c |= 0x20; + if (c == ';') c = '.'; + outname[i] = c; + } + } + + return len; +} diff -u --recursive --new-file v2.1.59/linux/fs/isofs/namei.c linux/fs/isofs/namei.c --- v2.1.59/linux/fs/isofs/namei.c Mon Aug 18 18:19:46 1997 +++ linux/fs/isofs/namei.c Thu Oct 23 14:08:47 1997 @@ -12,10 +12,11 @@ #include #include #include -#include #include - #include +#include /* Joliet? */ + +#include /* * ok, we cannot use strncmp, as the name is not in our data space. @@ -67,8 +68,9 @@ inode_number = 0; /* shut gcc up */ struct buffer_head * bh; unsigned int old_offset; - int dlen, rrflag, match; + int dlen, match; char * dpnt; + unsigned char *page = NULL; struct iso_directory_record * de = NULL; /* shut gcc up */ char de_not_in_buf = 0; /* true if de is in kmalloc'd memory */ char c; @@ -92,9 +94,8 @@ if(!de_not_in_buf) { de = (struct iso_directory_record *) (bh->b_data + offset); - inode_number = (block << bufbits) - + (offset & (bufsize - 1)); } + inode_number = (block << bufbits) + (offset & (bufsize - 1)); /* If byte is zero, or we had to fetch this de past the end of the buffer, this is the end of file, or @@ -109,22 +110,22 @@ one */ de_not_in_buf = 0; kfree(de); - offset -= bufsize; + f_pos += offset; } - else + else { offset = 0; + f_pos = ((f_pos & ~(ISOFS_BLOCK_SIZE - 1)) + + ISOFS_BLOCK_SIZE); + } brelse(bh); - f_pos = ((f_pos & ~(ISOFS_BLOCK_SIZE - 1)) - + ISOFS_BLOCK_SIZE) + offset; - if( f_pos >= dir->i_size ) - { - return 0; - } + if (f_pos >= dir->i_size) + return 0; block = isofs_bmap(dir,f_pos>>bufbits); if (!block || !(bh = bread(dir->i_dev,block,bufsize))) - return 0; + return NULL; + continue; /* Will kick out if past end of directory */ } @@ -154,31 +155,44 @@ bh_next->b_data, offset - bufsize); brelse(bh_next); de_not_in_buf = 1; + offset -= bufsize; } - dlen = de->name_len[0]; dpnt = de->name; - /* Now convert the filename in the buffer to lower case */ - rrflag = get_rock_ridge_filename(de, &dpnt, &dlen, dir); - if (rrflag) { - if (rrflag == -1) goto out; /* Relocated deep directory */ - } else { - if(dir->i_sb->u.isofs_sb.s_mapping == 'n') { - for (i = 0; i < dlen; i++) { - c = dpnt[i]; - if (c >= 'A' && c <= 'Z') c |= 0x20; /* lower case */ - if (c == ';' && i == dlen-2 && dpnt[i+1] == '1') { - dlen -= 2; - break; - } - if (c == ';') c = '.'; - de->name[i] = c; - } - /* This allows us to match with and without a trailing - period. */ - if(dpnt[dlen-1] == '.' && namelen == dlen-1) - dlen--; - } + + if (dir->i_sb->u.isofs_sb.s_rock || + dir->i_sb->u.isofs_sb.s_joliet_level) { + page = (unsigned char *) + __get_free_page(GFP_KERNEL); + if (!page) return NULL; + } + if (dir->i_sb->u.isofs_sb.s_rock && + ((i = get_rock_ridge_filename(de, page, dir)))) { + if (i == -1) + goto out;/* Relocated deep directory */ + dlen = i; + dpnt = page; +#ifdef CONFIG_JOLIET + } else if (dir->i_sb->u.isofs_sb.s_joliet_level) { + dlen = get_joliet_filename(de, dir, page); + dpnt = page; +#endif + } else if (dir->i_sb->u.isofs_sb.s_mapping == 'n') { + for (i = 0; i < dlen; i++) { + c = dpnt[i]; + /* lower case */ + if (c >= 'A' && c <= 'Z') c |= 0x20; + if (c == ';' && i == dlen-2 && dpnt[i+1] == '1') { + dlen -= 2; + break; + } + if (c == ';') c = '.'; + dpnt[i] = c; + } + /* This allows us to match with and without + * a trailing period. */ + if(dpnt[dlen-1] == '.' && namelen == dlen-1) + dlen--; } /* * Skip hidden or associated files unless unhide is set @@ -190,7 +204,7 @@ match = isofs_match(namelen,name,dpnt,dlen); } - if(rrflag) kfree(dpnt); + if (page) free_page((unsigned long) page); if (match) { if(inode_number == -1) { /* Should only happen for the '..' entry */ diff -u --recursive --new-file v2.1.59/linux/fs/isofs/rock.c linux/fs/isofs/rock.c --- v2.1.59/linux/fs/isofs/rock.c Mon May 19 12:57:39 1997 +++ linux/fs/isofs/rock.c Thu Oct 23 14:00:15 1997 @@ -153,15 +153,16 @@ } int get_rock_ridge_filename(struct iso_directory_record * de, - char ** name, int * namlen, struct inode * inode) + char * retname, struct inode * inode) { int len; unsigned char * chr; CONTINUE_DECLS; - char * retname = NULL; int retnamlen = 0, truncate=0; if (!inode->i_sb->u.isofs_sb.s_rock) return 0; + *retname = 0; + retnamlen = 0; SETUP_ROCK_RIDGE(de, chr, len); repeat: @@ -203,18 +204,6 @@ printk("Unsupported NM flag settings (%d)\n",rr->u.NM.flags); break; }; - if (!retname){ - retname = (char *) kmalloc (255,GFP_KERNEL); - /* This may be a waste, but we only - need this for a moment. The layers - that call this function should - deallocate the mem fairly soon - after control is returned */ - - if (!retname) goto out; - *retname = 0; /* Zero length string */ - retnamlen = 0; - }; if((strlen(retname) + rr->len - 5) >= 254) { truncate = 1; break; @@ -227,7 +216,6 @@ printk("RR: RE (%x)\n", inode->i_ino); #endif if (buffer) kfree(buffer); - if (retname) kfree(retname); return -1; default: break; @@ -235,15 +223,9 @@ }; } MAYBE_CONTINUE(repeat,inode); - if(retname){ - *name = retname; - *namlen = retnamlen; - return 1; - }; - return 0; /* This file did not have a NM field */ + return retnamlen; /* If 0, this file did not have a NM field */ out: if(buffer) kfree(buffer); - if (retname) kfree(retname); return 0; } diff -u --recursive --new-file v2.1.59/linux/fs/isofs/util.c linux/fs/isofs/util.c --- v2.1.59/linux/fs/isofs/util.c Mon Apr 7 11:35:30 1997 +++ linux/fs/isofs/util.c Thu Oct 23 14:00:15 1997 @@ -9,6 +9,8 @@ * the 386bsd iso9660 filesystem, by Pace Willisson . */ +#include + int isonum_711 (char * p) { @@ -112,6 +114,8 @@ crtime = 0; } else { int monlen[12] = {31,28,31,30,31,30,31,31,30,31,30,31}; + extern struct timezone sys_tz; + days = year * 365; if (year > 2) days += (year+1) / 4; @@ -122,7 +126,9 @@ days += day - 1; crtime = ((((days * 24) + hour) * 60 + minute) * 60) + second; - + if (sys_tz.tz_dsttime) + crtime -= 3600; + /* sign extend */ if (tz & 0x80) tz |= (-1 << 8); diff -u --recursive --new-file v2.1.59/linux/fs/locks.c linux/fs/locks.c --- v2.1.59/linux/fs/locks.c Wed Oct 15 16:04:23 1997 +++ linux/fs/locks.c Tue Oct 21 08:57:29 1997 @@ -503,7 +503,7 @@ } int locks_verify_area(int read_write, struct inode *inode, struct file *filp, - unsigned int offset, unsigned int count) + loff_t offset, size_t count) { /* Candidates for mandatory locking have the setgid bit set * but no group execute bit - an otherwise meaningless combination. @@ -531,8 +531,8 @@ } int locks_mandatory_area(int read_write, struct inode *inode, - struct file *filp, unsigned int offset, - unsigned int count) + struct file *filp, loff_t offset, + size_t count) { struct file_lock *fl; struct file_lock tfl; @@ -1147,9 +1147,9 @@ } static inline int copy_lock_status(char *p, char **q, off_t pos, int len, - off_t offset, int length) + off_t offset, off_t length) { - int i; + off_t i; i = pos - offset; if (i > 0) { @@ -1171,15 +1171,13 @@ return (1); } -int get_locks_status(char *buffer, char **start, off_t offset, int length) +int get_locks_status(char *buffer, char **start, off_t offset, off_t length) { struct file_lock *fl; struct file_lock *bfl; char *p; char *q = buffer; - int i; - int len; - off_t pos = 0; + off_t i, len, pos = 0; for (fl = file_lock_table, i = 1; fl != NULL; fl = fl->fl_nextlink, i++) { p = lock_get_status(fl, i, ""); diff -u --recursive --new-file v2.1.59/linux/fs/minix/dir.c linux/fs/minix/dir.c --- v2.1.59/linux/fs/minix/dir.c Thu Sep 11 09:02:23 1997 +++ linux/fs/minix/dir.c Tue Oct 21 08:57:29 1997 @@ -14,8 +14,8 @@ #include -static long minix_dir_read(struct inode * inode, struct file * filp, - char * buf, unsigned long count) +static ssize_t minix_dir_read(struct file * filp, char * buf, + size_t count, loff_t *ppos) { return -EISDIR; } diff -u --recursive --new-file v2.1.59/linux/fs/minix/file.c linux/fs/minix/file.c --- v2.1.59/linux/fs/minix/file.c Sun Jul 27 12:11:01 1997 +++ linux/fs/minix/file.c Tue Oct 21 08:57:29 1997 @@ -27,7 +27,7 @@ #include #include -static long minix_file_write(struct inode *, struct file *, const char *, unsigned long); +static ssize_t minix_file_write(struct file *, const char *, size_t, loff_t *); /* * We have mostly NULL's here: the current defaults are ok for @@ -66,11 +66,12 @@ NULL /* permission */ }; -static long minix_file_write(struct inode * inode, struct file * filp, - const char * buf, unsigned long count) +static ssize_t minix_file_write(struct file * filp, const char * buf, + size_t count, loff_t *ppos) { + struct inode * inode = filp->f_dentry->d_inode; off_t pos; - int written,c; + ssize_t written, c; struct buffer_head * bh; char * p; @@ -85,7 +86,7 @@ if (filp->f_flags & O_APPEND) pos = inode->i_size; else - pos = filp->f_pos; + pos = *ppos; written = 0; while (written < count) { bh = minix_getblk(inode,pos/BLOCK_SIZE,1); @@ -126,7 +127,7 @@ if (pos > inode->i_size) inode->i_size = pos; inode->i_mtime = inode->i_ctime = CURRENT_TIME; - filp->f_pos = pos; + *ppos = pos; mark_inode_dirty(inode); return written; } diff -u --recursive --new-file v2.1.59/linux/fs/msdos/namei.c linux/fs/msdos/namei.c --- v2.1.59/linux/fs/msdos/namei.c Wed Sep 3 20:52:43 1997 +++ linux/fs/msdos/namei.c Thu Oct 23 14:00:15 1997 @@ -230,6 +230,7 @@ MOD_INC_USE_COUNT; + MSDOS_SB(sb)->options.isvfat = 0; sb->s_op = &msdos_sops; res = fat_read_super(sb, data, silent); if (res == NULL) { @@ -317,7 +318,9 @@ *result = NULL; if ((res = fat_scan(dir,NULL,&bh,&de,&ino,SCAN_ANY)) < 0) { if (res != -ENOENT) return res; - if (dir->i_ino == MSDOS_ROOT_INO) return -ENOSPC; + if ((dir->i_ino == MSDOS_ROOT_INO) && + (MSDOS_SB(sb)->fat_bits != 32)) + return -ENOSPC; if ((res = fat_add_cluster(dir)) < 0) return res; if ((res = fat_scan(dir,NULL,&bh,&de,&ino,SCAN_ANY)) < 0) return res; } @@ -327,10 +330,10 @@ dir->i_ctime = dir->i_mtime = CURRENT_TIME; mark_inode_dirty(dir); memcpy(de->name,name,MSDOS_NAME); - memset(de->unused, 0, sizeof(de->unused)); de->attr = is_dir ? ATTR_DIR : ATTR_ARCH; de->attr = is_hid ? (de->attr|ATTR_HIDDEN) : (de->attr&~ATTR_HIDDEN); de->start = 0; + de->starthi = 0; fat_date_unix2dos(dir->i_mtime,&de->time,&de->date); de->size = 0; fat_mark_buffer_dirty(sb, bh, 1); @@ -502,6 +505,7 @@ goto mkdir_error; dot->i_size = inode->i_size; /* doesn't grow in the 2nd create_entry */ MSDOS_I(dot)->i_start = MSDOS_I(inode)->i_start; + MSDOS_I(dot)->i_logstart = MSDOS_I(inode)->i_logstart; dot->i_nlink = inode->i_nlink; mark_inode_dirty(dot); iput(dot); @@ -510,6 +514,7 @@ fat_unlock_creation(); dot->i_size = dir->i_size; MSDOS_I(dot)->i_start = MSDOS_I(dir)->i_start; + MSDOS_I(dot)->i_logstart = MSDOS_I(dir)->i_logstart; dot->i_nlink = dir->i_nlink; mark_inode_dirty(dot); MSDOS_I(inode)->i_busy = 0; @@ -737,8 +742,10 @@ error = -EIO; goto rename_done; } - dotdot_de->start = MSDOS_I(dotdot_inode)->i_start = - MSDOS_I(new_dir)->i_start; + MSDOS_I(dotdot_inode)->i_start = MSDOS_I(new_dir)->i_start; + MSDOS_I(dotdot_inode)->i_logstart = MSDOS_I(new_dir)->i_logstart; + dotdot_de->start = CT_LE_W(MSDOS_I(new_dir)->i_logstart); + dotdot_de->starthi = CT_LE_W((MSDOS_I(new_dir)->i_logstart) >> 16); mark_inode_dirty(dotdot_inode); fat_mark_buffer_dirty(sb, dotdot_bh, 1); old_dir->i_nlink--; diff -u --recursive --new-file v2.1.59/linux/fs/namei.c linux/fs/namei.c --- v2.1.59/linux/fs/namei.c Wed Oct 15 16:04:23 1997 +++ linux/fs/namei.c Thu Oct 23 13:30:21 1997 @@ -448,6 +448,7 @@ char *name; struct dentry *dentry; + check_dcache_memory(); name = getname(pathname); dentry = (struct dentry *) name; if (!IS_ERR(name)) { @@ -521,6 +522,7 @@ struct inode *inode; struct dentry *dentry; + check_dcache_memory(); mode &= S_IALLUGO & ~current->fs->umask; mode |= S_IFREG; diff -u --recursive --new-file v2.1.59/linux/fs/nfs/dir.c linux/fs/nfs/dir.c --- v2.1.59/linux/fs/nfs/dir.c Mon Oct 20 10:36:52 1997 +++ linux/fs/nfs/dir.c Tue Oct 21 08:57:29 1997 @@ -52,7 +52,7 @@ }; static int nfs_dir_open(struct inode * inode, struct file * file); -static long nfs_dir_read(struct inode *, struct file *, char *, unsigned long); +static ssize_t nfs_dir_read(struct file *, char *, size_t, loff_t *); static int nfs_readdir(struct file *, void *, filldir_t); static int nfs_lookup(struct inode *, struct dentry *); static int nfs_create(struct inode *, struct dentry *, int); @@ -107,8 +107,8 @@ return nfs_revalidate_inode(NFS_SERVER(dir), dir); } -static long -nfs_dir_read(struct inode *inode, struct file *filp, char *buf, unsigned long count) +static ssize_t +nfs_dir_read(struct file *filp, char *buf, size_t count, loff_t *ppos) { return -EISDIR; } @@ -317,7 +317,7 @@ continue; if (cache->locked) { printk("NFS: cache locked for %s/%ld\n", - kdevname(dev), ino); + kdevname(dev), (long) ino); continue; } cache->valid = 0; /* brute force */ diff -u --recursive --new-file v2.1.59/linux/fs/nfs/file.c linux/fs/nfs/file.c --- v2.1.59/linux/fs/nfs/file.c Wed Sep 24 20:05:48 1997 +++ linux/fs/nfs/file.c Tue Oct 21 08:57:29 1997 @@ -33,9 +33,8 @@ #define NFSDBG_FACILITY NFSDBG_FILE static int nfs_file_mmap(struct file *, struct vm_area_struct *); -static long nfs_file_read(struct inode *, struct file *, char *, unsigned long); -static long nfs_file_write(struct inode *, struct file *, - const char *, unsigned long); +static ssize_t nfs_file_read(struct file *, char *, size_t, loff_t *); +static ssize_t nfs_file_write(struct file *, const char *, size_t, loff_t *); static int nfs_file_close(struct inode *, struct file *); static int nfs_fsync(struct file *, struct dentry *dentry); @@ -97,19 +96,19 @@ return nfs_write_error(inode); } -static long -nfs_file_read(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t +nfs_file_read(struct file * file, char * buf, size_t count, loff_t *ppos) { + struct inode * inode = file->f_dentry->d_inode; int status; dfprintk(VFS, "nfs: read(%x/%ld, %lu@%lu)\n", inode->i_dev, inode->i_ino, count, - (unsigned long) file->f_pos); + (unsigned long) *ppos); if ((status = nfs_revalidate_inode(NFS_SERVER(inode), inode)) < 0) return status; - return generic_file_read(inode, file, buf, count); + return generic_file_read(file, buf, count, ppos); } static int @@ -136,15 +135,15 @@ /* * Write to a file (through the page cache). */ -static long -nfs_file_write(struct inode *inode, struct file *file, - const char *buf, unsigned long count) +static ssize_t +nfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos) { + struct inode * inode = file->f_dentry->d_inode; int result; dfprintk(VFS, "nfs: write(%x/%ld (%d), %lu@%lu)\n", inode->i_dev, inode->i_ino, inode->i_count, - count, (unsigned long) file->f_pos); + count, (unsigned long) *ppos); if (!inode) { printk("nfs_file_write: inode = NULL\n"); @@ -168,7 +167,7 @@ if ((result = nfs_write_error(inode)) < 0) return result; - return generic_file_write(inode, file, buf, count); + return generic_file_write(file, buf, count, ppos); } /* diff -u --recursive --new-file v2.1.59/linux/fs/nfs/inode.c linux/fs/nfs/inode.c --- v2.1.59/linux/fs/nfs/inode.c Mon Oct 20 10:36:52 1997 +++ linux/fs/nfs/inode.c Sat Oct 25 02:06:24 1997 @@ -36,13 +36,14 @@ #define NFS_PARANOIA 1 extern void nfs_invalidate_dircache_sb(struct super_block *); +extern int check_failed_request(struct inode *); -static int nfs_notify_change(struct inode *, struct iattr *); +static void nfs_read_inode(struct inode *); static void nfs_put_inode(struct inode *); static void nfs_delete_inode(struct inode *); +static int nfs_notify_change(struct inode *, struct iattr *); static void nfs_put_super(struct super_block *); -static void nfs_read_inode(struct inode *); -static int nfs_statfs(struct super_block *, struct statfs *, int bufsiz); +static int nfs_statfs(struct super_block *, struct statfs *, int); static struct super_operations nfs_sops = { nfs_read_inode, /* read inode */ @@ -91,6 +92,25 @@ nfs_delete_inode(struct inode * inode) { dprintk("NFS: delete_inode(%x/%ld)\n", inode->i_dev, inode->i_ino); + /* + * Flush out any pending write requests ... + */ + if (NFS_WRITEBACK(inode) != NULL) { + unsigned long timeout = jiffies + 5*HZ; + printk("NFS: invalidating pending RPC requests\n"); + nfs_invalidate_pages(inode); + while (NFS_WRITEBACK(inode) != NULL && jiffies < timeout) { + current->state = TASK_UNINTERRUPTIBLE; + current->timeout = jiffies + HZ/10; + schedule(); + } + current->state = TASK_RUNNING; + if (NFS_WRITEBACK(inode) != NULL) + printk("NFS: Arghhh, stuck RPC requests!\n"); + } + + if (check_failed_request(inode)) + printk("NFS: inode had failed requests\n"); clear_inode(inode); } diff -u --recursive --new-file v2.1.59/linux/fs/nfs/write.c linux/fs/nfs/write.c --- v2.1.59/linux/fs/nfs/write.c Mon Oct 20 10:36:52 1997 +++ linux/fs/nfs/write.c Sat Oct 25 02:06:24 1997 @@ -68,6 +68,8 @@ #define NFSDBG_FACILITY NFSDBG_PAGECACHE +int check_failed_request(struct inode *); + static void nfs_wback_lock(struct rpc_task *task); static void nfs_wback_result(struct rpc_task *task); @@ -120,6 +122,7 @@ * Limit number of delayed writes */ static int nr_write_requests = 0; +static int nr_failed_requests = 0; static struct rpc_wait_queue write_queue = RPC_INIT_WAITQ("write_chain"); struct nfs_wreq * nfs_failed_requests = NULL; @@ -282,28 +285,72 @@ /* * Find a failed write request by pid */ -static inline struct nfs_wreq * -find_failed_request(struct inode *inode, pid_t pid) +static struct nfs_wreq * +find_failed_request(struct inode *inode, pid_t pid, int all) { struct nfs_wreq *head, *req; if (!(req = head = nfs_failed_requests)) return NULL; do { - if (req->wb_inode == inode && req->wb_pid == pid) + if (req->wb_inode == inode && (all || req->wb_pid == pid)) return req; } while ((req = WB_NEXT(req)) != head); return NULL; } /* + * Add a request to the failed list. + */ +static void +append_failed_request(struct nfs_wreq * req) +{ + static int old_max = 16; + + append_write_request(&nfs_failed_requests, req); + nr_failed_requests++; + if (nr_failed_requests >= old_max) { + printk("NFS: %d failed requests\n", nr_failed_requests); + old_max = old_max << 1; + } +} + +/* + * Remove a request from the failed list and free it. + */ +static void +remove_failed_request(struct nfs_wreq * req) +{ + remove_write_request(&nfs_failed_requests, req); + kfree(req); + nr_failed_requests--; +} + +/* + * Find and release all failed requests for this inode. + */ +int +check_failed_request(struct inode * inode) +{ + struct nfs_wreq * req; + int found = 0; + + while ((req = find_failed_request(inode, 0, 1)) != NULL) { + remove_failed_request(req); + found++; + } + return found; +} + +/* * Try to merge adjacent write requests. This works only for requests * issued by the same user. */ static inline int -update_write_request(struct nfs_wreq *req, unsigned first, unsigned bytes) +update_write_request(struct nfs_wreq *req, unsigned int first, + unsigned int bytes) { - unsigned rqfirst = req->wb_offset, + unsigned int rqfirst = req->wb_offset, rqlast = rqfirst + req->wb_bytes, last = first + bytes; @@ -335,7 +382,7 @@ */ static inline struct nfs_wreq * create_write_request(struct inode *inode, struct page *page, - unsigned offset, unsigned bytes) + unsigned int offset, unsigned int bytes) { struct nfs_wreq *wreq; struct rpc_clnt *clnt = NFS_CLIENT(inode); @@ -448,9 +495,9 @@ } remove_wait_queue(&page->wait, &wait); current->state = TASK_RUNNING; -if (atomic_read(&page->count) == 1) -printk("NFS: lost a page\n"); - atomic_dec(&page->count); + if (atomic_read(&page->count) == 1) + printk("NFS: page unused while waiting\n"); + free_page(page_address(page)); return retval; } @@ -620,7 +667,7 @@ } /* - * Cancel all writeback requests, both pending and in process. + * Cancel all writeback requests, both pending and in progress. */ static void nfs_cancel_dirty(struct inode *inode, pid_t pid) @@ -650,17 +697,18 @@ nfs_flush_dirty_pages(struct inode *inode, off_t offset, off_t len) { struct nfs_wreq *last = NULL; + int result = 0; dprintk("NFS: flush_dirty_pages(%x/%ld for pid %d %ld/%ld)\n", inode->i_dev, inode->i_ino, current->pid, offset, len); - if (IS_SOFT && signalled()) - nfs_cancel_dirty(inode, current->pid); - for (;;) { - if (IS_SOFT && signalled()) - return -ERESTARTSYS; + if (IS_SOFT && signalled()) { + nfs_cancel_dirty(inode, current->pid); + result = -ERESTARTSYS; + break; + } /* Flush all pending writes for this pid and file region */ last = nfs_flush_pages(inode, current->pid, offset, len, 0); @@ -669,7 +717,7 @@ wait_on_write_request(last); } - return 0; + return result; } /* @@ -732,15 +780,14 @@ dprintk("nfs: checking for write error inode %04x/%ld\n", inode->i_dev, inode->i_ino); - if (!(req = find_failed_request(inode, current->pid))) - return 0; - - dprintk("nfs: write error %d inode %04x/%ld\n", + req = find_failed_request(inode, current->pid, 0); + if (req) { + dprintk("nfs: write error %d inode %04x/%ld\n", req->wb_task.tk_status, inode->i_dev, inode->i_ino); - status = req->wb_task.tk_status; - remove_write_request(&nfs_failed_requests, req); - kfree(req); + status = req->wb_task.tk_status; + remove_failed_request(req); + } return status; } @@ -816,23 +863,14 @@ page = req->wb_page; status = task->tk_status; - /* Remove request from writeback list and wake up tasks - * sleeping on it. */ - remove_write_request(&NFS_WRITEBACK(inode), req); - if (status < 0) { /* * An error occurred. Report the error back to the - * application by adding the failed request to the - * inode's error list. + * application by adding the request to the failed + * requests list. */ - if (find_failed_request(inode, req->wb_pid)) { + if (find_failed_request(inode, req->wb_pid, 0)) status = 0; - } else { - dprintk("NFS: %4d saving write failure code\n", - task->tk_pid); - append_write_request(&nfs_failed_requests, req); - } clear_bit(PG_uptodate, &page->flags); } else if (!WB_CANCELLED(req)) { struct nfs_fattr *fattr = req->wb_fattr; @@ -860,6 +898,10 @@ } } + /* + * This call might block, so we defer removing the request + * from the inode's writeback list. + */ rpc_release_task(task); if (WB_INVALIDATE(req)) @@ -871,8 +913,20 @@ kfree(req->wb_args); req->wb_args = 0; } + + /* + * Now it's safe to remove the request from the inode's + * writeback list and wake up any tasks sleeping on it. + * If the request failed, add it to the failed list. + */ + remove_write_request(&NFS_WRITEBACK(inode), req); + if (status >= 0) kfree(req); + else { + dprintk("NFS: %4d saving write failure code\n", task->tk_pid); + append_failed_request(req); + } free_page(page_address(page)); nr_write_requests--; diff -u --recursive --new-file v2.1.59/linux/fs/nfsd/vfs.c linux/fs/nfsd/vfs.c --- v2.1.59/linux/fs/nfsd/vfs.c Tue Sep 23 16:48:49 1997 +++ linux/fs/nfsd/vfs.c Tue Oct 21 08:57:29 1997 @@ -364,7 +364,7 @@ file.f_pos = offset; oldfs = get_fs(); set_fs(KERNEL_DS); - err = file.f_op->read(inode, &file, buf, *count); + err = file.f_op->read(&file, buf, *count, &file.f_pos); set_fs(oldfs); /* Write back readahead params */ @@ -432,7 +432,7 @@ /* Write the data. */ oldfs = get_fs(); set_fs(KERNEL_DS); - err = file.f_op->write(inode, &file, buf, cnt); + err = file.f_op->write(&file, buf, cnt, &file.f_pos); set_fs(oldfs); /* clear setuid/setgid flag after write */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/Config.in linux/fs/nls/Config.in --- v2.1.59/linux/fs/nls/Config.in Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/Config.in Thu Oct 23 14:00:15 1997 @@ -0,0 +1,39 @@ +# +# Native language support configuration +# + +mainmenu_option next_comment +comment 'Native Language Support' + +tristate 'Native language support (Unicode, codepages)' CONFIG_NLS + +if [ "$CONFIG_NLS" = "y" -o "$CONFIG_NLS" = "m" ]; then + dep_tristate 'Codepage 437' CONFIG_NLS_CODEPAGE_437 $CONFIG_NLS + dep_tristate 'Codepage 737' CONFIG_NLS_CODEPAGE_737 $CONFIG_NLS + dep_tristate 'Codepage 775' CONFIG_NLS_CODEPAGE_775 $CONFIG_NLS + dep_tristate 'Codepage 850' CONFIG_NLS_CODEPAGE_850 $CONFIG_NLS + dep_tristate 'Codepage 852' CONFIG_NLS_CODEPAGE_852 $CONFIG_NLS + dep_tristate 'Codepage 855' CONFIG_NLS_CODEPAGE_855 $CONFIG_NLS + dep_tristate 'Codepage 857' CONFIG_NLS_CODEPAGE_857 $CONFIG_NLS + dep_tristate 'Codepage 860' CONFIG_NLS_CODEPAGE_860 $CONFIG_NLS + dep_tristate 'Codepage 861' CONFIG_NLS_CODEPAGE_861 $CONFIG_NLS + dep_tristate 'Codepage 862' CONFIG_NLS_CODEPAGE_862 $CONFIG_NLS + dep_tristate 'Codepage 863' CONFIG_NLS_CODEPAGE_863 $CONFIG_NLS + dep_tristate 'Codepage 864' CONFIG_NLS_CODEPAGE_864 $CONFIG_NLS + dep_tristate 'Codepage 865' CONFIG_NLS_CODEPAGE_865 $CONFIG_NLS + dep_tristate 'Codepage 866' CONFIG_NLS_CODEPAGE_866 $CONFIG_NLS + dep_tristate 'Codepage 869' CONFIG_NLS_CODEPAGE_869 $CONFIG_NLS + dep_tristate 'Codepage 874' CONFIG_NLS_CODEPAGE_874 $CONFIG_NLS + dep_tristate 'NLS ISO 8859-1' CONFIG_NLS_ISO8859_1 $CONFIG_NLS + dep_tristate 'NLS ISO 8859-2' CONFIG_NLS_ISO8859_2 $CONFIG_NLS + dep_tristate 'NLS ISO 8859-3' CONFIG_NLS_ISO8859_3 $CONFIG_NLS + dep_tristate 'NLS ISO 8859-4' CONFIG_NLS_ISO8859_4 $CONFIG_NLS + dep_tristate 'NLS ISO 8859-5' CONFIG_NLS_ISO8859_5 $CONFIG_NLS + dep_tristate 'NLS ISO 8859-6' CONFIG_NLS_ISO8859_6 $CONFIG_NLS + dep_tristate 'NLS ISO 8859-7' CONFIG_NLS_ISO8859_7 $CONFIG_NLS + dep_tristate 'NLS ISO 8859-8' CONFIG_NLS_ISO8859_8 $CONFIG_NLS + dep_tristate 'NLS ISO 8859-9' CONFIG_NLS_ISO8859_9 $CONFIG_NLS + dep_tristate 'NLS KOI8-R' CONFIG_NLS_KOI8_R $CONFIG_NLS +fi + +endmenu diff -u --recursive --new-file v2.1.59/linux/fs/nls/Makefile linux/fs/nls/Makefile --- v2.1.59/linux/fs/nls/Makefile Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/Makefile Thu Oct 23 14:00:15 1997 @@ -0,0 +1,305 @@ +# +# Makefile for native language support +# + +MOD_LIST_NAME := NLS_MODULES + +ifeq ($(CONFIG_NLS),y) +NLS += nls_base.o +O_TARGET = nls.o +OX_OBJS = $(NLS) +else + ifeq ($(CONFIG_NLS),m) + MX_OBJS += nls_base.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_437),y) +NLS += nls_cp437.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_437),m) + M_OBJS += nls_cp437.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_737),y) +NLS += nls_cp737.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_737),m) + M_OBJS += nls_cp737.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_775),y) +NLS += nls_cp775.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_775),m) + M_OBJS += nls_cp775.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_850),y) +NLS += nls_cp850.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_850),m) + M_OBJS += nls_cp850.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_852),y) +NLS += nls_cp852.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_852),m) + M_OBJS += nls_cp852.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_855),y) +NLS += nls_cp855.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_855),m) + M_OBJS += nls_cp855.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_857),y) +NLS += nls_cp857.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_857),m) + M_OBJS += nls_cp857.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_860),y) +NLS += nls_cp860.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_860),m) + M_OBJS += nls_cp860.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_861),y) +NLS += nls_cp861.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_861),m) + M_OBJS += nls_cp861.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_862),y) +NLS += nls_cp862.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_862),m) + M_OBJS += nls_cp862.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_863),y) +NLS += nls_cp863.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_863),m) + M_OBJS += nls_cp863.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_864),y) +NLS += nls_cp864.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_864),m) + M_OBJS += nls_cp864.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_865),y) +NLS += nls_cp865.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_865),m) + M_OBJS += nls_cp865.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_866),y) +NLS += nls_cp866.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_866),m) + M_OBJS += nls_cp866.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_869),y) +NLS += nls_cp869.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_869),m) + M_OBJS += nls_cp869.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_874),y) +NLS += nls_cp874.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_874),m) + M_OBJS += nls_cp874.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_1250),y) +NLS += nls_cp1250.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_1250),m) + M_OBJS += nls_cp1250.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_1251),y) +NLS += nls_cp1251.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_1251),m) + M_OBJS += nls_cp1251.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_1252),y) +NLS += nls_cp1252.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_1252),m) + M_OBJS += nls_cp1252.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_1253),y) +NLS += nls_cp1253.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_1253),m) + M_OBJS += nls_cp1253.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_1254),y) +NLS += nls_cp1254.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_1254),m) + M_OBJS += nls_cp1254.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_1255),y) +NLS += nls_cp1255.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_1255),m) + M_OBJS += nls_cp1255.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_1256),y) +NLS += nls_cp1256.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_1256),m) + M_OBJS += nls_cp1256.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_1257),y) +NLS += nls_cp1257.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_1257),m) + M_OBJS += nls_cp1257.o + endif +endif + +ifeq ($(CONFIG_NLS_CODEPAGE_1258),y) +NLS += nls_cp1258.o +else + ifeq ($(CONFIG_NLS_CODEPAGE_1258),m) + M_OBJS += nls_cp1258.o + endif +endif + +ifeq ($(CONFIG_NLS_ISO8859_1),y) +NLS += nls_iso8859-1.o +else + ifeq ($(CONFIG_NLS_ISO8859_1),m) + M_OBJS += nls_iso8859-1.o + endif +endif + +ifeq ($(CONFIG_NLS_ISO8859_2),y) +NLS += nls_iso8859-2.o +else + ifeq ($(CONFIG_NLS_ISO8859_2),m) + M_OBJS += nls_iso8859-2.o + endif +endif + +ifeq ($(CONFIG_NLS_ISO8859_3),y) +NLS += nls_iso8859-3.o +else + ifeq ($(CONFIG_NLS_ISO8859_3),m) + M_OBJS += nls_iso8859-3.o + endif +endif + +ifeq ($(CONFIG_NLS_ISO8859_4),y) +NLS += nls_iso8859-4.o +else + ifeq ($(CONFIG_NLS_ISO8859_4),m) + M_OBJS += nls_iso8859-4.o + endif +endif + +ifeq ($(CONFIG_NLS_ISO8859_5),y) +NLS += nls_iso8859-5.o +else + ifeq ($(CONFIG_NLS_ISO8859_5),m) + M_OBJS += nls_iso8859-5.o + endif +endif + +ifeq ($(CONFIG_NLS_ISO8859_6),y) +NLS += nls_iso8859-6.o +else + ifeq ($(CONFIG_NLS_ISO8859_6),m) + M_OBJS += nls_iso8859-6.o + endif +endif + +ifeq ($(CONFIG_NLS_ISO8859_7),y) +NLS += nls_iso8859-7.o +else + ifeq ($(CONFIG_NLS_ISO8859_7),m) + M_OBJS += nls_iso8859-7.o + endif +endif + +ifeq ($(CONFIG_NLS_ISO8859_8),y) +NLS += nls_iso8859-8.o +else + ifeq ($(CONFIG_NLS_ISO8859_8),m) + M_OBJS += nls_iso8859-8.o + endif +endif + +ifeq ($(CONFIG_NLS_ISO8859_9),y) +NLS += nls_iso8859-9.o +else + ifeq ($(CONFIG_NLS_ISO8859_9),m) + M_OBJS += nls_iso8859-9.o + endif +endif + +ifeq ($(CONFIG_NLS_ISO8859_10),y) +NLS += nls_iso8859-10.o +else + ifeq ($(CONFIG_NLS_ISO8859_10),m) + M_OBJS += nls_iso8859-10.o + endif +endif + +ifeq ($(CONFIG_NLS_KOI8_R),y) +NLS += nls_koi8-r.o +else + ifeq ($(CONFIG_NLS_KOI8_R),m) + M_OBJS += nls_koi8-r.o + endif +endif + +include $(TOPDIR)/Rules.make diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_base.c linux/fs/nls/nls_base.c --- v2.1.59/linux/fs/nls/nls_base.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_base.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,499 @@ +/* + * linux/fs/nls.c + * + * Native language support--charsets and unicode translations. + * By Gordon Chaffee 1996, 1997 + * + */ + +#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) +#include +#include +#include +#include +#include +#include +#ifdef CONFIG_KERNELD +#include +#endif +#include + +static struct nls_table *tables = (struct nls_table *) NULL; + +/* + * Sample implementation from Unicode home page. + * http://www.stonehand.com/unicode/standard/fss-utf.html + */ +struct utf8_table { + int cmask; + int cval; + int shift; + long lmask; + long lval; +}; + +static struct utf8_table utf8_table[] = +{ + {0x80, 0x00, 0*6, 0x7F, 0, /* 1 byte sequence */}, + {0xE0, 0xC0, 1*6, 0x7FF, 0x80, /* 2 byte sequence */}, + {0xF0, 0xE0, 2*6, 0xFFFF, 0x800, /* 3 byte sequence */}, + {0xF8, 0xF0, 3*6, 0x1FFFFF, 0x10000, /* 4 byte sequence */}, + {0xFC, 0xF8, 4*6, 0x3FFFFFF, 0x200000, /* 5 byte sequence */}, + {0xFE, 0xFC, 5*6, 0x7FFFFFFF, 0x4000000, /* 6 byte sequence */}, + {0, /* end of table */} +}; + +int +utf8_mbtowc(__u16 *p, const __u8 *s, int n) +{ + long l; + int c0, c, nc; + struct utf8_table *t; + + printk("utf8_mbtowc\n"); + nc = 0; + c0 = *s; + l = c0; + for (t = utf8_table; t->cmask; t++) { + nc++; + if ((c0 & t->cmask) == t->cval) { + l &= t->lmask; + if (l < t->lval) + return -1; + *p = l; + return nc; + } + if (n <= nc) + return -1; + s++; + c = (*s ^ 0x80) & 0xFF; + if (c & 0xC0) + return -1; + l = (l << 6) | c; + } + return -1; +} + +int +utf8_mbstowcs(__u16 *pwcs, const __u8 *s, int n) +{ + __u16 *op; + const __u8 *ip; + int size; + + printk("\nutf8_mbstowcs: n=%d\n", n); + op = pwcs; + ip = s; + while (*ip && n > 0) { + printk(" %02x", *ip); + if (*ip & 0x80) { + size = utf8_mbtowc(op, ip, n); + if (size == -1) { + /* Ignore character and move on */ + ip++; + n--; + } else { + op += size; + ip += size; + n -= size; + } + } else { + *op++ = *ip++; + } + } + return (op - pwcs); +} + +int +utf8_wctomb(__u8 *s, __u16 wc, int maxlen) +{ + long l; + int c, nc; + struct utf8_table *t; + + if (s == 0) + return 0; + + l = wc; + nc = 0; + for (t = utf8_table; t->cmask && maxlen; t++, maxlen--) { + nc++; + if (l <= t->lmask) { + c = t->shift; + *s = t->cval | (l >> c); + while (c > 0) { + c -= 6; + s++; + *s = 0x80 | ((l >> c) & 0x3F); + } + return nc; + } + } + return -1; +} + +int +utf8_wcstombs(__u8 *s, const __u16 *pwcs, int maxlen) +{ + const __u16 *ip; + __u8 *op; + int size; + + op = s; + ip = pwcs; + while (*ip && maxlen > 0) { + if (*ip > 0x7f) { + size = utf8_wctomb(op, *ip, maxlen); + if (size == -1) { + /* Ignore character and move on */ + maxlen--; + } else { + op += size; + maxlen -= size; + } + } else { + *op++ = (__u8) *ip; + } + ip++; + } + return (op - s); +} + +int register_nls(struct nls_table * nls) +{ + struct nls_table ** tmp = &tables; + + if (!nls) + return -EINVAL; + if (nls->next) + return -EBUSY; + while (*tmp) { + if (nls == *tmp) { + return -EBUSY; + } + tmp = &(*tmp)->next; + } + nls->next = tables; + tables = nls; + return 0; +} + +int unregister_nls(struct nls_table * nls) +{ + struct nls_table ** tmp = &tables; + + while (*tmp) { + if (nls == *tmp) { + *tmp = nls->next; + return 0; + } + tmp = &(*tmp)->next; + } + return -EINVAL; +} + +struct nls_table *find_nls(char *charset) +{ + struct nls_table *nls = tables; + while (nls) { + if (! strcmp(nls->charset, charset)) + return nls; + nls = nls->next; + } + return NULL; +} + +struct nls_table *load_nls(char *charset) +{ + struct nls_table *nls; + char buf[40]; + int ret; + + nls = find_nls(charset); + if (nls) { + nls->inc_use_count(); + return nls; + } + +#ifndef CONFIG_KERNELD + return NULL; +#else + if (strlen(charset) > sizeof(buf) - sizeof("nls_")) { + printk("Unable to load NLS charset %s: name too long\n", charset); + return NULL; + } + + sprintf(buf, "nls_%s", charset); + ret = request_module(buf); + if (ret != 0) { + printk("Unable to load NLS charset %s\n", charset); + return NULL; + } + nls = find_nls(charset); + if (nls) { + nls->inc_use_count(); + } + return nls; +#endif +} + +void unload_nls(struct nls_table *nls) +{ + nls->dec_use_count(); +} + +struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x80, 0x00}, {0x81, 0x00}, {0x82, 0x00}, {0x83, 0x00}, + {0x84, 0x00}, {0x85, 0x00}, {0x86, 0x00}, {0x87, 0x00}, + {0x88, 0x00}, {0x89, 0x00}, {0x8a, 0x00}, {0x8b, 0x00}, + {0x8c, 0x00}, {0x8d, 0x00}, {0x8e, 0x00}, {0x8f, 0x00}, + /* 0x90*/ + {0x90, 0x00}, {0x91, 0x00}, {0x92, 0x00}, {0x93, 0x00}, + {0x94, 0x00}, {0x95, 0x00}, {0x96, 0x00}, {0x97, 0x00}, + {0x98, 0x00}, {0x99, 0x00}, {0x9a, 0x00}, {0x9b, 0x00}, + {0x9c, 0x00}, {0x9d, 0x00}, {0x9e, 0x00}, {0x9f, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, + {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00}, + {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00}, + {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00}, + /* 0xb0*/ + {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, + {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00}, + {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00}, + {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00}, + /* 0xc0*/ + {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00}, + {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00}, + {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, + {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, + /* 0xd0*/ + {0xd0, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00}, + {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00}, + {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, + {0xdc, 0x00}, {0xdd, 0x00}, {0xde, 0x00}, {0xdf, 0x00}, + /* 0xe0*/ + {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, + {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00}, + {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, + {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00}, + /* 0xf0*/ + {0xf0, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00}, + {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00}, + {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00}, + {0xfc, 0x00}, {0xfd, 0x00}, {0xfe, 0x00}, {0xff, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00 +}; + + +void inc_use_count(void) +{ +} + +void dec_use_count(void) +{ +} + +static struct nls_table default_table = { + "default", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + + + +/* Returns a simple default translation table */ +struct nls_table *load_nls_default(void) +{ + return &default_table; +} + +EXPORT_SYMBOL(register_nls); +EXPORT_SYMBOL(unregister_nls); +EXPORT_SYMBOL(unload_nls); +EXPORT_SYMBOL(find_nls); +EXPORT_SYMBOL(load_nls); +EXPORT_SYMBOL(load_nls_default); +EXPORT_SYMBOL(utf8_mbtowc); +EXPORT_SYMBOL(utf8_mbstowcs); +EXPORT_SYMBOL(utf8_wctomb); +EXPORT_SYMBOL(utf8_wcstombs); + +int init_nls(void) +{ +#ifdef CONFIG_NLS_ISO8859_1 + init_nls_iso8859_1(); +#endif +#ifdef CONFIG_NLS_ISO8859_2 + init_nls_iso8859_2(); +#endif +#ifdef CONFIG_NLS_ISO8859_3 + init_nls_iso8859_3(); +#endif +#ifdef CONFIG_NLS_ISO8859_4 + init_nls_iso8859_4(); +#endif +#ifdef CONFIG_NLS_ISO8859_5 + init_nls_iso8859_5(); +#endif +#ifdef CONFIG_NLS_ISO8859_6 + init_nls_iso8859_6(); +#endif +#ifdef CONFIG_NLS_ISO8859_7 + init_nls_iso8859_7(); +#endif +#ifdef CONFIG_NLS_ISO8859_8 + init_nls_iso8859_8(); +#endif +#ifdef CONFIG_NLS_ISO8859_9 + init_nls_iso8859_9(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_437 + init_nls_cp437(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_737 + init_nls_cp737(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_775 + init_nls_cp775(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_850 + init_nls_cp850(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_852 + init_nls_cp852(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_855 + init_nls_cp855(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_857 + init_nls_cp857(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_860 + init_nls_cp860(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_861 + init_nls_cp861(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_862 + init_nls_cp862(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_863 + init_nls_cp863(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_864 + init_nls_cp864(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_865 + init_nls_cp865(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_866 + init_nls_cp866(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_869 + init_nls_cp869(); +#endif +#ifdef CONFIG_NLS_CODEPAGE_874 + init_nls_cp874(); +#endif +#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0) + return 0; +#else + return register_symtab(&nls_syms); +#endif +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls(); +} + + +void cleanup_module(void) +{ +} +#endif /* ifdef MODULE */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp437.c linux/fs/nls/nls_cp437.c --- v2.1.59/linux/fs/nls/nls_cp437.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp437.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,447 @@ +/* + * linux/fs/nls_cp437.c + * + * Charset cp437 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, + {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, + {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00}, + {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, + /* 0x90*/ + {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00}, + {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00}, + {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xa2, 0x00}, + {0xa3, 0x00}, {0xa5, 0x00}, {0xa7, 0x20}, {0x92, 0x01}, + /* 0xa0*/ + {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, + {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00}, + {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00}, + {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, + {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, + /* 0xd0*/ + {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, + {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, + {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, + /* 0xe0*/ + {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, + {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, + {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, + {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, + /* 0xf0*/ + {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, + {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, + {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, + {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0xad, 0x9b, 0x9c, 0x00, 0x9d, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */ + 0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */ + 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ + 0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */ + 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */ + 0x00, 0xa4, 0x95, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */ + 0x00, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x98, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page03[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ + 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page23[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ + 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ + 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ + 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, NULL, page03, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, page22, page23, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp437", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp437(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp437(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp737.c linux/fs/nls/nls_cp737.c --- v2.1.59/linux/fs/nls/nls_cp737.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp737.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,375 @@ +/* + * linux/fs/nls_cp737.c + * + * Charset cp737 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, {0x94, 0x03}, + {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, {0x98, 0x03}, + {0x99, 0x03}, {0x9a, 0x03}, {0x9b, 0x03}, {0x9c, 0x03}, + {0x9d, 0x03}, {0x9e, 0x03}, {0x9f, 0x03}, {0xa0, 0x03}, + /* 0x90*/ + {0xa1, 0x03}, {0xa3, 0x03}, {0xa4, 0x03}, {0xa5, 0x03}, + {0xa6, 0x03}, {0xa7, 0x03}, {0xa8, 0x03}, {0xa9, 0x03}, + {0xb1, 0x03}, {0xb2, 0x03}, {0xb3, 0x03}, {0xb4, 0x03}, + {0xb5, 0x03}, {0xb6, 0x03}, {0xb7, 0x03}, {0xb8, 0x03}, + /* 0xa0*/ + {0xb9, 0x03}, {0xba, 0x03}, {0xbb, 0x03}, {0xbc, 0x03}, + {0xbd, 0x03}, {0xbe, 0x03}, {0xbf, 0x03}, {0xc0, 0x03}, + {0xc1, 0x03}, {0xc3, 0x03}, {0xc2, 0x03}, {0xc4, 0x03}, + {0xc5, 0x03}, {0xc6, 0x03}, {0xc7, 0x03}, {0xc8, 0x03}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, + {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, + /* 0xd0*/ + {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, + {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, + {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, + /* 0xe0*/ + {0xc9, 0x03}, {0xac, 0x03}, {0xad, 0x03}, {0xae, 0x03}, + {0xca, 0x03}, {0xaf, 0x03}, {0xcc, 0x03}, {0xcd, 0x03}, + {0xcb, 0x03}, {0xce, 0x03}, {0x86, 0x03}, {0x88, 0x03}, + {0x89, 0x03}, {0x8a, 0x03}, {0x8c, 0x03}, {0x8e, 0x03}, + /* 0xf0*/ + {0x8f, 0x03}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, + {0xaa, 0x03}, {0xab, 0x03}, {0xf7, 0x00}, {0x48, 0x22}, + {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, + {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page03[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x00, /* 0x80-0x87 */ + 0xeb, 0xec, 0xed, 0x00, 0xee, 0x00, 0xef, 0xf0, /* 0x88-0x8f */ + 0x00, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, /* 0x90-0x97 */ + 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, /* 0x98-0x9f */ + 0x8f, 0x90, 0x00, 0x91, 0x92, 0x93, 0x94, 0x95, /* 0xa0-0xa7 */ + 0x96, 0x97, 0xf4, 0xf5, 0xe1, 0xe2, 0xe3, 0xe5, /* 0xa8-0xaf */ + 0x00, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, /* 0xb0-0xb7 */ + 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, /* 0xb8-0xbf */ + 0xa7, 0xa8, 0xaa, 0xa9, 0xab, 0xac, 0xad, 0xae, /* 0xc0-0xc7 */ + 0xaf, 0xe0, 0xe4, 0xe8, 0xe6, 0xe7, 0xe9, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ + 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ + 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ + 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, page03, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, page22, NULL, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp737", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp737(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp737(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp775.c linux/fs/nls/nls_cp775.c --- v2.1.59/linux/fs/nls/nls_cp775.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp775.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,375 @@ +/* + * linux/fs/nls_cp775.c + * + * Charset cp775 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x06, 0x01}, {0xfc, 0x00}, {0xe9, 0x00}, {0x01, 0x01}, + {0xe4, 0x00}, {0x23, 0x01}, {0xe5, 0x00}, {0x07, 0x01}, + {0x42, 0x01}, {0x13, 0x01}, {0x56, 0x01}, {0x57, 0x01}, + {0x2b, 0x01}, {0x79, 0x01}, {0xc4, 0x00}, {0xc5, 0x00}, + /* 0x90*/ + {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0x4d, 0x01}, + {0xf6, 0x00}, {0x22, 0x01}, {0xa2, 0x00}, {0x5a, 0x01}, + {0x5b, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00}, + {0xa3, 0x00}, {0xd8, 0x00}, {0xd7, 0x00}, {0xa4, 0x00}, + /* 0xa0*/ + {0x00, 0x01}, {0x2a, 0x01}, {0xf3, 0x00}, {0x7b, 0x01}, + {0x7c, 0x01}, {0x7a, 0x01}, {0x1d, 0x20}, {0xa6, 0x00}, + {0xa9, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00}, + {0xbc, 0x00}, {0x41, 0x01}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x04, 0x01}, {0x0c, 0x01}, {0x18, 0x01}, + {0x16, 0x01}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x2e, 0x01}, {0x60, 0x01}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x72, 0x01}, {0x6a, 0x01}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x7d, 0x01}, + /* 0xd0*/ + {0x05, 0x01}, {0x0d, 0x01}, {0x19, 0x01}, {0x17, 0x01}, + {0x2f, 0x01}, {0x61, 0x01}, {0x73, 0x01}, {0x6b, 0x01}, + {0x7e, 0x01}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, + /* 0xe0*/ + {0xd3, 0x00}, {0xdf, 0x00}, {0x4c, 0x01}, {0x43, 0x01}, + {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0x44, 0x01}, + {0x36, 0x01}, {0x37, 0x01}, {0x3b, 0x01}, {0x3c, 0x01}, + {0x46, 0x01}, {0x12, 0x01}, {0x45, 0x01}, {0x19, 0x20}, + /* 0xf0*/ + {0xad, 0x00}, {0xb1, 0x00}, {0x1c, 0x20}, {0xbe, 0x00}, + {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0x1e, 0x20}, + {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0xb9, 0x00}, + {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0x00, 0x96, 0x9c, 0x9f, 0x00, 0xa7, 0xf5, /* 0xa0-0xa7 */ + 0x00, 0xa8, 0x00, 0xae, 0xaa, 0xf0, 0xa9, 0x00, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0xfd, 0xfc, 0x00, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */ + 0x00, 0xfb, 0x00, 0xaf, 0xac, 0xab, 0xf3, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0xe0, 0x00, 0xe5, 0x99, 0x9e, /* 0xd0-0xd7 */ + 0x9d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x84, 0x86, 0x91, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0xa2, 0x00, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */ + 0x9b, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0xa0, 0x83, 0x00, 0x00, 0xb5, 0xd0, 0x80, 0x87, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd1, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0xed, 0x89, 0x00, 0x00, 0xb8, 0xd3, /* 0x10-0x17 */ + 0xb7, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x95, 0x85, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0xa1, 0x8c, 0x00, 0x00, 0xbd, 0xd4, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xe9, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0xea, 0xeb, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0xad, 0x88, 0xe3, 0xe7, 0xee, 0xec, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0xe2, 0x93, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x8b, /* 0x50-0x57 */ + 0x00, 0x00, 0x97, 0x98, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0xbe, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0xc7, 0xd7, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0xc6, 0xd6, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x8d, 0xa5, 0xa3, 0xa4, 0xcf, 0xd8, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0xef, 0x00, 0x00, 0xf2, 0xa6, 0xf7, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ + 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ + 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ + 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, page22, NULL, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x8a, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x00, 0x00, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0x00, 0xa3, 0x00, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0xe8, 0x00, 0xea, 0x00, 0x00, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp775", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp775(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp775(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp850.c linux/fs/nls/nls_cp850.c --- v2.1.59/linux/fs/nls/nls_cp850.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp850.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,339 @@ +/* + * linux/fs/nls_cp850.c + * + * Charset cp850 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, + {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, + {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00}, + {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, + /* 0x90*/ + {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00}, + {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00}, + {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00}, + {0xa3, 0x00}, {0xd8, 0x00}, {0xd7, 0x00}, {0x92, 0x01}, + /* 0xa0*/ + {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, + {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00}, + {0xbf, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00}, + {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc0, 0x00}, + {0xa9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0xa2, 0x00}, {0xa5, 0x00}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0xe3, 0x00}, {0xc3, 0x00}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00}, + /* 0xd0*/ + {0xf0, 0x00}, {0xd0, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, + {0xc8, 0x00}, {0x31, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, + {0xcf, 0x00}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0xa6, 0x00}, {0xcc, 0x00}, {0x80, 0x25}, + /* 0xe0*/ + {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0xd2, 0x00}, + {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0xfe, 0x00}, + {0xde, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00}, + {0xfd, 0x00}, {0xdd, 0x00}, {0xaf, 0x00}, {0xb4, 0x00}, + /* 0xf0*/ + {0xad, 0x00}, {0xb1, 0x00}, {0x17, 0x20}, {0xbe, 0x00}, + {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00}, + {0xb0, 0x00}, {0xa8, 0x00}, {0xb7, 0x00}, {0xb9, 0x00}, + {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0xad, 0xbd, 0x9c, 0xcf, 0xbe, 0xdd, 0xf5, /* 0xa0-0xa7 */ + 0xf9, 0xb8, 0xa6, 0xae, 0xaa, 0xf0, 0xa9, 0xee, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0xfd, 0xfc, 0xef, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */ + 0xf7, 0xfb, 0xa7, 0xaf, 0xac, 0xab, 0xf3, 0xa8, /* 0xb8-0xbf */ + 0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */ + 0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, /* 0xc8-0xcf */ + 0xd1, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0x9e, /* 0xd0-0xd7 */ + 0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0xed, 0xe8, 0xe1, /* 0xd8-0xdf */ + 0x85, 0xa0, 0x83, 0xc6, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */ + 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */ + 0xd0, 0xa4, 0x95, 0xa2, 0x93, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */ + 0x9b, 0x97, 0xa3, 0x96, 0x81, 0xec, 0xe7, 0x98, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ + 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ + 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ + 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, NULL, NULL, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp850", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp850(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp850(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp852.c linux/fs/nls/nls_cp852.c --- v2.1.59/linux/fs/nls/nls_cp852.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp852.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,339 @@ +/* + * linux/fs/nls_cp852.c + * + * Charset cp852 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, + {0xe4, 0x00}, {0x6f, 0x01}, {0x07, 0x01}, {0xe7, 0x00}, + {0x42, 0x01}, {0xeb, 0x00}, {0x50, 0x01}, {0x51, 0x01}, + {0xee, 0x00}, {0x79, 0x01}, {0xc4, 0x00}, {0x06, 0x01}, + /* 0x90*/ + {0xc9, 0x00}, {0x39, 0x01}, {0x3a, 0x01}, {0xf4, 0x00}, + {0xf6, 0x00}, {0x3d, 0x01}, {0x3e, 0x01}, {0x5a, 0x01}, + {0x5b, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0x64, 0x01}, + {0x65, 0x01}, {0x41, 0x01}, {0xd7, 0x00}, {0x0d, 0x01}, + /* 0xa0*/ + {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, + {0x04, 0x01}, {0x05, 0x01}, {0x7d, 0x01}, {0x7e, 0x01}, + {0x18, 0x01}, {0x19, 0x01}, {0xac, 0x00}, {0x7a, 0x01}, + {0x0c, 0x01}, {0x5f, 0x01}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0x1a, 0x01}, + {0x5e, 0x01}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x7b, 0x01}, {0x7c, 0x01}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x02, 0x01}, {0x03, 0x01}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00}, + /* 0xd0*/ + {0x11, 0x01}, {0x10, 0x01}, {0x0e, 0x01}, {0xcb, 0x00}, + {0x0f, 0x01}, {0x47, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, + {0x1b, 0x01}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x62, 0x01}, {0x6e, 0x01}, {0x80, 0x25}, + /* 0xe0*/ + {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0x43, 0x01}, + {0x44, 0x01}, {0x48, 0x01}, {0x60, 0x01}, {0x61, 0x01}, + {0x54, 0x01}, {0xda, 0x00}, {0x55, 0x01}, {0x70, 0x01}, + {0xfd, 0x00}, {0xdd, 0x00}, {0x63, 0x01}, {0xb4, 0x00}, + /* 0xf0*/ + {0xad, 0x00}, {0xdd, 0x02}, {0xdb, 0x02}, {0xc7, 0x02}, + {0xd8, 0x02}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00}, + {0xb0, 0x00}, {0xa8, 0x00}, {0xd9, 0x02}, {0x71, 0x01}, + {0x58, 0x01}, {0x59, 0x01}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0xf5, /* 0xa0-0xa7 */ + 0xf9, 0x00, 0x00, 0xae, 0xaa, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */ + 0xf8, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0xf7, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0xb5, 0xb6, 0x00, 0x8e, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */ + 0x00, 0x90, 0x00, 0xd3, 0x00, 0xd6, 0xd7, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0xe0, 0xe2, 0x00, 0x99, 0x9e, /* 0xd0-0xd7 */ + 0x00, 0x00, 0xe9, 0x00, 0x9a, 0xed, 0x00, 0xe1, /* 0xd8-0xdf */ + 0x00, 0xa0, 0x83, 0x00, 0x84, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */ + 0x00, 0x82, 0x00, 0x89, 0x00, 0xa1, 0x8c, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */ + 0x00, 0x00, 0xa3, 0x00, 0x81, 0xec, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0xc6, 0xc7, 0xa4, 0xa5, 0x8f, 0x86, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xac, 0x9f, 0xd2, 0xd4, /* 0x08-0x0f */ + 0xd1, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xa8, 0xa9, 0xb7, 0xd8, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x91, 0x92, 0x00, 0x00, 0x95, 0x96, 0x00, /* 0x38-0x3f */ + 0x00, 0x9d, 0x88, 0xe3, 0xe4, 0x00, 0x00, 0xd5, /* 0x40-0x47 */ + 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x8a, 0x8b, 0x00, 0x00, 0xe8, 0xea, 0x00, 0x00, /* 0x50-0x57 */ + 0xfc, 0xfd, 0x97, 0x98, 0x00, 0x00, 0xb8, 0xad, /* 0x58-0x5f */ + 0xe6, 0xe7, 0xdd, 0xee, 0x9b, 0x9c, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x85, /* 0x68-0x6f */ + 0xeb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x8d, 0xab, 0xbd, 0xbe, 0xa6, 0xa7, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page02[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0xf4, 0xfa, 0x00, 0xf2, 0x00, 0xf1, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ + 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ + 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ + 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, page02, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x8a, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x00, 0x00, 0x00, 0x95, 0x00, 0x97, /* 0x90-0x97 */ + 0x00, 0x99, 0x9a, 0x9b, 0x00, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0x00, /* 0xa0-0xa7 */ + 0xa8, 0x00, 0xaa, 0x00, 0xac, 0x00, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0x00, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0x00, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0x00, 0xd1, 0xd2, 0xd3, 0x00, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0x00, 0xe2, 0xe3, 0x00, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0x00, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0x00, 0xfc, 0x00, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp852", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp852(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp852(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp855.c linux/fs/nls/nls_cp855.c --- v2.1.59/linux/fs/nls/nls_cp855.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp855.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,339 @@ +/* + * linux/fs/nls_cp855.c + * + * Charset cp855 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x52, 0x04}, {0x02, 0x04}, {0x53, 0x04}, {0x03, 0x04}, + {0x51, 0x04}, {0x01, 0x04}, {0x54, 0x04}, {0x04, 0x04}, + {0x55, 0x04}, {0x05, 0x04}, {0x56, 0x04}, {0x06, 0x04}, + {0x57, 0x04}, {0x07, 0x04}, {0x58, 0x04}, {0x08, 0x04}, + /* 0x90*/ + {0x59, 0x04}, {0x09, 0x04}, {0x5a, 0x04}, {0x0a, 0x04}, + {0x5b, 0x04}, {0x0b, 0x04}, {0x5c, 0x04}, {0x0c, 0x04}, + {0x5e, 0x04}, {0x0e, 0x04}, {0x5f, 0x04}, {0x0f, 0x04}, + {0x4e, 0x04}, {0x2e, 0x04}, {0x4a, 0x04}, {0x2a, 0x04}, + /* 0xa0*/ + {0x30, 0x04}, {0x10, 0x04}, {0x31, 0x04}, {0x11, 0x04}, + {0x46, 0x04}, {0x26, 0x04}, {0x34, 0x04}, {0x14, 0x04}, + {0x35, 0x04}, {0x15, 0x04}, {0x44, 0x04}, {0x24, 0x04}, + {0x33, 0x04}, {0x13, 0x04}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x45, 0x04}, {0x25, 0x04}, {0x38, 0x04}, + {0x18, 0x04}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x39, 0x04}, {0x19, 0x04}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x3a, 0x04}, {0x1a, 0x04}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00}, + /* 0xd0*/ + {0x3b, 0x04}, {0x1b, 0x04}, {0x3c, 0x04}, {0x1c, 0x04}, + {0x3d, 0x04}, {0x1d, 0x04}, {0x3e, 0x04}, {0x1e, 0x04}, + {0x3f, 0x04}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x1f, 0x04}, {0x4f, 0x04}, {0x80, 0x25}, + /* 0xe0*/ + {0x2f, 0x04}, {0x40, 0x04}, {0x20, 0x04}, {0x41, 0x04}, + {0x21, 0x04}, {0x42, 0x04}, {0x22, 0x04}, {0x43, 0x04}, + {0x23, 0x04}, {0x36, 0x04}, {0x16, 0x04}, {0x32, 0x04}, + {0x12, 0x04}, {0x4c, 0x04}, {0x2c, 0x04}, {0x16, 0x21}, + /* 0xf0*/ + {0xad, 0x00}, {0x4b, 0x04}, {0x2b, 0x04}, {0x37, 0x04}, + {0x17, 0x04}, {0x48, 0x04}, {0x28, 0x04}, {0x4d, 0x04}, + {0x2d, 0x04}, {0x49, 0x04}, {0x29, 0x04}, {0x47, 0x04}, + {0x27, 0x04}, {0xa7, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0xfd, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0xae, 0x00, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page04[256] = { + 0x00, 0x85, 0x81, 0x83, 0x87, 0x89, 0x8b, 0x8d, /* 0x00-0x07 */ + 0x8f, 0x91, 0x93, 0x95, 0x97, 0x00, 0x99, 0x9b, /* 0x08-0x0f */ + 0xa1, 0xa3, 0xec, 0xad, 0xa7, 0xa9, 0xea, 0xf4, /* 0x10-0x17 */ + 0xb8, 0xbe, 0xc7, 0xd1, 0xd3, 0xd5, 0xd7, 0xdd, /* 0x18-0x1f */ + 0xe2, 0xe4, 0xe6, 0xe8, 0xab, 0xb6, 0xa5, 0xfc, /* 0x20-0x27 */ + 0xf6, 0xfa, 0x9f, 0xf2, 0xee, 0xf8, 0x9d, 0xe0, /* 0x28-0x2f */ + 0xa0, 0xa2, 0xeb, 0xac, 0xa6, 0xa8, 0xe9, 0xf3, /* 0x30-0x37 */ + 0xb7, 0xbd, 0xc6, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, /* 0x38-0x3f */ + 0xe1, 0xe3, 0xe5, 0xe7, 0xaa, 0xb5, 0xa4, 0xfb, /* 0x40-0x47 */ + 0xf5, 0xf9, 0x9e, 0xf1, 0xed, 0xf7, 0x9c, 0xde, /* 0x48-0x4f */ + 0x00, 0x84, 0x80, 0x82, 0x86, 0x88, 0x8a, 0x8c, /* 0x50-0x57 */ + 0x8e, 0x90, 0x92, 0x94, 0x96, 0x00, 0x98, 0x9a, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page21[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ + 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ + 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ + 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, page21, NULL, NULL, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x00, 0x81, 0x00, 0x83, 0x00, 0x85, 0x00, 0x87, /* 0x80-0x87 */ + 0x00, 0x89, 0x00, 0x8b, 0x00, 0x8d, 0x00, 0x8f, /* 0x88-0x8f */ + 0x00, 0x91, 0x00, 0x93, 0x00, 0x95, 0x00, 0x97, /* 0x90-0x97 */ + 0x00, 0x99, 0x00, 0x9b, 0x00, 0x9d, 0x00, 0x9f, /* 0x98-0x9f */ + 0x00, 0xa1, 0x00, 0xa3, 0x00, 0xa5, 0x00, 0xa7, /* 0xa0-0xa7 */ + 0x00, 0xa9, 0x00, 0xab, 0x00, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0x00, 0xb6, 0x00, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0x00, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0x00, 0xd1, 0x00, 0xd3, 0x00, 0xd5, 0x00, 0xd7, /* 0xd0-0xd7 */ + 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0xe8, 0x00, 0xea, 0x00, 0xec, 0x00, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0x00, 0xf2, 0x00, 0xf4, 0x00, 0xf6, 0x00, /* 0xf0-0xf7 */ + 0xf8, 0x00, 0xfa, 0x00, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp855", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp855(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp855(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp857.c linux/fs/nls/nls_cp857.c --- v2.1.59/linux/fs/nls/nls_cp857.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp857.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,303 @@ +/* + * linux/fs/nls_cp857.c + * + * Charset cp857 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, + {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, + {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00}, + {0xee, 0x00}, {0x31, 0x01}, {0xc4, 0x00}, {0xc5, 0x00}, + /* 0x90*/ + {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00}, + {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00}, + {0x30, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00}, + {0xa3, 0x00}, {0xd8, 0x00}, {0x5e, 0x01}, {0x5f, 0x01}, + /* 0xa0*/ + {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, + {0xf1, 0x00}, {0xd1, 0x00}, {0x1e, 0x01}, {0x1f, 0x01}, + {0xbf, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00}, + {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc0, 0x00}, + {0xa9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0xa2, 0x00}, {0xa5, 0x00}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0xe3, 0x00}, {0xc3, 0x00}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00}, + /* 0xd0*/ + {0xba, 0x00}, {0xaa, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, + {0xc8, 0x00}, {0x00, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, + {0xcf, 0x00}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0xa6, 0x00}, {0xcc, 0x00}, {0x80, 0x25}, + /* 0xe0*/ + {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0xd2, 0x00}, + {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0x00, 0x00}, + {0xd7, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00}, + {0xec, 0x00}, {0xff, 0x00}, {0xaf, 0x00}, {0xb4, 0x00}, + /* 0xf0*/ + {0xad, 0x00}, {0xb1, 0x00}, {0x00, 0x00}, {0xbe, 0x00}, + {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00}, + {0xb0, 0x00}, {0xa8, 0x00}, {0xb7, 0x00}, {0xb9, 0x00}, + {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0xad, 0xbd, 0x9c, 0xcf, 0xbe, 0xdd, 0xf5, /* 0xa0-0xa7 */ + 0xf9, 0xb8, 0xd1, 0xae, 0xaa, 0xf0, 0xa9, 0xee, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0xfd, 0xfc, 0xef, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */ + 0xf7, 0xfb, 0xd0, 0xaf, 0xac, 0xab, 0xf3, 0xa8, /* 0xb8-0xbf */ + 0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */ + 0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, /* 0xc8-0xcf */ + 0x00, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0xe8, /* 0xd0-0xd7 */ + 0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ + 0x85, 0xa0, 0x83, 0xc6, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */ + 0x8a, 0x82, 0x88, 0x89, 0xec, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */ + 0x00, 0xa4, 0x95, 0xa2, 0x93, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */ + 0x9b, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0xed, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa7, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x98, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x9f, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ + 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ + 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ + 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0x00, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0x00, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp857", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp857(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp857(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp860.c linux/fs/nls/nls_cp860.c --- v2.1.59/linux/fs/nls/nls_cp860.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp860.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,411 @@ +/* + * linux/fs/nls_cp860.c + * + * Charset cp860 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, + {0xe3, 0x00}, {0xe0, 0x00}, {0xc1, 0x00}, {0xe7, 0x00}, + {0xea, 0x00}, {0xca, 0x00}, {0xe8, 0x00}, {0xcd, 0x00}, + {0xd4, 0x00}, {0xec, 0x00}, {0xc3, 0x00}, {0xc2, 0x00}, + /* 0x90*/ + {0xc9, 0x00}, {0xc0, 0x00}, {0xc8, 0x00}, {0xf4, 0x00}, + {0xf5, 0x00}, {0xf2, 0x00}, {0xda, 0x00}, {0xf9, 0x00}, + {0xcc, 0x00}, {0xd5, 0x00}, {0xdc, 0x00}, {0xa2, 0x00}, + {0xa3, 0x00}, {0xd9, 0x00}, {0xa7, 0x20}, {0xd3, 0x00}, + /* 0xa0*/ + {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, + {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00}, + {0xbf, 0x00}, {0xd2, 0x00}, {0xac, 0x00}, {0xbd, 0x00}, + {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, + {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, + /* 0xd0*/ + {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, + {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, + {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, + /* 0xe0*/ + {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, + {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, + {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, + {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, + /* 0xf0*/ + {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, + {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, + {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, + {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0xad, 0x9b, 0x9c, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */ + 0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */ + 0x91, 0x86, 0x8f, 0x8e, 0x00, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */ + 0x92, 0x90, 0x89, 0x00, 0x98, 0x8b, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0xa5, 0xa9, 0x9f, 0x8c, 0x99, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x9d, 0x96, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ + 0x85, 0xa0, 0x83, 0x84, 0x00, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */ + 0x8a, 0x82, 0x88, 0x00, 0x8d, 0xa1, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0xa4, 0x95, 0xa2, 0x93, 0x94, 0x00, 0xf6, /* 0xf0-0xf7 */ + 0x00, 0x97, 0xa3, 0x00, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page03[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ + 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page23[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ + 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ + 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ + 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, page03, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, page22, page23, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, /* 0x80-0x87 */ + 0x00, 0x89, 0x00, 0x8b, 0x8c, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x96, 0x00, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp860", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp860(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp860(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp861.c linux/fs/nls/nls_cp861.c --- v2.1.59/linux/fs/nls/nls_cp861.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp861.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,447 @@ +/* + * linux/fs/nls_cp861.c + * + * Charset cp861 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, + {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, + {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xd0, 0x00}, + {0xf0, 0x00}, {0xde, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, + /* 0x90*/ + {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00}, + {0xf6, 0x00}, {0xfe, 0x00}, {0xfb, 0x00}, {0xdd, 0x00}, + {0xfd, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00}, + {0xa3, 0x00}, {0xd8, 0x00}, {0xa7, 0x20}, {0x92, 0x01}, + /* 0xa0*/ + {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, + {0xc1, 0x00}, {0xcd, 0x00}, {0xd3, 0x00}, {0xda, 0x00}, + {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00}, + {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, + {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, + /* 0xd0*/ + {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, + {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, + {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, + /* 0xe0*/ + {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, + {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, + {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, + {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, + /* 0xf0*/ + {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, + {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, + {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, + {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0xad, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */ + 0x00, 0xa4, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */ + 0x00, 0x90, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, /* 0xc8-0xcf */ + 0x8b, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */ + 0x9d, 0x00, 0xa7, 0x00, 0x9a, 0x97, 0x8d, 0xe1, /* 0xd8-0xdf */ + 0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */ + 0x8a, 0x82, 0x88, 0x89, 0x00, 0xa1, 0x00, 0x00, /* 0xe8-0xef */ + 0x8c, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */ + 0x9b, 0x00, 0xa3, 0x96, 0x81, 0x98, 0x95, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page03[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ + 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page23[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ + 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ + 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ + 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, NULL, page03, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, page22, page23, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x8b, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x97, /* 0x90-0x97 */ + 0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp861", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp861(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp861(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp862.c linux/fs/nls/nls_cp862.c --- v2.1.59/linux/fs/nls/nls_cp862.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp862.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,483 @@ +/* + * linux/fs/nls_cp862.c + * + * Charset cp862 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0xd0, 0x05}, {0xd1, 0x05}, {0xd2, 0x05}, {0xd3, 0x05}, + {0xd4, 0x05}, {0xd5, 0x05}, {0xd6, 0x05}, {0xd7, 0x05}, + {0xd8, 0x05}, {0xd9, 0x05}, {0xda, 0x05}, {0xdb, 0x05}, + {0xdc, 0x05}, {0xdd, 0x05}, {0xde, 0x05}, {0xdf, 0x05}, + /* 0x90*/ + {0xe0, 0x05}, {0xe1, 0x05}, {0xe2, 0x05}, {0xe3, 0x05}, + {0xe4, 0x05}, {0xe5, 0x05}, {0xe6, 0x05}, {0xe7, 0x05}, + {0xe8, 0x05}, {0xe9, 0x05}, {0xea, 0x05}, {0xa2, 0x00}, + {0xa3, 0x00}, {0xa5, 0x00}, {0xa7, 0x20}, {0x92, 0x01}, + /* 0xa0*/ + {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, + {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00}, + {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00}, + {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, + {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, + /* 0xd0*/ + {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, + {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, + {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, + /* 0xe0*/ + {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, + {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, + {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, + {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, + /* 0xf0*/ + {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, + {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, + {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, + {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0xad, 0x9b, 0x9c, 0x00, 0x9d, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */ + 0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ + 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0xa4, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */ + 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page03[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ + 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page05[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0xd0-0xd7 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0xd8-0xdf */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0xe0-0xe7 */ + 0x98, 0x99, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page23[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ + 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ + 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ + 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, NULL, page03, NULL, page05, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, page22, page23, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp862", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp862(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp862(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp863.c linux/fs/nls/nls_cp863.c --- v2.1.59/linux/fs/nls/nls_cp863.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp863.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,447 @@ +/* + * linux/fs/nls_cp863.c + * + * Charset cp863 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, + {0xc2, 0x00}, {0xe0, 0x00}, {0xb6, 0x00}, {0xe7, 0x00}, + {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00}, + {0xee, 0x00}, {0x17, 0x20}, {0xc0, 0x00}, {0xa7, 0x00}, + /* 0x90*/ + {0xc9, 0x00}, {0xc8, 0x00}, {0xca, 0x00}, {0xf4, 0x00}, + {0xcb, 0x00}, {0xcf, 0x00}, {0xfb, 0x00}, {0xf9, 0x00}, + {0xa4, 0x00}, {0xd4, 0x00}, {0xdc, 0x00}, {0xa2, 0x00}, + {0xa3, 0x00}, {0xd9, 0x00}, {0xdb, 0x00}, {0x92, 0x01}, + /* 0xa0*/ + {0xa6, 0x00}, {0xb4, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, + {0xa8, 0x00}, {0xb8, 0x00}, {0xb3, 0x00}, {0xaf, 0x00}, + {0xce, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00}, + {0xbc, 0x00}, {0xbe, 0x00}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, + {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, + /* 0xd0*/ + {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, + {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, + {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, + /* 0xe0*/ + {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, + {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, + {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, + {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, + /* 0xf0*/ + {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, + {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, + {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, + {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0x00, 0x9b, 0x9c, 0x98, 0x00, 0xa0, 0x8f, /* 0xa0-0xa7 */ + 0xa4, 0x00, 0x00, 0xae, 0xaa, 0x00, 0x00, 0xa7, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0xfd, 0xa6, 0xa1, 0xe6, 0x86, 0xfa, /* 0xb0-0xb7 */ + 0xa5, 0x00, 0x00, 0xaf, 0xac, 0xab, 0xad, 0x00, /* 0xb8-0xbf */ + 0x8e, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */ + 0x91, 0x90, 0x92, 0x94, 0x00, 0x00, 0xa8, 0x95, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x9d, 0x00, 0x9e, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ + 0x85, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */ + 0x8a, 0x82, 0x88, 0x89, 0x00, 0x00, 0x8c, 0x8b, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */ + 0x00, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page03[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ + 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page23[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ + 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ + 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ + 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, NULL, page03, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, page22, page23, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x00, 0x00, 0x00, 0x84, 0x00, 0x86, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x00, 0x94, 0x95, 0x00, 0x00, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ + 0xa0, 0xa1, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp863", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp863(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp863(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp864.c linux/fs/nls/nls_cp864.c --- v2.1.59/linux/fs/nls/nls_cp864.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp864.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,438 @@ +/* + * linux/fs/nls_cp864.c + * + * Charset cp864 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x6a, 0x06}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0xb0, 0x00}, {0xb7, 0x00}, {0x19, 0x22}, {0x1a, 0x22}, + {0x92, 0x25}, {0x00, 0x25}, {0x02, 0x25}, {0x3c, 0x25}, + {0x24, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x34, 0x25}, + {0x10, 0x25}, {0x0c, 0x25}, {0x14, 0x25}, {0x18, 0x25}, + /* 0x90*/ + {0xb2, 0x03}, {0x1e, 0x22}, {0xc6, 0x03}, {0xb1, 0x00}, + {0xbd, 0x00}, {0xbc, 0x00}, {0x48, 0x22}, {0xab, 0x00}, + {0xbb, 0x00}, {0xf7, 0xfe}, {0xf8, 0xfe}, {0x00, 0x00}, + {0x00, 0x00}, {0xfb, 0xfe}, {0xfc, 0xfe}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0xad, 0x00}, {0x82, 0xfe}, {0xa3, 0x00}, + {0xa4, 0x00}, {0x84, 0xfe}, {0x00, 0x00}, {0x00, 0x00}, + {0x8e, 0xfe}, {0x8f, 0xfe}, {0x95, 0xfe}, {0x99, 0xfe}, + {0x0c, 0x06}, {0x9d, 0xfe}, {0xa1, 0xfe}, {0xa5, 0xfe}, + /* 0xb0*/ + {0x60, 0x06}, {0x61, 0x06}, {0x62, 0x06}, {0x63, 0x06}, + {0x64, 0x06}, {0x65, 0x06}, {0x66, 0x06}, {0x67, 0x06}, + {0x68, 0x06}, {0x69, 0x06}, {0xd1, 0xfe}, {0x1b, 0x06}, + {0xb1, 0xfe}, {0xb5, 0xfe}, {0xb9, 0xfe}, {0x1f, 0x06}, + /* 0xc0*/ + {0xa2, 0x00}, {0x80, 0xfe}, {0x81, 0xfe}, {0x83, 0xfe}, + {0x85, 0xfe}, {0xca, 0xfe}, {0x8b, 0xfe}, {0x8d, 0xfe}, + {0x91, 0xfe}, {0x93, 0xfe}, {0x97, 0xfe}, {0x9b, 0xfe}, + {0x9f, 0xfe}, {0xa3, 0xfe}, {0xa7, 0xfe}, {0xa9, 0xfe}, + /* 0xd0*/ + {0xab, 0xfe}, {0xad, 0xfe}, {0xaf, 0xfe}, {0xb3, 0xfe}, + {0xb7, 0xfe}, {0xbb, 0xfe}, {0xbf, 0xfe}, {0xc1, 0xfe}, + {0xc5, 0xfe}, {0xcb, 0xfe}, {0xcf, 0xfe}, {0xa6, 0x00}, + {0xac, 0x00}, {0xf7, 0x00}, {0xd7, 0x00}, {0xc9, 0xfe}, + /* 0xe0*/ + {0x40, 0x06}, {0xd3, 0xfe}, {0xd7, 0xfe}, {0xdb, 0xfe}, + {0xdf, 0xfe}, {0xe3, 0xfe}, {0xe7, 0xfe}, {0xeb, 0xfe}, + {0xed, 0xfe}, {0xef, 0xfe}, {0xf3, 0xfe}, {0xbd, 0xfe}, + {0xcc, 0xfe}, {0xce, 0xfe}, {0xcd, 0xfe}, {0xe1, 0xfe}, + /* 0xf0*/ + {0x7d, 0xfe}, {0x51, 0x06}, {0xe5, 0xfe}, {0xe9, 0xfe}, + {0xec, 0xfe}, {0xf0, 0xfe}, {0xf2, 0xfe}, {0xd0, 0xfe}, + {0xd5, 0xfe}, {0xf5, 0xfe}, {0xf6, 0xfe}, {0xdd, 0xfe}, + {0xd9, 0xfe}, {0xf1, 0xfe}, {0xa0, 0x25}, {0x00, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x00, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0x00, 0xc0, 0xa3, 0xa4, 0x00, 0xdb, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x97, 0xdc, 0xa1, 0x00, 0x00, /* 0xa8-0xaf */ + 0x80, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x98, 0x95, 0x94, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page03[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page06[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x60-0x67 */ + 0xb8, 0xb9, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x82, 0x83, 0x00, 0x00, 0x00, 0x91, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0x85, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x8c, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x8f, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char pagefe[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, /* 0x78-0x7f */ + + 0xc1, 0xc2, 0xa2, 0xc3, 0xa5, 0xc4, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc7, 0xa8, 0xa9, /* 0x88-0x8f */ + 0x00, 0xc8, 0x00, 0xc9, 0x00, 0xaa, 0x00, 0xca, /* 0x90-0x97 */ + 0x00, 0xab, 0x00, 0xcb, 0x00, 0xad, 0x00, 0xcc, /* 0x98-0x9f */ + 0x00, 0xae, 0x00, 0xcd, 0x00, 0xaf, 0x00, 0xce, /* 0xa0-0xa7 */ + 0x00, 0xcf, 0x00, 0xd0, 0x00, 0xd1, 0x00, 0xd2, /* 0xa8-0xaf */ + 0x00, 0xbc, 0x00, 0xd3, 0x00, 0xbd, 0x00, 0xd4, /* 0xb0-0xb7 */ + 0x00, 0xbe, 0x00, 0xd5, 0x00, 0xeb, 0x00, 0xd6, /* 0xb8-0xbf */ + 0x00, 0xd7, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0xdf, 0xc5, 0xd9, 0xec, 0xee, 0xed, 0xda, /* 0xc8-0xcf */ + 0xf7, 0xba, 0x00, 0xe1, 0x00, 0xf8, 0x00, 0xe2, /* 0xd0-0xd7 */ + 0x00, 0xfc, 0x00, 0xe3, 0x00, 0xfb, 0x00, 0xe4, /* 0xd8-0xdf */ + 0x00, 0xef, 0x00, 0xe5, 0x00, 0xf2, 0x00, 0xe6, /* 0xe0-0xe7 */ + 0x00, 0xf3, 0x00, 0xe7, 0xf4, 0xe8, 0x00, 0xe9, /* 0xe8-0xef */ + 0xf5, 0xfd, 0xf6, 0xea, 0x00, 0xf9, 0xfa, 0x99, /* 0xf0-0xf7 */ + 0x9a, 0x00, 0x00, 0x9d, 0x9e, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, page03, NULL, NULL, page06, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, page22, NULL, NULL, page25, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, pagefe, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp864", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp864(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp864(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp865.c linux/fs/nls/nls_cp865.c --- v2.1.59/linux/fs/nls/nls_cp865.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp865.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,447 @@ +/* + * linux/fs/nls_cp865.c + * + * Charset cp865 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00}, + {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00}, + {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00}, + {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00}, + /* 0x90*/ + {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00}, + {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00}, + {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00}, + {0xa3, 0x00}, {0xd8, 0x00}, {0xa7, 0x20}, {0x92, 0x01}, + /* 0xa0*/ + {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00}, + {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00}, + {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00}, + {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xa4, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, + {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, + /* 0xd0*/ + {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, + {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, + {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, + /* 0xe0*/ + {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03}, + {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03}, + {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03}, + {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22}, + /* 0xf0*/ + {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22}, + {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22}, + {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, + {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0xad, 0x00, 0x9c, 0xaf, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */ + 0x00, 0x00, 0xa7, 0x00, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */ + 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */ + 0x9d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */ + 0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */ + 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */ + 0x00, 0xa4, 0x95, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */ + 0x9b, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x98, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page03[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */ + 0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page23[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ + 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ + 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ + 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, NULL, page03, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, page22, page23, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp865", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp865(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp865(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp866.c linux/fs/nls/nls_cp866.c --- v2.1.59/linux/fs/nls/nls_cp866.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp866.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,375 @@ +/* + * linux/fs/nls_cp866.c + * + * Charset cp866 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x10, 0x04}, {0x11, 0x04}, {0x12, 0x04}, {0x13, 0x04}, + {0x14, 0x04}, {0x15, 0x04}, {0x16, 0x04}, {0x17, 0x04}, + {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04}, + {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, {0x1f, 0x04}, + /* 0x90*/ + {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04}, + {0x24, 0x04}, {0x25, 0x04}, {0x26, 0x04}, {0x27, 0x04}, + {0x28, 0x04}, {0x29, 0x04}, {0x2a, 0x04}, {0x2b, 0x04}, + {0x2c, 0x04}, {0x2d, 0x04}, {0x2e, 0x04}, {0x2f, 0x04}, + /* 0xa0*/ + {0x30, 0x04}, {0x31, 0x04}, {0x32, 0x04}, {0x33, 0x04}, + {0x34, 0x04}, {0x35, 0x04}, {0x36, 0x04}, {0x37, 0x04}, + {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04}, + {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, {0x3f, 0x04}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25}, + {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25}, + /* 0xd0*/ + {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25}, + {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25}, + {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25}, + /* 0xe0*/ + {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04}, + {0x44, 0x04}, {0x45, 0x04}, {0x46, 0x04}, {0x47, 0x04}, + {0x48, 0x04}, {0x49, 0x04}, {0x4a, 0x04}, {0x4b, 0x04}, + {0x4c, 0x04}, {0x4d, 0x04}, {0x4e, 0x04}, {0x4f, 0x04}, + /* 0xf0*/ + {0x01, 0x04}, {0x51, 0x04}, {0x04, 0x04}, {0x54, 0x04}, + {0x07, 0x04}, {0x57, 0x04}, {0x0e, 0x04}, {0x5e, 0x04}, + {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22}, + {0x16, 0x21}, {0xa4, 0x00}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page04[256] = { + 0x00, 0xf0, 0x00, 0x00, 0xf2, 0x00, 0x00, 0xf4, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, /* 0x08-0x0f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x30-0x37 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x38-0x3f */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */ + 0x00, 0xf1, 0x00, 0x00, 0xf3, 0x00, 0x00, 0xf5, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page21[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */ + 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */ + 0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */ + 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, page21, page22, NULL, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0xf0, 0x00, 0xf2, 0x00, 0xf4, 0x00, 0xf6, 0x00, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp866", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp866(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp866(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp869.c linux/fs/nls/nls_cp869.c --- v2.1.59/linux/fs/nls/nls_cp869.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp869.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,339 @@ +/* + * linux/fs/nls_cp869.c + * + * Charset cp869 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x86, 0x03}, {0x00, 0x00}, + {0xb7, 0x00}, {0xac, 0x00}, {0xa6, 0x00}, {0x18, 0x20}, + {0x19, 0x20}, {0x88, 0x03}, {0x15, 0x20}, {0x89, 0x03}, + /* 0x90*/ + {0x8a, 0x03}, {0xaa, 0x03}, {0x8c, 0x03}, {0x00, 0x00}, + {0x00, 0x00}, {0x8e, 0x03}, {0xab, 0x03}, {0xa9, 0x00}, + {0x8f, 0x03}, {0xb2, 0x00}, {0xb3, 0x00}, {0xac, 0x03}, + {0xa3, 0x00}, {0xad, 0x03}, {0xae, 0x03}, {0xaf, 0x03}, + /* 0xa0*/ + {0xca, 0x03}, {0x90, 0x03}, {0xcc, 0x03}, {0xcd, 0x03}, + {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, {0x94, 0x03}, + {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, {0xbd, 0x00}, + {0x98, 0x03}, {0x99, 0x03}, {0xab, 0x00}, {0xbb, 0x00}, + /* 0xb0*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25}, + {0x24, 0x25}, {0x9a, 0x03}, {0x9b, 0x03}, {0x9c, 0x03}, + {0x9d, 0x03}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25}, + {0x5d, 0x25}, {0x9e, 0x03}, {0x9f, 0x03}, {0x10, 0x25}, + /* 0xc0*/ + {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, + {0x00, 0x25}, {0x3c, 0x25}, {0xa0, 0x03}, {0xa1, 0x03}, + {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25}, + {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa3, 0x03}, + /* 0xd0*/ + {0xa4, 0x03}, {0xa5, 0x03}, {0xa6, 0x03}, {0xa7, 0x03}, + {0xa8, 0x03}, {0xa9, 0x03}, {0xb1, 0x03}, {0xb2, 0x03}, + {0xb3, 0x03}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25}, + {0x84, 0x25}, {0xb4, 0x03}, {0xb5, 0x03}, {0x80, 0x25}, + /* 0xe0*/ + {0xb6, 0x03}, {0xb7, 0x03}, {0xb8, 0x03}, {0xb9, 0x03}, + {0xba, 0x03}, {0xbb, 0x03}, {0xbc, 0x03}, {0xbd, 0x03}, + {0xbe, 0x03}, {0xbf, 0x03}, {0xc0, 0x03}, {0xc1, 0x03}, + {0xc3, 0x03}, {0xc2, 0x03}, {0xc4, 0x03}, {0x84, 0x03}, + /* 0xf0*/ + {0xad, 0x00}, {0xb1, 0x00}, {0xc5, 0x03}, {0xc6, 0x03}, + {0xc7, 0x03}, {0xa7, 0x00}, {0xc8, 0x03}, {0x85, 0x03}, + {0xb0, 0x00}, {0xa8, 0x00}, {0xc9, 0x03}, {0xcb, 0x03}, + {0xb0, 0x03}, {0xce, 0x03}, {0xa0, 0x25}, {0xa0, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xff, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x8a, 0xf5, /* 0xa0-0xa7 */ + 0xf9, 0x97, 0x00, 0xae, 0x89, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */ + 0xf8, 0xf1, 0x99, 0x9a, 0x00, 0x00, 0x00, 0x88, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0xaf, 0x00, 0xab, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page03[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0xef, 0xf7, 0x86, 0x00, /* 0x80-0x87 */ + 0x8d, 0x8f, 0x90, 0x00, 0x92, 0x00, 0x95, 0x98, /* 0x88-0x8f */ + 0xa1, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, /* 0x90-0x97 */ + 0xac, 0xad, 0xb5, 0xb6, 0xb7, 0xb8, 0xbd, 0xbe, /* 0x98-0x9f */ + 0xc6, 0xc7, 0x00, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, /* 0xa0-0xa7 */ + 0xd4, 0xd5, 0x91, 0x96, 0x9b, 0x9d, 0x9e, 0x9f, /* 0xa8-0xaf */ + 0xfc, 0xd6, 0xd7, 0xd8, 0xdd, 0xde, 0xe0, 0xe1, /* 0xb0-0xb7 */ + 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, /* 0xb8-0xbf */ + 0xea, 0xeb, 0xed, 0xec, 0xee, 0xf2, 0xf3, 0xf4, /* 0xc0-0xc7 */ + 0xf6, 0xfa, 0xa0, 0xfb, 0xa2, 0xa3, 0xfd, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, /* 0x10-0x17 */ + 0x8b, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */ + 0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */ + 0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */ + 0x00, 0xca, 0x00, 0x00, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, page03, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, NULL, NULL, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x00, 0x9c, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0x00, 0x00, 0x00, 0xf5, 0x00, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp869", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp869(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp869(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_cp874.c linux/fs/nls/nls_cp874.c --- v2.1.59/linux/fs/nls/nls_cp874.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_cp874.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,303 @@ +/* + * linux/fs/nls_cp874.c + * + * Charset cp874 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x26, 0x20}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0x90*/ + {0x00, 0x00}, {0x18, 0x20}, {0x19, 0x20}, {0x1c, 0x20}, + {0x1d, 0x20}, {0x22, 0x20}, {0x13, 0x20}, {0x14, 0x20}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0x01, 0x0e}, {0x02, 0x0e}, {0x03, 0x0e}, + {0x04, 0x0e}, {0x05, 0x0e}, {0x06, 0x0e}, {0x07, 0x0e}, + {0x08, 0x0e}, {0x09, 0x0e}, {0x0a, 0x0e}, {0x0b, 0x0e}, + {0x0c, 0x0e}, {0x0d, 0x0e}, {0x0e, 0x0e}, {0x0f, 0x0e}, + /* 0xb0*/ + {0x10, 0x0e}, {0x11, 0x0e}, {0x12, 0x0e}, {0x13, 0x0e}, + {0x14, 0x0e}, {0x15, 0x0e}, {0x16, 0x0e}, {0x17, 0x0e}, + {0x18, 0x0e}, {0x19, 0x0e}, {0x1a, 0x0e}, {0x1b, 0x0e}, + {0x1c, 0x0e}, {0x1d, 0x0e}, {0x1e, 0x0e}, {0x1f, 0x0e}, + /* 0xc0*/ + {0x20, 0x0e}, {0x21, 0x0e}, {0x22, 0x0e}, {0x23, 0x0e}, + {0x24, 0x0e}, {0x25, 0x0e}, {0x26, 0x0e}, {0x27, 0x0e}, + {0x28, 0x0e}, {0x29, 0x0e}, {0x2a, 0x0e}, {0x2b, 0x0e}, + {0x2c, 0x0e}, {0x2d, 0x0e}, {0x2e, 0x0e}, {0x2f, 0x0e}, + /* 0xd0*/ + {0x30, 0x0e}, {0x31, 0x0e}, {0x32, 0x0e}, {0x33, 0x0e}, + {0x34, 0x0e}, {0x35, 0x0e}, {0x36, 0x0e}, {0x37, 0x0e}, + {0x38, 0x0e}, {0x39, 0x0e}, {0x3a, 0x0e}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x3f, 0x0e}, + /* 0xe0*/ + {0x40, 0x0e}, {0x41, 0x0e}, {0x42, 0x0e}, {0x43, 0x0e}, + {0x44, 0x0e}, {0x45, 0x0e}, {0x46, 0x0e}, {0x47, 0x0e}, + {0x48, 0x0e}, {0x49, 0x0e}, {0x4a, 0x0e}, {0x4b, 0x0e}, + {0x4c, 0x0e}, {0x4d, 0x0e}, {0x4e, 0x0e}, {0x4f, 0x0e}, + /* 0xf0*/ + {0x50, 0x0e}, {0x51, 0x0e}, {0x52, 0x0e}, {0x53, 0x0e}, + {0x54, 0x0e}, {0x55, 0x0e}, {0x56, 0x0e}, {0x57, 0x0e}, + {0x58, 0x0e}, {0x59, 0x0e}, {0x5a, 0x0e}, {0x5b, 0x0e}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page0e[256] = { + 0x00, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x00-0x07 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x08-0x0f */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x10-0x17 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x18-0x1f */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */ + 0xd8, 0xd9, 0xda, 0x00, 0x00, 0x00, 0x00, 0xdf, /* 0x38-0x3f */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x50-0x57 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x91, 0x92, 0x00, 0x00, 0x93, 0x94, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, page0e, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "cp874", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_cp874(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_cp874(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_iso8859-1.c linux/fs/nls/nls_iso8859-1.c --- v2.1.59/linux/fs/nls/nls_iso8859-1.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_iso8859-1.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,227 @@ +/* + * linux/fs/nls_iso8859-1.c + * + * Charset iso8859-1 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0x90*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, + {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00}, + {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00}, + {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00}, + /* 0xb0*/ + {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, + {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00}, + {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00}, + {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00}, + /* 0xc0*/ + {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00}, + {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00}, + {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, + {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, + /* 0xd0*/ + {0xd0, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00}, + {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00}, + {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, + {0xdc, 0x00}, {0xdd, 0x00}, {0xde, 0x00}, {0xdf, 0x00}, + /* 0xe0*/ + {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, + {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00}, + {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, + {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00}, + /* 0xf0*/ + {0xf0, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00}, + {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00}, + {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00}, + {0xfc, 0x00}, {0xfd, 0x00}, {0xfe, 0x00}, {0xff, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "iso8859-1", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_iso8859_1(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_iso8859_1(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_iso8859-2.c linux/fs/nls/nls_iso8859-2.c --- v2.1.59/linux/fs/nls/nls_iso8859-2.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_iso8859-2.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,299 @@ +/* + * linux/fs/nls_iso8859-2.c + * + * Charset iso8859-2 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0x90*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0x04, 0x01}, {0xd8, 0x02}, {0x41, 0x01}, + {0xa4, 0x00}, {0x3d, 0x01}, {0x5a, 0x01}, {0xa7, 0x00}, + {0xa8, 0x00}, {0x60, 0x01}, {0x5e, 0x01}, {0x64, 0x01}, + {0x79, 0x01}, {0xad, 0x00}, {0x7d, 0x01}, {0x7b, 0x01}, + /* 0xb0*/ + {0xb0, 0x00}, {0x05, 0x01}, {0xdb, 0x02}, {0x42, 0x01}, + {0xb4, 0x00}, {0x3e, 0x01}, {0x5b, 0x01}, {0xc7, 0x02}, + {0xb8, 0x00}, {0x61, 0x01}, {0x5f, 0x01}, {0x65, 0x01}, + {0x7a, 0x01}, {0xdd, 0x02}, {0x7e, 0x01}, {0x7c, 0x01}, + /* 0xc0*/ + {0x54, 0x01}, {0xc1, 0x00}, {0xc2, 0x00}, {0x02, 0x01}, + {0xc4, 0x00}, {0x39, 0x01}, {0x06, 0x01}, {0xc7, 0x00}, + {0x0c, 0x01}, {0xc9, 0x00}, {0x18, 0x01}, {0xcb, 0x00}, + {0x1a, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0x0e, 0x01}, + /* 0xd0*/ + {0x10, 0x01}, {0x43, 0x01}, {0x47, 0x01}, {0xd3, 0x00}, + {0xd4, 0x00}, {0x50, 0x01}, {0xd6, 0x00}, {0xd7, 0x00}, + {0x58, 0x01}, {0x6e, 0x01}, {0xda, 0x00}, {0x70, 0x01}, + {0xdc, 0x00}, {0xdd, 0x00}, {0x62, 0x01}, {0xdf, 0x00}, + /* 0xe0*/ + {0x55, 0x01}, {0xe1, 0x00}, {0xe2, 0x00}, {0x03, 0x01}, + {0xe4, 0x00}, {0x3a, 0x01}, {0x07, 0x01}, {0xe7, 0x00}, + {0x0d, 0x01}, {0xe9, 0x00}, {0x19, 0x01}, {0xeb, 0x00}, + {0x1b, 0x01}, {0xed, 0x00}, {0xee, 0x00}, {0x0f, 0x01}, + /* 0xf0*/ + {0x11, 0x01}, {0x44, 0x01}, {0x48, 0x01}, {0xf3, 0x00}, + {0xf4, 0x00}, {0x51, 0x01}, {0xf6, 0x00}, {0xf7, 0x00}, + {0x59, 0x01}, {0x6f, 0x01}, {0xfa, 0x00}, {0x71, 0x01}, + {0xfc, 0x00}, {0xfd, 0x00}, {0x63, 0x01}, {0xd9, 0x02}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ + 0xb0, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, /* 0xc0-0xc7 */ + 0x00, 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0xce, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0x00, 0x00, 0xda, 0x00, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */ + 0x00, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, /* 0xe0-0xe7 */ + 0x00, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0xee, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0x00, 0x00, 0xfa, 0x00, 0xfc, 0xfd, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0xc3, 0xe3, 0xa1, 0xb1, 0xc6, 0xe6, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0xcf, 0xef, /* 0x08-0x0f */ + 0xd0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0xca, 0xea, 0xcc, 0xec, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0xc5, 0xe5, 0x00, 0x00, 0xa5, 0xb5, 0x00, /* 0x38-0x3f */ + 0x00, 0xa3, 0xb3, 0xd1, 0xf1, 0x00, 0x00, 0xd2, /* 0x40-0x47 */ + 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xd5, 0xf5, 0x00, 0x00, 0xc0, 0xe0, 0x00, 0x00, /* 0x50-0x57 */ + 0xd8, 0xf8, 0xa6, 0xb6, 0x00, 0x00, 0xaa, 0xba, /* 0x58-0x5f */ + 0xa9, 0xb9, 0xde, 0xfe, 0xab, 0xbb, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd9, 0xf9, /* 0x68-0x6f */ + 0xdb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0xac, 0xbc, 0xaf, 0xbf, 0xae, 0xbe, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page02[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0xa2, 0xff, 0x00, 0xb2, 0x00, 0xbd, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, page02, NULL, NULL, NULL, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0x00, 0xb2, 0x00, 0xb4, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "iso8859-2", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_iso8859_2(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_iso8859_2(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_iso8859-3.c linux/fs/nls/nls_iso8859-3.c --- v2.1.59/linux/fs/nls/nls_iso8859-3.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_iso8859-3.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,299 @@ +/* + * linux/fs/nls_iso8859-3.c + * + * Charset iso8859-3 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0x90*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0x26, 0x01}, {0xd8, 0x02}, {0xa3, 0x00}, + {0xa4, 0x00}, {0x00, 0x00}, {0x24, 0x01}, {0xa7, 0x00}, + {0xa8, 0x00}, {0x30, 0x01}, {0x5e, 0x01}, {0x1e, 0x01}, + {0x34, 0x01}, {0xad, 0x00}, {0x00, 0x00}, {0x7b, 0x01}, + /* 0xb0*/ + {0xb0, 0x00}, {0x27, 0x01}, {0xb2, 0x00}, {0xb3, 0x00}, + {0xb4, 0x00}, {0xb5, 0x00}, {0x25, 0x01}, {0xb7, 0x00}, + {0xb8, 0x00}, {0x31, 0x01}, {0x5f, 0x01}, {0x1f, 0x01}, + {0x35, 0x01}, {0xbd, 0x00}, {0x00, 0x00}, {0x7c, 0x01}, + /* 0xc0*/ + {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0x00, 0x00}, + {0xc4, 0x00}, {0x0a, 0x01}, {0x08, 0x01}, {0xc7, 0x00}, + {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, + {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, + /* 0xd0*/ + {0x00, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00}, + {0xd4, 0x00}, {0x20, 0x01}, {0xd6, 0x00}, {0xd7, 0x00}, + {0x1c, 0x01}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, + {0xdc, 0x00}, {0x6c, 0x01}, {0x5c, 0x01}, {0xdf, 0x00}, + /* 0xe0*/ + {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0x00, 0x00}, + {0xe4, 0x00}, {0x0b, 0x01}, {0x09, 0x01}, {0xe7, 0x00}, + {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, + {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00}, + /* 0xf0*/ + {0x00, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00}, + {0xf4, 0x00}, {0x21, 0x01}, {0xf6, 0x00}, {0xf7, 0x00}, + {0x1d, 0x01}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00}, + {0xfc, 0x00}, {0x6d, 0x01}, {0x5d, 0x01}, {0xd9, 0x02}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0x00, 0x00, 0xa3, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ + 0xb0, 0x00, 0xb2, 0xb3, 0xb4, 0xb5, 0x00, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0x00, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0xc6, 0xe6, 0xc5, 0xe5, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0xd8, 0xf8, 0xab, 0xbb, /* 0x18-0x1f */ + 0xd5, 0xf5, 0x00, 0x00, 0xa6, 0xb6, 0xa1, 0xb1, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0xa9, 0xb9, 0x00, 0x00, 0xac, 0xbc, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0xde, 0xfe, 0xaa, 0xba, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0xdd, 0xfd, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0xaf, 0xbf, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page02[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0xa2, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, page02, NULL, NULL, NULL, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0x00, 0xb2, 0xb3, 0xb4, 0xb5, 0x00, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xbe, 0x00, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "iso8859-3", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_iso8859_3(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_iso8859_3(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_iso8859-4.c linux/fs/nls/nls_iso8859-4.c --- v2.1.59/linux/fs/nls/nls_iso8859-4.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_iso8859-4.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,299 @@ +/* + * linux/fs/nls_iso8859-4.c + * + * Charset iso8859-4 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0x90*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0x04, 0x01}, {0x38, 0x01}, {0x56, 0x01}, + {0xa4, 0x00}, {0x28, 0x01}, {0x3b, 0x01}, {0xa7, 0x00}, + {0xa8, 0x00}, {0x60, 0x01}, {0x12, 0x01}, {0x22, 0x01}, + {0x66, 0x01}, {0xad, 0x00}, {0x7d, 0x01}, {0xaf, 0x00}, + /* 0xb0*/ + {0xb0, 0x00}, {0x05, 0x01}, {0xdb, 0x02}, {0x57, 0x01}, + {0xb4, 0x00}, {0x29, 0x01}, {0x3c, 0x01}, {0xc7, 0x02}, + {0xb8, 0x00}, {0x61, 0x01}, {0x13, 0x01}, {0x23, 0x01}, + {0x67, 0x01}, {0x4a, 0x01}, {0x7e, 0x01}, {0x4b, 0x01}, + /* 0xc0*/ + {0x00, 0x01}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00}, + {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0x2e, 0x01}, + {0x0c, 0x01}, {0xc9, 0x00}, {0x18, 0x01}, {0xcb, 0x00}, + {0x16, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0x2a, 0x01}, + /* 0xd0*/ + {0x10, 0x01}, {0x45, 0x01}, {0x4c, 0x01}, {0x36, 0x01}, + {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00}, + {0xd8, 0x00}, {0x72, 0x01}, {0xda, 0x00}, {0xdb, 0x00}, + {0xdc, 0x00}, {0x68, 0x01}, {0x6a, 0x01}, {0xdf, 0x00}, + /* 0xe0*/ + {0x01, 0x01}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, + {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0x2f, 0x01}, + {0x0d, 0x01}, {0xe9, 0x00}, {0x19, 0x01}, {0xeb, 0x00}, + {0x17, 0x01}, {0xed, 0x00}, {0xee, 0x00}, {0x2b, 0x01}, + /* 0xf0*/ + {0x11, 0x01}, {0x46, 0x01}, {0x4d, 0x01}, {0x37, 0x01}, + {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00}, + {0xf8, 0x00}, {0x73, 0x01}, {0xfa, 0x00}, {0xfb, 0x00}, + {0xfc, 0x00}, {0x69, 0x01}, {0x6b, 0x01}, {0xd9, 0x02}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0x00, /* 0xc0-0xc7 */ + 0x00, 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0xce, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0x00, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */ + 0x00, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */ + 0x00, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0xee, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0x00, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0xc0, 0xe0, 0x00, 0x00, 0xa1, 0xb1, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0x00, 0x00, /* 0x08-0x0f */ + 0xd0, 0xf0, 0xaa, 0xba, 0x00, 0x00, 0xcc, 0xec, /* 0x10-0x17 */ + 0xca, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0xab, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0xa5, 0xb5, 0xcf, 0xef, 0x00, 0x00, 0xc7, 0xe7, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0xf3, /* 0x30-0x37 */ + 0xa2, 0x00, 0x00, 0xa6, 0xb6, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xf1, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0xbd, 0xbf, 0xd2, 0xf2, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0xb3, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0xa9, 0xb9, 0x00, 0x00, 0x00, 0x00, 0xac, 0xbc, /* 0x60-0x67 */ + 0xdd, 0xfd, 0xde, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0xd9, 0xf9, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0xbe, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page02[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0xff, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, page02, NULL, NULL, NULL, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0x00, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0x00, 0xb2, 0x00, 0xb4, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "iso8859-4", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_iso8859_4(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_iso8859_4(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_iso8859-5.c linux/fs/nls/nls_iso8859-5.c --- v2.1.59/linux/fs/nls/nls_iso8859-5.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_iso8859-5.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,303 @@ +/* + * linux/fs/nls_iso8859-5.c + * + * Charset iso8859-5 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0x90*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0x01, 0x04}, {0x02, 0x04}, {0x03, 0x04}, + {0x04, 0x04}, {0x05, 0x04}, {0x06, 0x04}, {0x07, 0x04}, + {0x08, 0x04}, {0x09, 0x04}, {0x0a, 0x04}, {0x0b, 0x04}, + {0x0c, 0x04}, {0xad, 0x00}, {0x0e, 0x04}, {0x0f, 0x04}, + /* 0xb0*/ + {0x10, 0x04}, {0x11, 0x04}, {0x12, 0x04}, {0x13, 0x04}, + {0x14, 0x04}, {0x15, 0x04}, {0x16, 0x04}, {0x17, 0x04}, + {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04}, + {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, {0x1f, 0x04}, + /* 0xc0*/ + {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04}, + {0x24, 0x04}, {0x25, 0x04}, {0x26, 0x04}, {0x27, 0x04}, + {0x28, 0x04}, {0x29, 0x04}, {0x2a, 0x04}, {0x2b, 0x04}, + {0x2c, 0x04}, {0x2d, 0x04}, {0x2e, 0x04}, {0x2f, 0x04}, + /* 0xd0*/ + {0x30, 0x04}, {0x31, 0x04}, {0x32, 0x04}, {0x33, 0x04}, + {0x34, 0x04}, {0x35, 0x04}, {0x36, 0x04}, {0x37, 0x04}, + {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04}, + {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, {0x3f, 0x04}, + /* 0xe0*/ + {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04}, + {0x44, 0x04}, {0x45, 0x04}, {0x46, 0x04}, {0x47, 0x04}, + {0x48, 0x04}, {0x49, 0x04}, {0x4a, 0x04}, {0x4b, 0x04}, + {0x4c, 0x04}, {0x4d, 0x04}, {0x4e, 0x04}, {0x4f, 0x04}, + /* 0xf0*/ + {0x16, 0x21}, {0x51, 0x04}, {0x52, 0x04}, {0x53, 0x04}, + {0x54, 0x04}, {0x55, 0x04}, {0x56, 0x04}, {0x57, 0x04}, + {0x58, 0x04}, {0x59, 0x04}, {0x5a, 0x04}, {0x5b, 0x04}, + {0x5c, 0x04}, {0xa7, 0x00}, {0x5e, 0x04}, {0x5f, 0x04}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page04[256] = { + 0x00, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x00-0x07 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0x00, 0xae, 0xaf, /* 0x08-0x0f */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x10-0x17 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x18-0x1f */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0x38-0x3f */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */ + 0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x50-0x57 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0xfe, 0xff, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page21[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, page21, NULL, NULL, NULL, NULL, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "iso8859-5", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_iso8859_5(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_iso8859_5(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_iso8859-6.c linux/fs/nls/nls_iso8859-6.c --- v2.1.59/linux/fs/nls/nls_iso8859-6.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_iso8859-6.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,263 @@ +/* + * linux/fs/nls_iso8859-6.c + * + * Charset iso8859-6 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x60, 0x06}, {0x61, 0x06}, {0x62, 0x06}, {0x63, 0x06}, + {0x64, 0x06}, {0x65, 0x06}, {0x66, 0x06}, {0x67, 0x06}, + {0x68, 0x06}, {0x69, 0x06}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0x90*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0xa4, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x0c, 0x06}, {0xad, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xb0*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x1b, 0x06}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x1f, 0x06}, + /* 0xc0*/ + {0x00, 0x00}, {0x21, 0x06}, {0x22, 0x06}, {0x23, 0x06}, + {0x24, 0x06}, {0x25, 0x06}, {0x26, 0x06}, {0x27, 0x06}, + {0x28, 0x06}, {0x29, 0x06}, {0x2a, 0x06}, {0x2b, 0x06}, + {0x2c, 0x06}, {0x2d, 0x06}, {0x2e, 0x06}, {0x2f, 0x06}, + /* 0xd0*/ + {0x30, 0x06}, {0x31, 0x06}, {0x32, 0x06}, {0x33, 0x06}, + {0x34, 0x06}, {0x35, 0x06}, {0x36, 0x06}, {0x37, 0x06}, + {0x38, 0x06}, {0x39, 0x06}, {0x3a, 0x06}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xe0*/ + {0x40, 0x06}, {0x41, 0x06}, {0x42, 0x06}, {0x43, 0x06}, + {0x44, 0x06}, {0x45, 0x06}, {0x46, 0x06}, {0x47, 0x06}, + {0x48, 0x06}, {0x49, 0x06}, {0x4a, 0x06}, {0x4b, 0x06}, + {0x4c, 0x06}, {0x4d, 0x06}, {0x4e, 0x06}, {0x4f, 0x06}, + /* 0xf0*/ + {0x50, 0x06}, {0x51, 0x06}, {0x52, 0x06}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page06[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 0x18-0x1f */ + 0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */ + 0xd8, 0xd9, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */ + 0xf0, 0xf1, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x60-0x67 */ + 0x38, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, NULL, NULL, NULL, page06, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "iso8859-6", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_iso8859_6(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_iso8859_6(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_iso8859-7.c linux/fs/nls/nls_iso8859-7.c --- v2.1.59/linux/fs/nls/nls_iso8859-7.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_iso8859-7.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,339 @@ +/* + * linux/fs/nls_iso8859-7.c + * + * Charset iso8859-7 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0x90*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0xbd, 0x02}, {0xbc, 0x02}, {0xa3, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0xa6, 0x00}, {0xa7, 0x00}, + {0xa8, 0x00}, {0xa9, 0x00}, {0x00, 0x00}, {0xab, 0x00}, + {0xac, 0x00}, {0xad, 0x00}, {0x00, 0x00}, {0x15, 0x20}, + /* 0xb0*/ + {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, + {0x84, 0x03}, {0x85, 0x03}, {0x86, 0x03}, {0xb7, 0x00}, + {0x88, 0x03}, {0x89, 0x03}, {0x8a, 0x03}, {0xbb, 0x00}, + {0x8c, 0x03}, {0xbd, 0x00}, {0x8e, 0x03}, {0x8f, 0x03}, + /* 0xc0*/ + {0x90, 0x03}, {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, + {0x94, 0x03}, {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, + {0x98, 0x03}, {0x99, 0x03}, {0x9a, 0x03}, {0x9b, 0x03}, + {0x9c, 0x03}, {0x9d, 0x03}, {0x9e, 0x03}, {0x9f, 0x03}, + /* 0xd0*/ + {0xa0, 0x03}, {0xa1, 0x03}, {0x00, 0x00}, {0xa3, 0x03}, + {0xa4, 0x03}, {0xa5, 0x03}, {0xa6, 0x03}, {0xa7, 0x03}, + {0xa8, 0x03}, {0xa9, 0x03}, {0xaa, 0x03}, {0xab, 0x03}, + {0xac, 0x03}, {0xad, 0x03}, {0xae, 0x03}, {0xaf, 0x03}, + /* 0xe0*/ + {0xb0, 0x03}, {0xb1, 0x03}, {0xb2, 0x03}, {0xb3, 0x03}, + {0xb4, 0x03}, {0xb5, 0x03}, {0xb6, 0x03}, {0xb7, 0x03}, + {0xb8, 0x03}, {0xb9, 0x03}, {0xba, 0x03}, {0xbb, 0x03}, + {0xbc, 0x03}, {0xbd, 0x03}, {0xbe, 0x03}, {0xbf, 0x03}, + /* 0xf0*/ + {0xc0, 0x03}, {0xc1, 0x03}, {0xc2, 0x03}, {0xc3, 0x03}, + {0xc4, 0x03}, {0xc5, 0x03}, {0xc6, 0x03}, {0xc7, 0x03}, + {0xc8, 0x03}, {0xc9, 0x03}, {0xca, 0x03}, {0xcb, 0x03}, + {0xcc, 0x03}, {0xcd, 0x03}, {0xce, 0x03}, {0x00, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0x00, 0x00, 0xa3, 0x00, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0x00, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0xbb, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page02[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0xa2, 0xa1, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page03[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0xb4, 0xb5, 0xb6, 0x00, /* 0x80-0x87 */ + 0xb8, 0xb9, 0xba, 0x00, 0xbc, 0x00, 0xbe, 0xbf, /* 0x88-0x8f */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x90-0x97 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x98-0x9f */ + 0xd0, 0xd1, 0x00, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xa0-0xa7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xa8-0xaf */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xb0-0xb7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xb8-0xbf */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xc0-0xc7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, page02, page03, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "iso8859-7", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_iso8859_7(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_iso8859_7(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_iso8859-8.c linux/fs/nls/nls_iso8859-8.c --- v2.1.59/linux/fs/nls/nls_iso8859-8.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_iso8859-8.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,303 @@ +/* + * linux/fs/nls_iso8859-8.c + * + * Charset iso8859-8 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0x90*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0x00, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, + {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00}, + {0xa8, 0x00}, {0xa9, 0x00}, {0xd7, 0x00}, {0xab, 0x00}, + {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0x3e, 0x20}, + /* 0xb0*/ + {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, + {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00}, + {0xb8, 0x00}, {0xb9, 0x00}, {0xf7, 0x00}, {0xbb, 0x00}, + {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0x00, 0x00}, + /* 0xc0*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xd0*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x17, 0x20}, + /* 0xe0*/ + {0xd0, 0x05}, {0xd1, 0x05}, {0xd2, 0x05}, {0xd3, 0x05}, + {0xd4, 0x05}, {0xd5, 0x05}, {0xd6, 0x05}, {0xd7, 0x05}, + {0xd8, 0x05}, {0xd9, 0x05}, {0xda, 0x05}, {0xdb, 0x05}, + {0xdc, 0x05}, {0xdd, 0x05}, {0xde, 0x05}, {0xdf, 0x05}, + /* 0xf0*/ + {0xe0, 0x05}, {0xe1, 0x05}, {0xe2, 0x05}, {0xe3, 0x05}, + {0xe4, 0x05}, {0xe5, 0x05}, {0xe6, 0x05}, {0xe7, 0x05}, + {0xe8, 0x05}, {0xe9, 0x05}, {0xea, 0x05}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0x00, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0xae, 0x00, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0x00, 0xbb, 0xbc, 0xbd, 0xbe, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page05[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xd0-0xd7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xd8-0xdf */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xe0-0xe7 */ + 0xf8, 0xf9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page20[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, NULL, NULL, page05, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "iso8859-8", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_iso8859_8(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_iso8859_8(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_iso8859-9.c linux/fs/nls/nls_iso8859-9.c --- v2.1.59/linux/fs/nls/nls_iso8859-9.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_iso8859-9.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,263 @@ +/* + * linux/fs/nls_iso8859-9.c + * + * Charset iso8859-9 translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0x90*/ + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, + /* 0xa0*/ + {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00}, + {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00}, + {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00}, + {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00}, + /* 0xb0*/ + {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00}, + {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00}, + {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00}, + {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00}, + /* 0xc0*/ + {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00}, + {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00}, + {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00}, + {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00}, + /* 0xd0*/ + {0x1e, 0x01}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00}, + {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00}, + {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, + {0xdc, 0x00}, {0x30, 0x01}, {0x5e, 0x01}, {0xdf, 0x00}, + /* 0xe0*/ + {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00}, + {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00}, + {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00}, + {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00}, + /* 0xf0*/ + {0x1f, 0x01}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00}, + {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00}, + {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00}, + {0xfc, 0x00}, {0x31, 0x01}, {0x5f, 0x01}, {0xff, 0x00}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff, /* 0xf8-0xff */ +}; + +static unsigned char page01[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xf0, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0xdd, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xfe, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "iso8859-9", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_iso8859_9(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_iso8859_9(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/nls/nls_koi8-r.c linux/fs/nls/nls_koi8-r.c --- v2.1.59/linux/fs/nls/nls_koi8-r.c Wed Dec 31 16:00:00 1969 +++ linux/fs/nls/nls_koi8-r.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,375 @@ +/* + * linux/fs/nls_koi8-r.c + * + * Charset koi8-r translation tables. + * Generated automatically from the Unicode and charset + * tables from the Unicode Organization (www.unicode.org). + * The Unicode to charset table has only exact mappings. + */ + +#include +#include +#include +#include + +static struct nls_unicode charset2uni[256] = { + /* 0x00*/ + {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00}, + {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00}, + {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00}, + {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, + /* 0x10*/ + {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00}, + {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00}, + {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00}, + {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, + /* 0x20*/ + {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00}, + {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, + {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, + /* 0x30*/ + {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, + {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00}, + {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00}, + {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00}, + /* 0x40*/ + {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00}, + {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00}, + {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00}, + {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00}, + /* 0x50*/ + {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00}, + {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00}, + {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00}, + {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00}, + /* 0x60*/ + {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00}, + {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00}, + {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00}, + {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00}, + /* 0x70*/ + {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00}, + {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00}, + {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00}, + {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00}, + /* 0x80*/ + {0x00, 0x25}, {0x02, 0x25}, {0x0c, 0x25}, {0x10, 0x25}, + {0x14, 0x25}, {0x18, 0x25}, {0x1c, 0x25}, {0x24, 0x25}, + {0x2c, 0x25}, {0x34, 0x25}, {0x3c, 0x25}, {0x80, 0x25}, + {0x84, 0x25}, {0x88, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, + /* 0x90*/ + {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x20, 0x23}, + {0xa0, 0x25}, {0x19, 0x22}, {0x1a, 0x22}, {0x48, 0x22}, + {0x64, 0x22}, {0x65, 0x22}, {0xa0, 0x00}, {0x21, 0x23}, + {0xb0, 0x00}, {0xb2, 0x00}, {0xb7, 0x00}, {0xf7, 0x00}, + /* 0xa0*/ + {0x50, 0x25}, {0x51, 0x25}, {0x52, 0x25}, {0x51, 0x04}, + {0x53, 0x25}, {0x54, 0x25}, {0x55, 0x25}, {0x56, 0x25}, + {0x57, 0x25}, {0x58, 0x25}, {0x59, 0x25}, {0x5a, 0x25}, + {0x5b, 0x25}, {0x5c, 0x25}, {0x5d, 0x25}, {0x5e, 0x25}, + /* 0xb0*/ + {0x5f, 0x25}, {0x60, 0x25}, {0x61, 0x25}, {0x01, 0x04}, + {0x62, 0x25}, {0x63, 0x25}, {0x64, 0x25}, {0x65, 0x25}, + {0x66, 0x25}, {0x67, 0x25}, {0x68, 0x25}, {0x69, 0x25}, + {0x6a, 0x25}, {0x6b, 0x25}, {0x6c, 0x25}, {0xa9, 0x00}, + /* 0xc0*/ + {0x4e, 0x04}, {0x30, 0x04}, {0x31, 0x04}, {0x46, 0x04}, + {0x34, 0x04}, {0x35, 0x04}, {0x44, 0x04}, {0x33, 0x04}, + {0x45, 0x04}, {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, + {0x3b, 0x04}, {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, + /* 0xd0*/ + {0x3f, 0x04}, {0x4f, 0x04}, {0x40, 0x04}, {0x41, 0x04}, + {0x42, 0x04}, {0x43, 0x04}, {0x36, 0x04}, {0x32, 0x04}, + {0x4c, 0x04}, {0x4b, 0x04}, {0x37, 0x04}, {0x48, 0x04}, + {0x4d, 0x04}, {0x49, 0x04}, {0x47, 0x04}, {0x4a, 0x04}, + /* 0xe0*/ + {0x2e, 0x04}, {0x10, 0x04}, {0x11, 0x04}, {0x26, 0x04}, + {0x14, 0x04}, {0x15, 0x04}, {0x24, 0x04}, {0x13, 0x04}, + {0x25, 0x04}, {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, + {0x1b, 0x04}, {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, + /* 0xf0*/ + {0x1f, 0x04}, {0x2f, 0x04}, {0x20, 0x04}, {0x21, 0x04}, + {0x22, 0x04}, {0x23, 0x04}, {0x16, 0x04}, {0x12, 0x04}, + {0x2c, 0x04}, {0x2b, 0x04}, {0x17, 0x04}, {0x28, 0x04}, + {0x2d, 0x04}, {0x29, 0x04}, {0x27, 0x04}, {0x2a, 0x04}, +}; + +static unsigned char page00[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */ + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */ + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */ + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x9c, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page04[256] = { + 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */ + 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, /* 0x18-0x1f */ + 0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, /* 0x20-0x27 */ + 0xfb, 0xfd, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1, /* 0x28-0x2f */ + 0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda, /* 0x30-0x37 */ + 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, /* 0x38-0x3f */ + 0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, /* 0x40-0x47 */ + 0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1, /* 0x48-0x4f */ + 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page22[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x95, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x98, 0x99, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page23[256] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x93, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char page25[256] = { + 0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ + 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, /* 0x08-0x0f */ + 0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* 0x10-0x17 */ + 0x85, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, /* 0x18-0x1f */ + 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, /* 0x20-0x27 */ + 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, /* 0x28-0x2f */ + 0x00, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, /* 0x30-0x37 */ + 0x00, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, /* 0x38-0x3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ + 0xa0, 0xa1, 0xa2, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, /* 0x50-0x57 */ + 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, /* 0x58-0x5f */ + 0xb1, 0xb2, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, /* 0x60-0x67 */ + 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ + + 0x8b, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, /* 0x80-0x87 */ + 0x8d, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, /* 0x88-0x8f */ + 0x8f, 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */ + 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ +}; + +static unsigned char *page_uni2charset[256] = { + page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, page22, page23, NULL, page25, NULL, NULL, +}; + +static unsigned char charset2upper[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */ + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */ + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */ + 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ + 0x00, 0x00, 0x00, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */ + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */ + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */ + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */ + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */ + 0xa0, 0xa1, 0xa2, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */ + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */ + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */ + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */ + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ +}; + + +static void inc_use_count(void) +{ + MOD_INC_USE_COUNT; +} + +static void dec_use_count(void) +{ + MOD_DEC_USE_COUNT; +} + +static struct nls_table table = { + "koi8-r", + page_uni2charset, + charset2uni, + inc_use_count, + dec_use_count, + NULL +}; + +int init_nls_koi8_r(void) +{ + return register_nls(&table); +} + +#ifdef MODULE +int init_module(void) +{ + return init_nls_koi8_r(); +} + + +void cleanup_module(void) +{ + unregister_nls(&table); + return; +} +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-indent-level: 8 + * c-brace-imaginary-offset: 0 + * c-brace-offset: -8 + * c-argdecl-indent: 8 + * c-label-offset: -8 + * c-continued-statement-offset: 8 + * c-continued-brace-offset: 0 + * End: + */ diff -u --recursive --new-file v2.1.59/linux/fs/pipe.c linux/fs/pipe.c --- v2.1.59/linux/fs/pipe.c Wed Sep 24 20:05:48 1997 +++ linux/fs/pipe.c Tue Oct 21 08:57:29 1997 @@ -33,12 +33,16 @@ /* in case of paging and multiple read/write on the same pipe. (FGC) */ -static long pipe_read(struct inode * inode, struct file * filp, - char * buf, unsigned long count) +static ssize_t pipe_read(struct file * filp, char * buf, + size_t count, loff_t *ppos) { - int chars = 0, size = 0, read = 0; + struct inode * inode = filp->f_dentry->d_inode; + ssize_t chars = 0, size = 0, read = 0; char *pipebuf; + if (ppos != &filp->f_pos) + return -ESPIPE; + if (filp->f_flags & O_NONBLOCK) { if (PIPE_LOCK(*inode)) return -EAGAIN; @@ -83,17 +87,21 @@ return 0; } -static long pipe_write(struct inode * inode, struct file * filp, - const char * buf, unsigned long count) +static ssize_t pipe_write(struct file * filp, const char * buf, + size_t count, loff_t *ppos) { - int chars = 0, free = 0, written = 0; + struct inode * inode = filp->f_dentry->d_inode; + ssize_t chars = 0, free = 0, written = 0; char *pipebuf; + if (ppos != &filp->f_pos) + return -ESPIPE; + if (!PIPE_READERS(*inode)) { /* no readers */ send_sig(SIGPIPE,current,0); return -EPIPE; } -/* if count <= PIPE_BUF, we have to make it atomic */ + /* if count <= PIPE_BUF, we have to make it atomic */ if (count <= PIPE_BUF) free = count; else @@ -138,20 +146,20 @@ return -ESPIPE; } -static long bad_pipe_r(struct inode * inode, struct file * filp, - char * buf, unsigned long count) +static ssize_t bad_pipe_r(struct file * filp, char * buf, + size_t count, loff_t *ppos) { return -EBADF; } -static long bad_pipe_w(struct inode * inode, struct file * filp, - const char * buf, unsigned long count) +static ssize_t bad_pipe_w(struct file * filp, const char * buf, + size_t count, loff_t *ppos) { return -EBADF; } static int pipe_ioctl(struct inode *pino, struct file * filp, - unsigned int cmd, unsigned long arg) + unsigned int cmd, unsigned long arg) { switch (cmd) { case FIONREAD: @@ -206,13 +214,14 @@ * the open() code hasn't guaranteed a connection (O_NONBLOCK), * and we need to act differently until we do get a writer.. */ -static long connect_read(struct inode * inode, struct file * filp, - char * buf, unsigned long count) +static ssize_t connect_read(struct file * filp, char * buf, + size_t count, loff_t *ppos) { + struct inode * inode = filp->f_dentry->d_inode; if (PIPE_EMPTY(*inode) && !PIPE_WRITERS(*inode)) return 0; filp->f_op = &read_fifo_fops; - return pipe_read(inode,filp,buf,count); + return pipe_read(filp,buf,count,ppos); } static unsigned int connect_poll(struct file * filp, poll_table * wait) diff -u --recursive --new-file v2.1.59/linux/fs/proc/array.c linux/fs/proc/array.c --- v2.1.59/linux/fs/proc/array.c Wed Oct 15 16:04:23 1997 +++ linux/fs/proc/array.c Tue Oct 21 08:57:29 1997 @@ -61,12 +61,12 @@ #endif -static long read_core(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t read_core(struct file * file, char * buf, + size_t count, loff_t *ppos) { - unsigned long p = file->f_pos, memsize; - int read; - int count1; + unsigned long p = *ppos, memsize; + ssize_t read; + ssize_t count1; char * pnt; struct user dump; #if defined (__i386__) || defined (__mc68000__) @@ -101,16 +101,21 @@ read += count1; } - while (count > 0 && p < PAGE_SIZE + FIRST_MAPPED) { - put_user(0,buf); - buf++; - p++; - count--; - read++; + if (count > 0 && p < PAGE_SIZE + FIRST_MAPPED) { + count1 = PAGE_SIZE + FIRST_MAPPED - p; + if (count1 > count) + count1 = count; + clear_user(buf, count1); + buf += count1; + p += count1; + count -= count1; + read += count1; } - copy_to_user(buf, (void *) (PAGE_OFFSET + p - PAGE_SIZE), count); - read += count; - file->f_pos += read; + if (count > 0) { + copy_to_user(buf, (void *) (PAGE_OFFSET+p-PAGE_SIZE), count); + read += count; + } + *ppos += read; return read; } @@ -129,11 +134,11 @@ * buffer. Use of the program readprofile is recommended in order to * get meaningful info out of these data. */ -static long read_profile(struct inode *inode, struct file *file, - char *buf, unsigned long count) +static ssize_t read_profile(struct file *file, char *buf, + size_t count, loff_t *ppos) { - unsigned long p = file->f_pos; - int read; + unsigned long p = *ppos; + ssize_t read; char * pnt; unsigned int sample_step = 1 << prof_shift; @@ -143,14 +148,14 @@ count = (prof_len+1)*sizeof(unsigned int) - p; read = 0; - while (p < sizeof(unsigned long) && count > 0) { + while (p < sizeof(unsigned int) && count > 0) { put_user(*((char *)(&sample_step)+p),buf); buf++; p++; count--; read++; } pnt = (char *)prof_buffer + p - sizeof(unsigned int); copy_to_user(buf,(void *)pnt,count); read += count; - file->f_pos += read; + *ppos += read; return read; } @@ -160,10 +165,9 @@ * Writing a 'profiling multiplier' value into it also re-sets the profiling * interrupt frequency, on architectures that support this. */ -static long write_profile(struct inode * inode, struct file * file, - const char * buf, unsigned long count) +static ssize_t write_profile(struct file * file, const char * buf, + size_t count, loff_t *ppos) { - int i=prof_len; #ifdef __SMP__ extern int setup_profiling_timer (unsigned int multiplier); @@ -178,8 +182,7 @@ } #endif - while (i--) - prof_buffer[i]=0UL; + memset(prof_buffer, 0, prof_len * sizeof(*prof_buffer)); return count; } @@ -923,14 +926,15 @@ #define MAPS_LINE_MAX MAPS_LINE_MAX8 -static long read_maps (int pid, struct file * file, char * buf, - unsigned long count) +static ssize_t read_maps (int pid, struct file * file, char * buf, + size_t count, loff_t *ppos) { struct task_struct *p; struct vm_area_struct * map, * next; char * destptr = buf, * buffer; loff_t lineno; - int column, i, volatile_task; + ssize_t column, i; + int volatile_task; long retval; /* @@ -953,8 +957,8 @@ volatile_task = (p != current || p->mm->count > 1); /* decode f_pos */ - lineno = file->f_pos >> MAPS_LINE_SHIFT; - column = file->f_pos & (MAPS_LINE_LENGTH-1); + lineno = *ppos >> MAPS_LINE_SHIFT; + column = *ppos & (MAPS_LINE_LENGTH-1); /* quickly go to line lineno */ for (map = p->mm->mmap, i = 0; map && (i < lineno); map = map->vm_next, i++) @@ -1002,7 +1006,6 @@ kdevname(dev), ino); if(map->vm_dentry) { - int i; for(i = len; i < maxlen; i++) line[i] = ' '; len = buffer + PAGE_SIZE - line; @@ -1038,7 +1041,7 @@ } /* encode f_pos */ - file->f_pos = (lineno << MAPS_LINE_SHIFT) + column; + *ppos = (lineno << MAPS_LINE_SHIFT) + column; getlen_out: retval = destptr - buf; @@ -1192,13 +1195,14 @@ #define PROC_BLOCK_SIZE (3*1024) /* 4K page size but our output routines use some slack for overruns */ -static long array_read(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t array_read(struct file * file, char * buf, + size_t count, loff_t *ppos) { + struct inode * inode = file->f_dentry->d_inode; unsigned long page; char *start; - int length; - int end; + ssize_t length; + ssize_t end; unsigned int type, pid; struct proc_dir_entry *dp; @@ -1212,11 +1216,11 @@ start = NULL; dp = (struct proc_dir_entry *) inode->u.generic_ip; if (dp->get_info) - length = dp->get_info((char *)page, &start, file->f_pos, + length = dp->get_info((char *)page, &start, *ppos, count, 0); else length = fill_array((char *) page, pid, type, - &start, file->f_pos, count); + &start, *ppos, count); if (length < 0) { free_page(page); return length; @@ -1224,19 +1228,19 @@ if (start != NULL) { /* We have had block-adjusting processing! */ copy_to_user(buf, start, length); - file->f_pos += length; + *ppos += length; count = length; } else { /* Static 4kB (or whatever) block capacity */ - if (file->f_pos >= length) { + if (*ppos >= length) { free_page(page); return 0; } - if (count + file->f_pos > length) - count = length - file->f_pos; - end = count + file->f_pos; - copy_to_user(buf, (char *) page + file->f_pos, count); - file->f_pos = end; + if (count + *ppos > length) + count = length - *ppos; + end = count + *ppos; + copy_to_user(buf, (char *) page + *ppos, count); + *ppos = end; } free_page(page); return count; @@ -1275,15 +1279,16 @@ NULL /* permission */ }; -static long arraylong_read(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t arraylong_read(struct file * file, char * buf, + size_t count, loff_t *ppos) { + struct inode * inode = file->f_dentry->d_inode; unsigned int pid = inode->i_ino >> 16; unsigned int type = inode->i_ino & 0x0000ffff; switch (type) { case PROC_PID_MAPS: - return read_maps(pid, file, buf, count); + return read_maps(pid, file, buf, count, ppos); } return -EINVAL; } diff -u --recursive --new-file v2.1.59/linux/fs/proc/generic.c linux/fs/proc/generic.c --- v2.1.59/linux/fs/proc/generic.c Wed Oct 15 16:04:23 1997 +++ linux/fs/proc/generic.c Tue Oct 21 08:57:29 1997 @@ -18,10 +18,10 @@ extern struct inode_operations proc_dyna_dir_inode_operations; -static long proc_file_read(struct inode * inode, struct file * file, - char * buf, unsigned long nbytes); -static long proc_file_write(struct inode * inode, struct file * file, - const char * buffer, unsigned long count); +static ssize_t proc_file_read(struct file * file, char * buf, + size_t nbytes, loff_t *ppos); +static ssize_t proc_file_write(struct file * file, const char * buffer, + size_t count, loff_t *ppos); static long long proc_file_lseek(struct file *, long long, int); int proc_match(int len, const char *name,struct proc_dir_entry * de) @@ -97,18 +97,17 @@ /* 4K page size but our output routines use some slack for overruns */ #define PROC_BLOCK_SIZE (3*1024) -static long proc_file_read(struct inode * inode, struct file * file, - char * buf, unsigned long nbytes) +static ssize_t +proc_file_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos) { + struct inode * inode = file->f_dentry->d_inode; char *page; - int retval=0; + ssize_t retval=0; int eof=0; - int n, count; + ssize_t n, count; char *start; struct proc_dir_entry * dp; - if (nbytes < 0) - return -EINVAL; dp = (struct proc_dir_entry *) inode->u.generic_ip; if (!(page = (char*) __get_free_page(GFP_KERNEL))) return -ENOMEM; @@ -126,12 +125,12 @@ * XXX What gives with the file->f_flags & O_ACCMODE * test? Seems stupid to me.... */ - n = dp->get_info(page, &start, file->f_pos, count, + n = dp->get_info(page, &start, *ppos, count, (file->f_flags & O_ACCMODE) == O_RDWR); if (n < count) eof = 1; } else if (dp->read_proc) { - n = dp->read_proc(page, &start, file->f_pos, + n = dp->read_proc(page, &start, *ppos, count, &eof, dp->data); } else break; @@ -140,8 +139,8 @@ /* * For proc files that are less than 4k */ - start = page + file->f_pos; - n -= file->f_pos; + start = page + *ppos; + n -= *ppos; if (n <= 0) break; if (n > count) @@ -162,7 +161,7 @@ break; } - file->f_pos += n; /* Move down the file */ + *ppos += n; /* Move down the file */ nbytes -= n; buf += n; retval += n; @@ -171,24 +170,25 @@ return retval; } -static long -proc_file_write(struct inode * inode, struct file * file, - const char * buffer, unsigned long count) +static ssize_t +proc_file_write(struct file * file, const char * buffer, + size_t count, loff_t *ppos) { + struct inode *inode = file->f_dentry->d_inode; struct proc_dir_entry * dp; - if (count < 0) - return -EINVAL; dp = (struct proc_dir_entry *) inode->u.generic_ip; if (!dp->write_proc) return -EIO; + /* FIXME: does this routine need ppos? probably... */ return dp->write_proc(file, buffer, count, dp->data); } -static long long proc_file_lseek(struct file * file, long long offset, int orig) +static long long +proc_file_lseek(struct file * file, long long offset, int orig) { switch (orig) { case 0: diff -u --recursive --new-file v2.1.59/linux/fs/proc/kmsg.c linux/fs/proc/kmsg.c --- v2.1.59/linux/fs/proc/kmsg.c Sat Jul 5 20:53:22 1997 +++ linux/fs/proc/kmsg.c Tue Oct 21 08:57:29 1997 @@ -30,8 +30,8 @@ return 0; } -static long kmsg_read(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t kmsg_read(struct file * file, char * buf, + size_t count, loff_t *ppos) { return sys_syslog(2,buf,count); } diff -u --recursive --new-file v2.1.59/linux/fs/proc/mem.c linux/fs/proc/mem.c --- v2.1.59/linux/fs/proc/mem.c Wed Sep 24 20:05:48 1997 +++ linux/fs/proc/mem.c Tue Oct 21 08:57:29 1997 @@ -70,9 +70,10 @@ return tsk; } -static long mem_read(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t mem_read(struct file * file, char * buf, + size_t count, loff_t *ppos) { + struct inode * inode = file->f_dentry->d_inode; pgd_t *page_dir; pmd_t *page_middle; pte_t pte; @@ -80,17 +81,17 @@ struct task_struct * tsk; unsigned long addr; char *tmp; - int i; + ssize_t scount, i; tsk = get_task(inode->i_ino >> 16); if (!tsk) return -ESRCH; - addr = file->f_pos; - count = check_range(tsk->mm, addr, count); - if (count < 0) - return count; + addr = *ppos; + scount = check_range(tsk->mm, addr, count); + if (scount < 0) + return scount; tmp = buf; - while (count > 0) { + while (scount > 0) { if (signal_pending(current)) break; page_dir = pgd_offset(tsk->mm,addr); @@ -114,22 +115,23 @@ break; page = (char *) pte_page(pte) + (addr & ~PAGE_MASK); i = PAGE_SIZE-(addr & ~PAGE_MASK); - if (i > count) - i = count; + if (i > scount) + i = scount; copy_to_user(tmp, page, i); addr += i; tmp += i; - count -= i; + scount -= i; } - file->f_pos = addr; + *ppos = addr; return tmp-buf; } #ifndef mem_write -static long mem_write(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t mem_write(struct file * file, char * buf, + size_t count, loff_t *ppos) { + struct inode * inode = file->f_dentry->d_inode; pgd_t *page_dir; pmd_t *page_middle; pte_t pte; @@ -137,9 +139,9 @@ struct task_struct * tsk; unsigned long addr; char *tmp; - int i; + long i; - addr = file->f_pos; + addr = *ppos; tsk = get_task(inode->i_ino >> 16); if (!tsk) return -ESRCH; @@ -177,7 +179,7 @@ tmp += i; count -= i; } - file->f_pos = addr; + *ppos = addr; if (tmp != buf) return tmp-buf; if (signal_pending(current)) diff -u --recursive --new-file v2.1.59/linux/fs/proc/scsi.c linux/fs/proc/scsi.c --- v2.1.59/linux/fs/proc/scsi.c Tue Sep 23 16:48:49 1997 +++ linux/fs/proc/scsi.c Tue Oct 21 08:57:29 1997 @@ -29,10 +29,10 @@ #include /* forward references */ -static long proc_readscsi(struct inode * inode, struct file * file, - char * buf, unsigned long count); -static long proc_writescsi(struct inode * inode, struct file * file, - const char * buf, unsigned long count); +static ssize_t proc_readscsi(struct file * file, char * buf, + size_t count, loff_t *ppos); +static ssize_t proc_writescsi(struct file * file, const char * buf, + size_t count, loff_t *ppos); static long long proc_scsilseek(struct file *, long long, int); extern void build_proc_dir_hba_entries(uint); @@ -101,13 +101,14 @@ * use some slack for overruns */ -static long proc_readscsi(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t proc_readscsi(struct file * file, char * buf, + size_t count, loff_t *ppos) { - int length; - int bytes = count; - int copied = 0; - int thistime; + struct inode * inode = file->f_dentry->d_inode; + ssize_t length; + ssize_t bytes = count; + ssize_t copied = 0; + ssize_t thistime; char * page; char * start; @@ -121,9 +122,9 @@ if(dispatch_scsi_info_ptr) length = dispatch_scsi_info_ptr(inode->i_ino, page, &start, - file->f_pos, thistime, 0); + *ppos, thistime, 0); else - length = get_not_present_info(page, &start, file->f_pos, thistime); + length = get_not_present_info(page, &start, *ppos, thistime); if(length < 0) { free_page((ulong) page); return(length); @@ -140,7 +141,7 @@ * Copy the bytes */ copy_to_user(buf + copied, start, length); - file->f_pos += length; /* Move down the file */ + *ppos += length; /* Move down the file */ bytes -= length; copied += length; @@ -154,10 +155,11 @@ } -static long proc_writescsi(struct inode * inode, struct file * file, - const char * buf, unsigned long count) +static ssize_t proc_writescsi(struct file * file, const char * buf, + size_t count, loff_t *ppos) { - int ret = 0; + struct inode * inode = file->f_dentry->d_inode; + ssize_t ret = 0; char * page; if(count > PROC_BLOCK_SIZE) { diff -u --recursive --new-file v2.1.59/linux/fs/read_write.c linux/fs/read_write.c --- v2.1.59/linux/fs/read_write.c Tue Sep 23 16:48:49 1997 +++ linux/fs/read_write.c Tue Oct 21 08:57:29 1997 @@ -16,10 +16,11 @@ #include #include #include +#include #include -static long long default_llseek(struct file *file, long long offset, int origin) +static loff_t default_llseek(struct file *file, loff_t offset, int origin) { long long retval; @@ -42,9 +43,9 @@ return retval; } -static inline long long llseek(struct file *file, long long offset, unsigned int origin) +static inline loff_t llseek(struct file *file, loff_t offset, int origin) { - long long (*fn)(struct file *, long long, int); + loff_t (*fn)(struct file *, loff_t, int); fn = default_llseek; if (file->f_op && file->f_op->llseek) @@ -52,9 +53,9 @@ return fn(file, offset, origin); } -asmlinkage long sys_lseek(unsigned int fd, off_t offset, unsigned int origin) +asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin) { - long retval; + off_t retval; struct file * file; struct dentry * dentry; struct inode * inode; @@ -67,23 +68,23 @@ !(inode = dentry->d_inode)) goto bad; retval = -EINVAL; - if (origin > 2) - goto bad; - retval = llseek(file, offset, origin); + if (origin <= 2) + retval = llseek(file, offset, origin); bad: unlock_kernel(); return retval; } +#if !defined(__alpha__) && !defined(__sparc_v9__) asmlinkage int sys_llseek(unsigned int fd, unsigned long offset_high, unsigned long offset_low, loff_t * result, unsigned int origin) { - long retval; + int retval; struct file * file; struct dentry * dentry; struct inode * inode; - long long offset; + loff_t offset; lock_kernel(); retval = -EBADF; @@ -96,10 +97,10 @@ if (origin > 2) goto bad; - offset = llseek(file, (((unsigned long long) offset_high << 32) | offset_low), - origin); + offset = llseek(file, ((loff_t) offset_high << 32) | offset_low, + origin); - retval = offset; + retval = (int)offset & INT_MAX; if (offset >= 0) { retval = copy_to_user(result, &offset, sizeof(offset)); if (retval) @@ -109,120 +110,114 @@ unlock_kernel(); return retval; } +#endif -asmlinkage long sys_read(unsigned int fd, char * buf, unsigned long count) +asmlinkage ssize_t sys_read(unsigned int fd, char * buf, size_t count) { - int error; + ssize_t ret; struct file * file; - struct dentry * dentry; - struct inode * inode; - long (*read)(struct inode *, struct file *, char *, unsigned long); + ssize_t (*read)(struct file *, char *, size_t, loff_t *); lock_kernel(); - error = -EBADF; + + ret = -EBADF; file = fget(fd); if (!file) goto bad_file; - dentry = file->f_dentry; - if (!dentry) + ret = -EBADF; + if (!(file->f_mode & FMODE_READ)) goto out; - inode = dentry->d_inode; - if (!inode) + ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode, + file, file->f_pos, count); + if (ret) goto out; - error = -EBADF; - if (!(file->f_mode & 1)) - goto out; - error = locks_verify_area(FLOCK_VERIFY_READ,inode,file,file->f_pos,count); - if (error) - goto out; - error = -EINVAL; + ret = -EINVAL; if (!file->f_op || !(read = file->f_op->read)) goto out; - error = read(inode,file,buf,count); + ret = read(file, buf, count, &file->f_pos); out: fput(file); bad_file: unlock_kernel(); - return error; + return ret; } -asmlinkage long sys_write(unsigned int fd, const char * buf, unsigned long count) +asmlinkage ssize_t sys_write(unsigned int fd, const char * buf, size_t count) { - int error; + ssize_t ret; struct file * file; - struct dentry * dentry; struct inode * inode; - long (*write)(struct inode *, struct file *, const char *, unsigned long); + ssize_t (*write)(struct file *, const char *, size_t, loff_t *); lock_kernel(); - error = -EBADF; + + ret = -EBADF; file = fget(fd); if (!file) goto bad_file; - dentry = file->f_dentry; - if (!dentry) - goto out; - inode = dentry->d_inode; - if (!inode) + if (!(file->f_mode & FMODE_WRITE)) goto out; - if (!(file->f_mode & 2)) + inode = file->f_dentry->d_inode; + ret = locks_verify_area(FLOCK_VERIFY_WRITE, inode, file, + file->f_pos, count); + if (ret) goto out; - error = locks_verify_area(FLOCK_VERIFY_WRITE,inode,file,file->f_pos,count); - if (error) - goto out; - error = -EINVAL; + ret = -EINVAL; if (!file->f_op || !(write = file->f_op->write)) goto out; + down(&inode->i_sem); - error = write(inode,file,buf,count); + ret = write(file, buf, count, &file->f_pos); up(&inode->i_sem); out: fput(file); bad_file: unlock_kernel(); - return error; + return ret; } -typedef long (*IO_fn_t)(struct inode *, struct file *, char *, unsigned long); -static long do_readv_writev(int type, struct inode * inode, struct file * file, - const struct iovec * vector, unsigned long count) +static ssize_t do_readv_writev(int type, struct file *file, + const struct iovec * vector, + unsigned long count) { - unsigned long tot_len; + typedef ssize_t (*io_fn_t)(struct file *, char *, size_t, loff_t *); + + size_t tot_len; struct iovec iovstack[UIO_FASTIOV]; struct iovec *iov=iovstack; - long retval, i; - IO_fn_t fn; + ssize_t ret, i; + io_fn_t fn; + struct inode *inode; /* * First get the "struct iovec" from user memory and * verify all the pointers */ + ret = 0; if (!count) - return 0; + goto out_nofree; + ret = -EINVAL; if (count > UIO_MAXIOV) - return -EINVAL; + goto out_nofree; if (count > UIO_FASTIOV) { iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL); - if (!iov) - return -ENOMEM; - } - if (copy_from_user(iov, vector, count*sizeof(*vector))) { - if (iov != iovstack) - kfree(iov); - return -EFAULT; + ret = -ENOMEM; + if (!iov) goto out_nofree; } + ret = -EFAULT; + if (copy_from_user(iov, vector, count*sizeof(*vector))) + goto out; + tot_len = 0; for (i = 0 ; i < count ; i++) tot_len += iov[i].iov_len; - retval = locks_verify_area(type == VERIFY_READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, - inode, file, file->f_pos, tot_len); - if (retval) { - if (iov != iovstack) - kfree(iov); - return retval; - } + inode = file->f_dentry->d_inode; + ret = locks_verify_area((type == VERIFY_READ + ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE), + inode, file, file->f_pos, tot_len); + if (ret) goto out; /* * Then do the actual IO. Note that sockets need to be handled @@ -230,116 +225,165 @@ * iovec's natively */ if (inode->i_sock) { - int err; - err = sock_readv_writev(type, inode, file, iov, count, tot_len); - if (iov != iovstack) - kfree(iov); - return err; + ret = sock_readv_writev(type,inode,file,iov,count,tot_len); + goto out; } - if (!file->f_op) { - if (iov != iovstack) - kfree(iov); - return -EINVAL; - } + ret = -EINVAL; + if (!file->f_op) + goto out; + /* VERIFY_WRITE actually means a read, as we write to user space */ fn = file->f_op->read; if (type == VERIFY_READ) - fn = (IO_fn_t) file->f_op->write; + fn = (io_fn_t) file->f_op->write; + + ret = 0; vector = iov; while (count > 0) { void * base; - int len, nr; + size_t len; + ssize_t nr; base = vector->iov_base; len = vector->iov_len; vector++; count--; - /* Any particular reason why we do not grab the inode semaphore - * when doing writes here? -DaveM - */ - nr = fn(inode, file, base, len); + nr = fn(file, base, len, &file->f_pos); + if (nr < 0) { - if (retval) - break; - retval = nr; + if (!ret) ret = nr; break; } - retval += nr; + ret += nr; if (nr != len) break; } + +out: if (iov != iovstack) kfree(iov); - return retval; +out_nofree: + return ret; } -asmlinkage long sys_readv(unsigned long fd, const struct iovec * vector, unsigned long count) +asmlinkage ssize_t sys_readv(unsigned long fd, const struct iovec * vector, + unsigned long count) { struct file * file; - struct dentry * dentry; - struct inode * inode; - long err; + ssize_t ret; lock_kernel(); - err = -EBADF; - if (fd >= NR_OPEN) - goto out; - file = current->files->fd[fd]; + ret = -EBADF; + file = fget(fd); if (!file) + goto bad_file; + if (!(file->f_mode & FMODE_READ)) goto out; + ret = do_readv_writev(VERIFY_WRITE, file, vector, count); +out: + fput(file); +bad_file: + unlock_kernel(); + return ret; +} - if (!(file->f_mode & 1)) - goto out; +asmlinkage ssize_t sys_writev(unsigned long fd, const struct iovec * vector, + unsigned long count) +{ + struct file * file; + ssize_t ret; - dentry = file->f_dentry; - if (!dentry) - goto out; + lock_kernel(); - inode = dentry->d_inode; - if (!inode) + ret = -EBADF; + file = fget(fd); + if (!file) + goto bad_file; + if (!(file->f_mode & FMODE_WRITE)) goto out; - err = do_readv_writev(VERIFY_WRITE, inode, file, vector, count); + down(&file->f_dentry->d_inode->i_sem); + ret = do_readv_writev(VERIFY_READ, file, vector, count); + up(&file->f_dentry->d_inode->i_sem); + out: + fput(file); +bad_file: unlock_kernel(); - return err; + return ret; } -asmlinkage long sys_writev(unsigned long fd, const struct iovec * vector, unsigned long count) +/* From the Single Unix Spec: pread & pwrite act like lseek to pos + op + + lseek back to original location. They fail just like lseek does on + non-seekable files. */ + +asmlinkage ssize_t sys_pread(unsigned int fd, char * buf, + size_t count, loff_t pos) { - long error; + ssize_t ret; struct file * file; - struct dentry * dentry; - struct inode * inode; + ssize_t (*read)(struct file *, char *, size_t, loff_t *); lock_kernel(); - error = -EBADF; - if (fd >= NR_OPEN) + ret = -EBADF; + file = fget(fd); + if (!file) + goto bad_file; + if (!(file->f_mode & FMODE_READ)) + goto out; + ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode, + file, pos, count); + if (ret) goto out; + ret = -EINVAL; + if (!file->f_op || !(read = file->f_op->read)) + goto out; + if (pos < 0) + goto out; + ret = read(file, buf, count, &pos); +out: + fput(file); +bad_file: + unlock_kernel(); + return ret; +} + +asmlinkage ssize_t sys_pwrite(unsigned int fd, const char * buf, + size_t count, loff_t pos) +{ + ssize_t ret; + struct file * file; + ssize_t (*write)(struct file *, const char *, size_t, loff_t *); + + lock_kernel(); - file = current->files->fd[fd]; + ret = -EBADF; + file = fget(fd); if (!file) + goto bad_file; + if (!(file->f_mode & FMODE_WRITE)) goto out; - - if (!(file->f_mode & 2)) + ret = locks_verify_area(FLOCK_VERIFY_WRITE, file->f_dentry->d_inode, + file, pos, count); + if (ret) goto out; - - dentry = file->f_dentry; - if (!dentry) + ret = -EINVAL; + if (!file->f_op || !(write = file->f_op->write)) goto out; - - inode = dentry->d_inode; - if (!inode) + if (pos < 0) goto out; - down(&inode->i_sem); - error = do_readv_writev(VERIFY_READ, inode, file, vector, count); - up(&inode->i_sem); + down(&file->f_dentry->d_inode->i_sem); + ret = write(file, buf, count, &pos); + up(&file->f_dentry->d_inode->i_sem); + out: + fput(file); +bad_file: unlock_kernel(); - return error; + return ret; } diff -u --recursive --new-file v2.1.59/linux/fs/smbfs/dir.c linux/fs/smbfs/dir.c --- v2.1.59/linux/fs/smbfs/dir.c Wed Oct 15 16:04:23 1997 +++ linux/fs/smbfs/dir.c Tue Oct 21 08:57:29 1997 @@ -23,7 +23,7 @@ /* #define SMBFS_DEBUG_VERBOSE 1 */ /* #define pr_debug printk */ -static long smb_dir_read(struct inode *, struct file *, char *, unsigned long); +static ssize_t smb_dir_read(struct file *, char *, size_t, loff_t *); static int smb_readdir(struct file *, void *, filldir_t); static int smb_dir_open(struct inode *, struct file *); @@ -71,9 +71,8 @@ NULL /* smap */ }; -static long -smb_dir_read(struct inode *inode, struct file *filp, char *buf, - unsigned long count) +static ssize_t +smb_dir_read(struct file *filp, char *buf, size_t count, loff_t *ppos) { return -EISDIR; } diff -u --recursive --new-file v2.1.59/linux/fs/smbfs/file.c linux/fs/smbfs/file.c --- v2.1.59/linux/fs/smbfs/file.c Wed Oct 15 16:04:23 1997 +++ linux/fs/smbfs/file.c Tue Oct 21 08:57:30 1997 @@ -227,22 +227,21 @@ goto out; } -static long -smb_file_read(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t +smb_file_read(struct file * file, char * buf, size_t count, loff_t *ppos) { - int status; + ssize_t status; #ifdef SMBFS_DEBUG_VERBOSE printk("smb_file_read: file %s/%s, count=%lu@%lu\n", file->f_dentry->d_parent->d_name.name, file->f_dentry->d_name.name, -count, (unsigned long) file->f_pos); +count, (unsigned long) *ppos); #endif - status = smb_revalidate_inode(inode); + status = smb_revalidate_inode(file->f_dentry->d_inode); if (status >= 0) { - status = generic_file_read(inode, file, buf, count); + status = generic_file_read(file, buf, count, ppos); } return status; } @@ -270,30 +269,29 @@ /* * Write to a file (through the page cache). */ -static long -smb_file_write(struct inode *inode, struct file *file, - const char *buf, unsigned long count) +static ssize_t +smb_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos) { - int result; + ssize_t result; #ifdef SMBFS_DEBUG_VERBOSE printk("smb_file_write: file %s/%s, count=%lu@%lu\n", file->f_dentry->d_parent->d_name.name, file->f_dentry->d_name.name, -count, (unsigned long) file->f_pos); +count, (unsigned long) *ppos); #endif #ifdef SMBFS_PARANOIA /* Should be impossible now that inodes can't change mode */ result = -EINVAL; - if (!S_ISREG(inode->i_mode)) + if (!S_ISREG(file->f_dentry->d_inode->i_mode)) { printk("smb_file_write: write to non-file, mode %07o\n", - inode->i_mode); + file->f_dentry->d_inode->i_mode); goto out; } #endif - result = smb_revalidate_inode(inode); + result = smb_revalidate_inode(file->f_dentry->d_inode); if (result) goto out; @@ -303,9 +301,9 @@ if (count > 0) { - result = generic_file_write(inode, file, buf, count); + result = generic_file_write(file, buf, count, ppos); if (result > 0) - smb_refresh_inode(inode); + smb_refresh_inode(file->f_dentry->d_inode); } out: return result; diff -u --recursive --new-file v2.1.59/linux/fs/super.c linux/fs/super.c --- v2.1.59/linux/fs/super.c Mon Oct 20 10:36:53 1997 +++ linux/fs/super.c Wed Oct 22 15:21:35 1997 @@ -594,31 +594,11 @@ if (!sb->s_root) return -ENOENT; - - if (dev==ROOT_DEV && !unmount_root) { - /* - * Special case for "unmounting" root. We just try to remount - * it readonly, and sync() the device. - */ - if (!(sb->s_flags & MS_RDONLY)) { - /* - * Make sure all quotas are turned off on this device we need to mount - * it readonly so no more writes by the quotasystem. - * If later on the remount fails too bad there are no quotas running - * anymore. Turn them on again by hand. - */ - quota_off(dev, -1); - fsync_dev(dev); - retval = do_remount_sb(sb, MS_RDONLY, 0); - return retval; - } - return 0; - } - /* - * Before checking if the filesystem is still busy make sure the kernel - * doesn't hold any quotafiles open on that device. If the umount fails - * too bad there are no quotas running anymore. Turn them on again by hand. + * Before checking whether the filesystem is still busy, + * make sure the kernel doesn't hold any quotafiles open + * on the device. If the umount fails, too bad -- there + * are no quotas running anymore. Just turn them on again. */ quota_off(dev, -1); @@ -628,12 +608,23 @@ * root entry should be in use and (b) that root entry is * clean. */ - shrink_dcache(); + shrink_dcache_sb(sb); fsync_dev(dev); + if (dev==ROOT_DEV && !unmount_root) { + /* + * Special case for "unmounting" root ... + * we just try to remount it readonly. + */ + retval = 0; + if (!(sb->s_flags & MS_RDONLY)) + retval = do_remount_sb(sb, MS_RDONLY, 0); + return retval; + } + retval = d_umount(sb); if (retval) - return retval; + goto out; /* Forget any inodes */ if (invalidate_inodes(sb)) { @@ -648,7 +639,9 @@ sb->s_op->put_super(sb); } remove_vfsmnt(dev); - return 0; + retval = 0; +out: + return retval; } static int umount_dev(kdev_t dev) diff -u --recursive --new-file v2.1.59/linux/fs/sysv/dir.c linux/fs/sysv/dir.c --- v2.1.59/linux/fs/sysv/dir.c Thu Sep 11 09:02:24 1997 +++ linux/fs/sysv/dir.c Tue Oct 21 08:57:30 1997 @@ -21,8 +21,8 @@ #include -static long sysv_dir_read(struct inode * inode, struct file * filp, - char * buf, unsigned long count) +static ssize_t sysv_dir_read(struct file * filp, char * buf, + size_t count, loff_t *ppos) { return -EISDIR; } diff -u --recursive --new-file v2.1.59/linux/fs/sysv/file.c linux/fs/sysv/file.c --- v2.1.59/linux/fs/sysv/file.c Thu Jul 17 10:06:08 1997 +++ linux/fs/sysv/file.c Tue Oct 21 08:57:30 1997 @@ -33,7 +33,7 @@ #include #include -static long sysv_file_write(struct inode *, struct file *, const char *, unsigned long); +static ssize_t sysv_file_write(struct file *, const char *, size_t, loff_t *); /* * We have mostly NULL's here: the current defaults are ok for @@ -72,18 +72,19 @@ NULL /* permission */ }; -long sysv_file_read(struct inode * inode, struct file * filp, - char * buf, unsigned long count) +ssize_t sysv_file_read(struct file * filp, char * buf, + size_t count, loff_t *ppos) { + struct inode * inode = filp->f_dentry->d_inode; struct super_block * sb = inode->i_sb; - int read,left,chars; - unsigned int block; - int blocks, offset; + ssize_t read,left,chars; + size_t block; + ssize_t blocks, offset; int bhrequest, uptodate; struct buffer_head ** bhb, ** bhe; struct buffer_head * bhreq[NBUF]; struct buffer_head * buflist[NBUF]; - unsigned int size; + size_t size; if (!inode) { printk("sysv_file_read: inode = NULL\n"); @@ -93,7 +94,7 @@ printk("sysv_file_read: mode = %07o\n",inode->i_mode); return -EINVAL; } - offset = filp->f_pos; + offset = *ppos; size = inode->i_size; if (offset > size) left = 0; @@ -167,7 +168,7 @@ chars = left; else chars = sb->sv_block_size - offset; - filp->f_pos += chars; + *ppos += chars; left -= chars; read += chars; if (*bhe) { @@ -200,12 +201,13 @@ return read; } -static long sysv_file_write(struct inode * inode, struct file * filp, - const char * buf, unsigned long count) +static ssize_t sysv_file_write(struct file * filp, const char * buf, + size_t count, loff_t *ppos) { + struct inode * inode = filp->f_dentry->d_inode; struct super_block * sb = inode->i_sb; off_t pos; - int written,c; + ssize_t written, c; struct buffer_head * bh; char * p; @@ -227,7 +229,7 @@ if (filp->f_flags & O_APPEND) pos = inode->i_size; else - pos = filp->f_pos; + pos = *ppos; written = 0; while (written> sb->sv_block_size_bits, 1); @@ -265,7 +267,7 @@ brelse(bh); } inode->i_mtime = inode->i_ctime = CURRENT_TIME; - filp->f_pos = pos; + *ppos = pos; mark_inode_dirty(inode); return written; } diff -u --recursive --new-file v2.1.59/linux/fs/sysv/inode.c linux/fs/sysv/inode.c --- v2.1.59/linux/fs/sysv/inode.c Thu Jul 17 10:06:08 1997 +++ linux/fs/sysv/inode.c Tue Oct 21 08:57:30 1997 @@ -46,13 +46,14 @@ static struct super_operations sysv_sops = { sysv_read_inode, - sysv_notify_change, sysv_write_inode, sysv_put_inode, + NULL, /* delete_inode */ + sysv_notify_change, sysv_put_super, sysv_write_super, sysv_statfs, - NULL + NULL /* remount_fs */ }; /* The following functions try to recognize specific filesystems. diff -u --recursive --new-file v2.1.59/linux/fs/vfat/Makefile linux/fs/vfat/Makefile --- v2.1.59/linux/fs/vfat/Makefile Mon May 6 01:43:19 1996 +++ linux/fs/vfat/Makefile Thu Oct 23 14:00:15 1997 @@ -8,8 +8,8 @@ # Note 2! The CFLAGS definitions are now in the main makefile... O_TARGET := vfat.o -O_OBJS := -OX_OBJS := namei.o +O_OBJS := namei.o +OX_OBJS := vfatfs_syms.o M_OBJS := $(O_TARGET) include $(TOPDIR)/Rules.make diff -u --recursive --new-file v2.1.59/linux/fs/vfat/namei.c linux/fs/vfat/namei.c --- v2.1.59/linux/fs/vfat/namei.c Thu Aug 14 20:49:17 1997 +++ linux/fs/vfat/namei.c Thu Oct 23 14:00:15 1997 @@ -11,21 +11,20 @@ */ #include +#define __NO_VERSION__ #include #include #include +#include #include #include #include #include #include -#include - -#include +#include #include "../fat/msbuffer.h" -#include "../fat/tables.h" #if 0 # define PRINTK(x) printk x @@ -79,13 +78,30 @@ NULL /* remount */ }; +static int simple_getbool(char *s, int *setval) +{ + if (s) { + if (!strcmp(s,"1") || !strcmp(s,"yes") || !strcmp(s,"true")) { + *setval = 1; + } else if (!strcmp(s,"0") || !strcmp(s,"no") || !strcmp(s,"false")) { + *setval = 0; + } else { + return 0; + } + } else { + *setval = 1; + } + return 1; +} + static int parse_options(char *options, struct fat_mount_options *opts) { char *this_char,*value,save,*savep; - int ret; + int ret, val; opts->unicode_xlate = opts->posixfs = 0; opts->numtail = 1; + opts->utf8 = 0; if (!options) return 1; save = 0; @@ -97,25 +113,19 @@ savep = value; *value++ = 0; } - if (!strcmp(this_char,"uni_xlate")) { - if (value) { - ret = 0; - } else { - opts->unicode_xlate = 1; - } - } - else if (!strcmp(this_char,"posix")) { - if (value) { - ret = 0; - } else { - opts->posixfs = 1; - } - } - else if (!strcmp(this_char,"nonumtail")) { - if (value) { - ret = 0; - } else { - opts->numtail = 0; + if (!strcmp(this_char,"utf8")) { + ret = simple_getbool(value, &val); + if (ret) opts->utf8 = val; + } else if (!strcmp(this_char,"uni_xlate")) { + ret = simple_getbool(value, &val); + if (ret) opts->unicode_xlate = val; + } else if (!strcmp(this_char,"posix")) { + ret = simple_getbool(value, &val); + if (ret) opts->posixfs = val; + } else if (!strcmp(this_char,"nonumtail")) { + ret = simple_getbool(value, &val); + if (ret) { + opts->numtail = !val; } } if (this_char != options) @@ -127,6 +137,9 @@ return 0; } } + if (opts->unicode_xlate) { + opts->utf8 = 0; + } return 1; } @@ -137,6 +150,8 @@ MOD_INC_USE_COUNT; + MSDOS_SB(sb)->options.isvfat = 1; + sb->s_op = &vfat_sops; res = fat_read_super(sb, data, silent); if (res == NULL) { @@ -148,7 +163,6 @@ if (!parse_options((char *) data, &(MSDOS_SB(sb)->options))) { MOD_DEC_USE_COUNT; } else { - MSDOS_SB(sb)->options.isvfat = 1; MSDOS_SB(sb)->options.dotsOK = 0; } @@ -225,7 +239,6 @@ /* Characters that are undesirable in an MS-DOS file name */ static char bad_chars[] = "*?<>|\":/\\"; -static char bad_if_strict[] = "+=,; []"; static char replace_chars[] = "[];,+="; static int vfat_find(struct inode *dir,struct qstr* name, @@ -265,8 +278,8 @@ return 0; } -static int vfat_valid_shortname(char conv,const char *name,int len, - int dot_dirs) +static int vfat_valid_shortname(const char *name,int len, + int dot_dirs, int utf8) { const char *walk, **reserved; unsigned char c; @@ -283,17 +296,17 @@ for (walk = name; len && walk-name < 8;) { c = *walk++; len--; - if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL; - if (conv == 'x' && strchr(replace_chars,c)) return -EINVAL; - if (conv == 's' && strchr(bad_if_strict,c)) return -EINVAL; - if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL; + if (utf8 && (c & 0x80)) return -EINVAL; + if (strchr(bad_chars,c)) return -EINVAL; + if (strchr(replace_chars,c)) return -EINVAL; + if (c >= 'A' && c <= 'Z') return -EINVAL; if (c < ' ' || c == ':' || c == '\\') return -EINVAL; if ((walk == name) && (c == 0xE5)) c = 0x05; if (c == '.') break; space = c == ' '; } if (space) return -EINVAL; - if ((conv == 's' || conv == 'x') && len && c != '.') { + if (len && c != '.') { c = *walk++; len--; if (c != '.') return -EINVAL; @@ -304,18 +317,17 @@ while (len > 0 && walk-name < (MSDOS_NAME+1)) { c = *walk++; len--; - if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL; - if (conv == 's' && strchr(bad_if_strict,c)) - return -EINVAL; - if (conv == 'x' && strchr(replace_chars,c)) + if (utf8 && (c & 0x80)) return -EINVAL; + if (strchr(bad_chars,c)) return -EINVAL; + if (strchr(replace_chars,c)) return -EINVAL; if (c < ' ' || c == ':' || c == '\\' || c == '.') return -EINVAL; - if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL; + if (c >= 'A' && c <= 'Z') return -EINVAL; space = c == ' '; } if (space) return -EINVAL; - if ((conv == 's' || conv == 'x') && len) return -EINVAL; + if (len) return -EINVAL; } for (reserved = reserved_names; *reserved; reserved++) if (!strncmp(name,*reserved,8)) return -EINVAL; @@ -328,8 +340,8 @@ * returned. The formatted short filename is returned in 'res'. */ -static int vfat_format_name(char conv,const char *name,int len,char *res, - int dot_dirs) +static int vfat_format_name(const char *name,int len,char *res, + int dot_dirs,int utf8) { char *walk; const char **reserved; @@ -349,17 +361,17 @@ for (walk = res; len && walk-res < 8; walk++) { c = *name++; len--; - if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL; - if (conv == 's' && strchr(bad_if_strict,c)) return -EINVAL; - if (conv == 'x' && strchr(replace_chars,c)) return -EINVAL; - if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL; + if (utf8 && (c & 0x80)) return -EINVAL; + if (strchr(bad_chars,c)) return -EINVAL; + if (strchr(replace_chars,c)) return -EINVAL; + if (c >= 'A' && c <= 'Z') return -EINVAL; if (c < ' ' || c == ':' || c == '\\') return -EINVAL; if (c == '.') break; space = c == ' '; *walk = c >= 'a' && c <= 'z' ? c-32 : c; } if (space) return -EINVAL; - if ((conv == 's' || conv == 'x') && len && c != '.') { + if (len && c != '.') { c = *name++; len--; if (c != '.') return -EINVAL; @@ -370,19 +382,18 @@ while (len > 0 && walk-res < MSDOS_NAME) { c = *name++; len--; - if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL; - if (conv == 's' && strchr(bad_if_strict,c)) - return -EINVAL; - if (conv == 'x' && strchr(replace_chars,c)) + if (utf8 && (c & 0x80)) return -EINVAL; + if (strchr(bad_chars,c)) return -EINVAL; + if (strchr(replace_chars,c)) return -EINVAL; if (c < ' ' || c == ':' || c == '\\' || c == '.') return -EINVAL; - if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL; + if (c >= 'A' && c <= 'Z') return -EINVAL; space = c == ' '; *walk++ = c >= 'a' && c <= 'z' ? c-32 : c; } if (space) return -EINVAL; - if ((conv == 's' || conv == 'x') && len) return -EINVAL; + if (len) return -EINVAL; } while (walk-res < MSDOS_NAME) *walk++ = ' '; for (reserved = reserved_names; *reserved; reserved++) @@ -397,7 +408,7 @@ * shortname does not exist */ static int vfat_create_shortname(struct inode *dir, const char *name, - int len, char *name_res) + int len, char *name_res, int utf8) { const char *ip, *ext_start, *end; char *p; @@ -417,16 +428,25 @@ if (len && name[len-1]==' ') return -EINVAL; if (len <= 12) { /* Do a case insensitive search if the name would be a valid - * shortname if is were all capitalized */ + * shortname if is were all capitalized. However, do not + * allow spaces in short names because Win95 scandisk does + * not like that */ + res = 0; for (i = 0, p = msdos_name, ip = name; i < len; i++, p++, ip++) { + if (*ip == ' ') { + res = -1; + break; + } if (*ip >= 'A' && *ip <= 'Z') { *p = *ip + 32; } else { *p = *ip; } } - res = vfat_format_name('x', msdos_name, len, name_res, 1); + if (res == 0) { + res = vfat_format_name(msdos_name, len, name_res, 1, utf8); + } if (res > -1) { PRINTK(("vfat_create_shortname 1\n")); qname.name=msdos_name; @@ -476,7 +496,10 @@ for (baselen = i = 0, p = base, ip = name; i < sz && baselen < 8; i++) { - if (!strchr(skip_chars, *ip)) { + if (utf8 && (*ip & 0x80)) { + *p++ = '_'; + baselen++; + } else if (!strchr(skip_chars, *ip)) { if (*ip >= 'A' && *ip <= 'Z') { *p = *ip + 32; } else { @@ -496,7 +519,10 @@ if (ext_start) { extlen = 0; for (p = ext, ip = ext_start; extlen < 3 && ip < end; ip++) { - if (!strchr(skip_chars, *ip)) { + if (utf8 && (*ip & 0x80)) { + *p++ = '_'; + extlen++; + } else if (!strchr(skip_chars, *ip)) { if (*ip >= 'A' && *ip <= 'Z') { *p = *ip + 32; } else { @@ -547,7 +573,7 @@ qname.len=totlen; res = vfat_find(dir, &qname, 0, 0, 0, &sinfo); } - res = vfat_format_name('x', msdos_name, totlen, name_res, 1); + res = vfat_format_name(msdos_name, totlen, name_res, 1, utf8); return res; } @@ -596,7 +622,9 @@ ino = fat_get_entry(dir,&curr,&bh,&de); } - if (dir->i_ino == MSDOS_ROOT_INO) return -ENOSPC; + if ((dir->i_ino == MSDOS_ROOT_INO) && + (MSDOS_SB(sb)->fat_bits != 32)) + return -ENOSPC; if ((res = fat_add_cluster(dir)) < 0) return res; ino = fat_get_entry(dir,&curr,&bh,&de); } @@ -605,7 +633,8 @@ /* Translate a string, including coded sequences into Unicode */ static int -xlate_to_uni(const char *name, int len, char *outname, int *outlen, int escape) +xlate_to_uni(const char *name, int len, char *outname, int *outlen, + int escape, int utf8, struct nls_table *nls) { int i; const unsigned char *ip; @@ -613,22 +642,43 @@ int fill; unsigned char c1, c2, c3; - op = outname; - for (i = 0, ip = name, op = outname, *outlen = 0; - i < len && *outlen <= 260; i++, *outlen += 1) - { - if (escape && (i < len - 4) && - (*ip == ':') && - ((c1 = fat_code2uni[ip[1]]) != 255) && - ((c2 = fat_code2uni[ip[2]]) != 255) && - ((c3 = fat_code2uni[ip[3]]) != 255)) { - *op++ = (c1 << 4) + (c2 >> 2); - *op++ = ((c2 & 0x3) << 6) + c3; - ip += 4; + if (utf8) { + *outlen = utf8_mbstowcs((__u16 *) outname, name, PAGE_SIZE); + if (name[len-1] == '.') + *outlen-=2; + op = &outname[*outlen * sizeof(__u16)]; + } else { + if (name[len-1] == '.') + len--; + op = outname; + if (nls) { + /* XXX: i is incorrectly computed. */ + for (i = 0, ip = name, op = outname, *outlen = 0; + i < len && *outlen <= 260; i++, *outlen += 1) + { + if (escape && (*ip == ':')) { + if (i > len - 4) return -EINVAL; + c1 = fat_esc2uni[ip[1]]; + c2 = fat_esc2uni[ip[2]]; + c3 = fat_esc2uni[ip[3]]; + if (c1 == 255 || c2 == 255 || c3 == 255) + return -EINVAL; + *op++ = (c1 << 4) + (c2 >> 2); + *op++ = ((c2 & 0x3) << 6) + c3; + ip += 4; + } else { + *op++ = nls->charset2uni[*ip].uni1; + *op++ = nls->charset2uni[*ip].uni2; + ip++; + } + } } else { - *op++ = fat_a2uni[*ip].uni1; - *op++ = fat_a2uni[*ip].uni2; - ip++; + for (i = 0, ip = name, op = outname, *outlen = 0; + i < len && *outlen <= 260; i++, *outlen += 1) + { + *op++ = *ip++; + *op++ = 0; + } } } if (*outlen > 260) @@ -653,7 +703,8 @@ static int vfat_fill_long_slots(struct msdos_dir_slot *ds, const char *name, int len, - char *msdos_name, int *slots, int uni_xlate) + char *msdos_name, int *slots, + int uni_xlate, int utf8, struct nls_table *nls) { struct msdos_dir_slot *ps; struct msdos_dir_entry *de; @@ -667,10 +718,11 @@ int i; loff_t offset; + if (name[len-1] == '.') len--; if(!(page = __get_free_page(GFP_KERNEL))) return -ENOMEM; uniname = (char *) page; - res = xlate_to_uni(name, len, uniname, &unilen, uni_xlate); + res = xlate_to_uni(name, len, uniname, &unilen, uni_xlate, utf8, nls); if (res < 0) { free_page(page); return res; @@ -690,8 +742,7 @@ ps->attr = ATTR_EXT; ps->reserved = 0; ps->alias_checksum = cksum; - ps->start[0] = 0; - ps->start[1] = 0; + ps->start = 0; PRINTK(("vfat_fill_long_slots 5: uniname=%s\n",uniname)); offset = (slot - 1) * 26; ip = &uniname[offset]; @@ -728,11 +779,14 @@ { struct msdos_dir_entry *de; char msdos_name[MSDOS_NAME]; - int res, xlate; + int res, xlate, utf8; + struct nls_table *nls; PRINTK(("Entering vfat_build_slots: name=%s, len=%d\n", name, len)); de = (struct msdos_dir_entry *) ds; xlate = MSDOS_SB(dir->i_sb)->options.unicode_xlate; + utf8 = MSDOS_SB(dir->i_sb)->options.utf8; + nls = MSDOS_SB(dir->i_sb)->nls_io; *slots = 1; *is_long = 0; @@ -742,13 +796,13 @@ strncpy(de->name, MSDOS_DOT, MSDOS_NAME); } else { PRINTK(("vfat_build_slots 4\n")); - res = vfat_valid_shortname('x', name, len, 1); + res = vfat_valid_shortname(name, len, 1, utf8); if (res > -1) { PRINTK(("vfat_build_slots 5a\n")); - res = vfat_format_name('x', name, len, de->name, 1); + res = vfat_format_name(name, len, de->name, 1, utf8); PRINTK(("vfat_build_slots 5b\n")); } else { - res = vfat_create_shortname(dir, name, len, msdos_name); + res = vfat_create_shortname(dir, name, len, msdos_name, utf8); if (res < 0) { return res; } @@ -761,7 +815,7 @@ *is_long = 1; return vfat_fill_long_slots(ds, name, len, msdos_name, - slots, xlate); + slots, xlate, utf8, nls); } } return 0; @@ -787,8 +841,11 @@ vf->name, vf->len, name, name_len); #endif + /* Filenames cannot end in '.' or we treat like it has none */ if (vf->len != name_len) { - return 0; + if ((vf->len != name_len + 1) || (vf->name[name_len] != '.')) { + return 0; + } } s1 = name; s2 = vf->name; @@ -821,12 +878,17 @@ struct msdos_dir_entry *de; struct msdos_dir_slot *ps; loff_t offset; - struct msdos_dir_slot ds[MSDOS_SLOTS]; + struct msdos_dir_slot *ds; int is_long; int slots, slot; int res; PRINTK(("Entering vfat_find\n")); + + ds = (struct msdos_dir_slot *) + kmalloc(sizeof(struct msdos_dir_slot)*MSDOS_SLOTS, GFP_KERNEL); + if (ds == NULL) return -ENOMEM; + fil.f_pos = 0; vf.name = qname->name; vf.len = qname->len; @@ -835,10 +897,11 @@ vf.posix = MSDOS_SB(sb)->options.posixfs; res = fat_readdirx(dir,&fil,(void *)&vf,vfat_readdir_cb,NULL,1,find_long,0); PRINTK(("vfat_find: Debug 1\n")); - if (res < 0) return res; + if (res < 0) goto cleanup; if (vf.found) { if (new_filename) { - return -EEXIST; + res = -EEXIST; + goto cleanup; } sinfo_out->longname_offset = vf.offset; sinfo_out->shortname_offset = vf.short_offset; @@ -848,16 +911,19 @@ sinfo_out->ino = vf.ino; PRINTK(("vfat_find: Debug 2\n")); - return 0; + res = 0; + goto cleanup; } PRINTK(("vfat_find: Debug 3\n")); - if (!vf.found && !new_filename) - return -ENOENT; + if (!vf.found && !new_filename) { + res = -ENOENT; + goto cleanup; + } res = vfat_build_slots(dir, qname->name, qname->len, ds, &slots, &is_long); - if (res < 0) return res; + if (res < 0) goto cleanup; de = (struct msdos_dir_entry *) ds; @@ -867,7 +933,8 @@ if (is_long) slots++; offset = vfat_find_free_slots(dir, slots); if (offset < 0) { - return offset; + res = offset; + goto cleanup; } PRINTK(("vfat_find: create file 2\n")); @@ -878,7 +945,8 @@ sinfo_out->ino = fat_get_entry(dir,&offset,&bh,&de); if (sinfo_out->ino < 0) { PRINTK(("vfat_find: problem\n")); - return sinfo_out->ino; + res = sinfo_out->ino; + goto cleanup; } memcpy(de, ps, sizeof(struct msdos_dir_slot)); fat_mark_buffer_dirty(sb, bh, 1); @@ -890,12 +958,12 @@ PRINTK(("vfat_find: create file 5\n")); - memset(de->unused, 0, sizeof(de->unused)); fat_date_unix2dos(dir->i_mtime,&de->time,&de->date); de->ctime_ms = 0; de->ctime = de->time; de->adate = de->cdate = de->date; de->start = 0; + de->starthi = 0; de->size = 0; de->attr = is_dir ? ATTR_DIR : ATTR_ARCH; de->lcase = CASE_LOWER_BASE | CASE_LOWER_EXT; @@ -913,10 +981,15 @@ sinfo_out->total_slots = slots; sinfo_out->shortname_offset = offset - sizeof(struct msdos_dir_slot); sinfo_out->longname_offset = offset - sizeof(struct msdos_dir_slot) * slots; + res = 0; return 0; + } else { + res = -ENOENT; } - return -ENOENT; +cleanup: + kfree(ds); + return res; } int vfat_lookup(struct inode *dir,struct dentry *dentry) @@ -1040,10 +1113,10 @@ dir->i_atime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; mark_inode_dirty(dir); memcpy(de->name,name,MSDOS_NAME); - memset(de->unused, 0, sizeof(de->unused)); de->lcase = 0; de->attr = ATTR_DIR; de->start = 0; + de->starthi = 0; fat_date_unix2dos(dir->i_mtime,&de->time,&de->date); de->ctime_ms = 0; de->ctime = de->time; @@ -1058,10 +1131,12 @@ if (isdot) { dot->i_size = dir->i_size; MSDOS_I(dot)->i_start = MSDOS_I(dir)->i_start; + MSDOS_I(dot)->i_logstart = MSDOS_I(dir)->i_logstart; dot->i_nlink = dir->i_nlink; } else { dot->i_size = parent->i_size; MSDOS_I(dot)->i_start = MSDOS_I(parent)->i_start; + MSDOS_I(dot)->i_logstart = MSDOS_I(parent)->i_logstart; dot->i_nlink = parent->i_nlink; } @@ -1244,10 +1319,8 @@ if (res > 0) { res = 0; } - } else { - printk("Problem in vfat_rmdirx\n"); + dir->i_version = ++event; } - dir->i_version = ++event; rmdir_done: fat_brelse(sb, bh); @@ -1275,19 +1348,15 @@ struct slot_info sinfo; bh = NULL; - if ((res = vfat_find(dir,&dentry->d_name,1,0,0,&sinfo)) < 0) - goto unlink_done; + res = vfat_find(dir,&dentry->d_name,1,0,0,&sinfo); if (res >= 0 && sinfo.total_slots > 0) { res = vfat_remove_entry(dir,&sinfo,&bh,dentry,0,nospc); if (res > 0) { res = 0; } - } else { - printk("Problem in vfat_unlinkx: res=%d, total_slots=%d\n",res, sinfo.total_slots); } -unlink_done: fat_brelse(sb, bh); return res; } @@ -1329,7 +1398,16 @@ return res; } +/***** Unlink, as called for uvfatfs */ +int vfat_unlink_uvfat(struct inode *dir,struct dentry *dentry) +{ + int res; + res = vfat_unlinkx (dir,dentry,0); + iput(dir); + return res; +} + int vfat_rename(struct inode *old_dir,struct dentry *old_dentry, struct inode *new_dir,struct dentry *new_dentry) { @@ -1417,10 +1495,13 @@ PRINTK(("vfat_rename 8\n")); if (res < 0) goto rename_done; } else { - PRINTK(("vfat_rename 9\n")); - res = vfat_unlinkx(new_dir,new_dentry,1); - PRINTK(("vfat_rename 10\n")); - if (res < 0) goto rename_done; + /* Is this the same file, different case? */ + if (new_inode != old_inode) { + PRINTK(("vfat_rename 9\n")); + res = vfat_unlinkx(new_dir,new_dentry,1); + PRINTK(("vfat_rename 10\n")); + if (res < 0) goto rename_done; + } } } @@ -1444,6 +1525,7 @@ new_de->cdate = old_de->cdate; new_de->adate = old_de->adate; new_de->start = old_de->start; + new_de->starthi = old_de->starthi; new_de->size = old_de->size; if (!(new_inode = iget(new_dir->i_sb,new_ino))) goto rename_done; @@ -1492,8 +1574,10 @@ res = -EIO; goto rename_done; } - dotdot_de->start = MSDOS_I(dotdot_inode)->i_start = - MSDOS_I(new_dir)->i_start; + MSDOS_I(dotdot_inode)->i_start = MSDOS_I(new_dir)->i_start; + MSDOS_I(dotdot_inode)->i_logstart = MSDOS_I(new_dir)->i_logstart; + dotdot_de->start = CT_LE_W(MSDOS_I(new_dir)->i_logstart); + dotdot_de->starthi = CT_LE_W((MSDOS_I(new_dir)->i_logstart) >> 16); mark_inode_dirty(dotdot_inode); fat_mark_buffer_dirty(sb, dotdot_bh, 1); old_dir->i_nlink--; @@ -1545,28 +1629,6 @@ void vfat_read_inode(struct inode *inode) { fat_read_inode(inode, &vfat_dir_inode_operations); -} - -static struct file_system_type vfat_fs_type = { - "vfat", - FS_REQUIRES_DEV, - vfat_read_super, - NULL -}; - -EXPORT_SYMBOL(vfat_create); -EXPORT_SYMBOL(vfat_unlink); -EXPORT_SYMBOL(vfat_mkdir); -EXPORT_SYMBOL(vfat_rmdir); -EXPORT_SYMBOL(vfat_rename); -EXPORT_SYMBOL(vfat_put_super); -EXPORT_SYMBOL(vfat_read_super); -EXPORT_SYMBOL(vfat_read_inode); -EXPORT_SYMBOL(vfat_lookup); - -__initfunc(int init_vfat_fs(void)) -{ - return register_filesystem(&vfat_fs_type); } #ifdef MODULE diff -u --recursive --new-file v2.1.59/linux/fs/vfat/vfatfs_syms.c linux/fs/vfat/vfatfs_syms.c --- v2.1.59/linux/fs/vfat/vfatfs_syms.c Wed Dec 31 16:00:00 1969 +++ linux/fs/vfat/vfatfs_syms.c Thu Oct 23 14:00:15 1997 @@ -0,0 +1,37 @@ +/* + * linux/fs/msdos/vfatfs_syms.c + * + * Exported kernel symbols for the VFAT filesystem. + * These symbols are used by dmsdos. + */ + +#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S)) +#include +#include + +#include +#include + +struct file_system_type vfat_fs_type = { + "vfat", + FS_REQUIRES_DEV, + vfat_read_super, + NULL +}; + +EXPORT_SYMBOL(vfat_create); +EXPORT_SYMBOL(vfat_unlink); +EXPORT_SYMBOL(vfat_unlink_uvfat); +EXPORT_SYMBOL(vfat_mkdir); +EXPORT_SYMBOL(vfat_rmdir); +EXPORT_SYMBOL(vfat_rename); +EXPORT_SYMBOL(vfat_put_super); +EXPORT_SYMBOL(vfat_read_super); +EXPORT_SYMBOL(vfat_read_inode); +EXPORT_SYMBOL(vfat_lookup); + +int init_vfat_fs(void) +{ + return register_filesystem(&vfat_fs_type); +} + diff -u --recursive --new-file v2.1.59/linux/include/asm-alpha/unistd.h linux/include/asm-alpha/unistd.h --- v2.1.59/linux/include/asm-alpha/unistd.h Wed Sep 24 20:05:48 1997 +++ linux/include/asm-alpha/unistd.h Tue Oct 21 08:57:30 1997 @@ -286,6 +286,8 @@ #define __NR_pciconfig_write 346 #define __NR_query_module 347 #define __NR_prctl 348 +#define __NR_pread 349 +#define __NR_pwrite 350 #if defined(__LIBRARY__) && defined(__GNUC__) diff -u --recursive --new-file v2.1.59/linux/include/linux/binfmts.h linux/include/linux/binfmts.h --- v2.1.59/linux/include/linux/binfmts.h Thu Jul 17 10:06:08 1997 +++ linux/include/linux/binfmts.h Mon Oct 20 10:12:00 1997 @@ -58,7 +58,7 @@ extern int prepare_binprm(struct linux_binprm *); extern void remove_arg_zero(struct linux_binprm *); extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); -extern void flush_old_exec(struct linux_binprm * bprm); +extern int flush_old_exec(struct linux_binprm * bprm); extern unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm); extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page, unsigned long p, int from_kmem); diff -u --recursive --new-file v2.1.59/linux/include/linux/dcache.h linux/include/linux/dcache.h --- v2.1.59/linux/include/linux/dcache.h Wed Oct 15 16:04:23 1997 +++ linux/include/linux/dcache.h Thu Oct 23 13:30:08 1997 @@ -109,6 +109,12 @@ #define shrink_dcache() prune_dcache(0) +/* dcache memory management */ +extern int select_dcache(int, int); +extern void shrink_dcache_memory(void); +extern void check_dcache_memory(void); +extern void free_inode_memory(int); /* defined in fs/inode.c */ + /* only used at mount-time */ extern struct dentry * d_alloc_root(struct inode * root_inode, struct dentry * old_root); diff -u --recursive --new-file v2.1.59/linux/include/linux/fs.h linux/include/linux/fs.h --- v2.1.59/linux/include/linux/fs.h Wed Oct 15 16:04:24 1997 +++ linux/include/linux/fs.h Thu Oct 23 14:32:17 1997 @@ -438,8 +438,8 @@ extern int locks_mandatory_locked(struct inode *inode); extern int locks_mandatory_area(int read_write, struct inode *inode, - struct file *filp, unsigned int offset, - unsigned int count); + struct file *filp, loff_t offset, + size_t count); extern inline int locks_verify_locked(struct inode *inode) { @@ -451,9 +451,10 @@ return (locks_mandatory_locked(inode)); return (0); } + extern inline int locks_verify_area(int read_write, struct inode *inode, - struct file *filp, unsigned int offset, - unsigned int count) + struct file *filp, loff_t offset, + size_t count) { /* Candidates for mandatory locking have the setgid bit set * but no group execute bit - an otherwise meaningless combination. @@ -533,9 +534,9 @@ typedef int (*filldir_t)(void *, const char *, int, off_t, ino_t); struct file_operations { - long long (*llseek) (struct file *, long long, int); - long (*read) (struct inode *, struct file *, char *, unsigned long); - long (*write) (struct inode *, struct file *, const char *, unsigned long); + loff_t (*llseek) (struct file *, loff_t, int); + ssize_t (*read) (struct file *, char *, size_t, loff_t *); + ssize_t (*write) (struct file *, const char *, size_t, loff_t *); int (*readdir) (struct file *, void *, filldir_t); unsigned int (*poll) (struct file *, poll_table *); int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); @@ -643,8 +644,6 @@ extern struct file_system_type *get_fs_type(const char *name); -extern int fs_may_mount(kdev_t dev); -extern int fs_may_umount(struct super_block *, struct dentry * root); extern int fs_may_remount_ro(struct super_block *); extern struct file *inuse_filps; @@ -745,32 +744,23 @@ #endif } -/* Not to be used by ordinary vfs users */ -extern void _get_inode(struct inode * inode); -extern void iput(struct inode * inode); - -extern struct inode * iget(struct super_block * sb, unsigned long nr); -extern void clear_inode(struct inode * inode); +extern void iput(struct inode *); +extern struct inode * iget(struct super_block *, unsigned long); +extern void clear_inode(struct inode *); extern struct inode * get_empty_inode(void); -/* Please prefer to use this function in future, instead of using - * a get_empty_inode()/insert_inode_hash() combination. - * It allows for better checking and less race conditions. - */ -extern struct inode * get_empty_inode_hashed(dev_t i_dev, unsigned long i_ino); - extern void insert_inode_hash(struct inode *); extern int get_unused_fd(void); extern void put_unused_fd(int); extern struct file * get_empty_filp(void); -extern int close_fp(struct file *filp); -extern struct buffer_head * get_hash_table(kdev_t dev, int block, int size); -extern struct buffer_head * getblk(kdev_t dev, int block, int size); -extern void ll_rw_block(int rw, int nr, struct buffer_head * bh[]); -extern void ll_rw_page(int rw, kdev_t dev, unsigned long nr, char * buffer); -extern void ll_rw_swap_file(int rw, kdev_t dev, unsigned int *b, int nb, char *buffer); -extern int is_read_only(kdev_t dev); -extern void __brelse(struct buffer_head *buf); +extern int close_fp(struct file *); +extern struct buffer_head * get_hash_table(kdev_t, int, int); +extern struct buffer_head * getblk(kdev_t, int, int); +extern void ll_rw_block(int, int, struct buffer_head * bh[]); +extern void ll_rw_page(int, kdev_t, unsigned long, char *); +extern void ll_rw_swap_file(int, kdev_t, unsigned int *, int, char *); +extern int is_read_only(kdev_t); +extern void __brelse(struct buffer_head *); extern inline void brelse(struct buffer_head *buf) { if (buf) @@ -792,8 +782,8 @@ extern int generic_readpage(struct inode *, struct page *); extern int generic_file_mmap(struct file *, struct vm_area_struct *); -extern long generic_file_read(struct inode *, struct file *, char *, unsigned long); -extern long generic_file_write(struct inode *, struct file *, const char *, unsigned long); +extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *); +extern ssize_t generic_file_write(struct file *, const char*, size_t, loff_t*); extern struct super_block *get_super(kdev_t dev); extern void put_super(kdev_t dev); @@ -809,18 +799,15 @@ extern int change_root(kdev_t new_root_dev,const char *put_old); #endif -extern long char_read(struct inode *, struct file *, char *, unsigned long); -extern long block_read(struct inode *, struct file *, char *, unsigned long); +extern ssize_t char_read(struct file *, char *, size_t, loff_t *); +extern ssize_t block_read(struct file *, char *, size_t, loff_t *); extern int read_ahead[]; -extern long char_write(struct inode *, struct file *, const char *, unsigned long); -extern long block_write(struct inode *, struct file *, const char *, unsigned long); +extern ssize_t char_write(struct file *, const char *, size_t, loff_t *); +extern ssize_t block_write(struct file *, const char *, size_t, loff_t *); extern int block_fsync(struct file *, struct dentry *dir); extern int file_fsync(struct file *, struct dentry *dir); - -extern void dcache_add(struct inode *, const char *, int, unsigned long); -extern int dcache_lookup(struct inode *, const char *, int, unsigned long *); extern int inode_change_ok(struct inode *, struct iattr *); extern void inode_setattr(struct inode *, struct iattr *); diff -u --recursive --new-file v2.1.59/linux/include/linux/in6.h linux/include/linux/in6.h --- v2.1.59/linux/include/linux/in6.h Thu May 15 16:48:05 1997 +++ linux/include/linux/in6.h Thu Oct 23 13:33:49 1997 @@ -21,6 +21,7 @@ #ifndef _LINUX_IN6_H #define _LINUX_IN6_H +#include /* * IPv6 address structure diff -u --recursive --new-file v2.1.59/linux/include/linux/ioport.h linux/include/linux/ioport.h --- v2.1.59/linux/include/linux/ioport.h Mon Oct 20 10:36:53 1997 +++ linux/include/linux/ioport.h Wed Oct 22 08:31:55 1997 @@ -29,7 +29,6 @@ #endif #define HAVE_AUTOIRQ -extern void *irq2dev_map[16]; /* Use only if you own the IRQ. */ extern void autoirq_setup(int waittime); extern int autoirq_report(int waittime); diff -u --recursive --new-file v2.1.59/linux/include/linux/iso_fs.h linux/include/linux/iso_fs.h --- v2.1.59/linux/include/linux/iso_fs.h Thu Jul 17 10:06:08 1997 +++ linux/include/linux/iso_fs.h Thu Oct 23 14:00:15 1997 @@ -19,6 +19,7 @@ /* volume descriptor types */ #define ISO_VD_PRIMARY 1 +#define ISO_VD_SUPPLEMENTARY 2 #define ISO_VD_END 255 #define ISO_STANDARD_ID "CD001" @@ -59,6 +60,43 @@ char unused5 [ISODCL (1396, 2048)]; }; +/* Almost the same as the primary descriptor but two fields are specified */ +struct iso_supplementary_descriptor { + char type [ISODCL ( 1, 1)]; /* 711 */ + char id [ISODCL ( 2, 6)]; + char version [ISODCL ( 7, 7)]; /* 711 */ + char flags [ISODCL ( 8, 8)]; /* 853 */ + char system_id [ISODCL ( 9, 40)]; /* achars */ + char volume_id [ISODCL ( 41, 72)]; /* dchars */ + char unused2 [ISODCL ( 73, 80)]; + char volume_space_size [ISODCL ( 81, 88)]; /* 733 */ + char escape [ISODCL ( 89, 120)]; /* 856 */ + char volume_set_size [ISODCL (121, 124)]; /* 723 */ + char volume_sequence_number [ISODCL (125, 128)]; /* 723 */ + char logical_block_size [ISODCL (129, 132)]; /* 723 */ + char path_table_size [ISODCL (133, 140)]; /* 733 */ + char type_l_path_table [ISODCL (141, 144)]; /* 731 */ + char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */ + char type_m_path_table [ISODCL (149, 152)]; /* 732 */ + char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */ + char root_directory_record [ISODCL (157, 190)]; /* 9.1 */ + char volume_set_id [ISODCL (191, 318)]; /* dchars */ + char publisher_id [ISODCL (319, 446)]; /* achars */ + char preparer_id [ISODCL (447, 574)]; /* achars */ + char application_id [ISODCL (575, 702)]; /* achars */ + char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */ + char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */ + char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */ + char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */ + char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */ + char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */ + char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */ + char file_structure_version [ISODCL (882, 882)]; /* 711 */ + char unused4 [ISODCL (883, 883)]; + char application_data [ISODCL (884, 1395)]; + char unused5 [ISODCL (1396, 2048)]; +}; + #define HS_STANDARD_ID "CDROM" @@ -142,10 +180,12 @@ extern int iso_date(char *, int); extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *); -extern int get_rock_ridge_filename(struct iso_directory_record *, char ** name, int * len, struct inode *); +extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *); extern char * get_rock_ridge_symlink(struct inode *); extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inode *); + +int get_joliet_filename(struct iso_directory_record *, struct inode *, unsigned char *); /* The stuff that follows may be totally unneeded. I have not checked to see which prototypes we are still using. */ diff -u --recursive --new-file v2.1.59/linux/include/linux/iso_fs_sb.h linux/include/linux/iso_fs_sb.h --- v2.1.59/linux/include/linux/iso_fs_sb.h Thu Dec 21 22:51:08 1995 +++ linux/include/linux/iso_fs_sb.h Thu Oct 23 14:00:15 1997 @@ -5,26 +5,29 @@ * iso9660 super-block data in memory */ struct isofs_sb_info { - unsigned long s_ninodes; - unsigned long s_nzones; - unsigned long s_firstdatazone; - unsigned long s_log_zone_size; - unsigned long s_max_size; - - unsigned char s_high_sierra; /* A simple flag */ - unsigned char s_mapping; - unsigned char s_conversion; - unsigned char s_rock; - unsigned char s_name_check; /* r = relaxed, s = strict */ - unsigned char s_cruft; /* Broken disks with high - byte of length containing - junk */ - unsigned char s_unhide; - unsigned char s_nosuid; - unsigned char s_nodev; - mode_t s_mode; - gid_t s_gid; - uid_t s_uid; + unsigned long s_ninodes; + unsigned long s_nzones; + unsigned long s_firstdatazone; + unsigned long s_log_zone_size; + unsigned long s_max_size; + + unsigned char s_high_sierra; /* A simple flag */ + unsigned char s_mapping; + unsigned char s_conversion; + unsigned char s_rock; + unsigned char s_joliet_level; + unsigned char s_utf8; + unsigned char s_name_check; /* r = relaxed, s = strict */ + unsigned char s_cruft; /* Broken disks with high + byte of length containing + junk */ + unsigned char s_unhide; + unsigned char s_nosuid; + unsigned char s_nodev; + mode_t s_mode; + gid_t s_gid; + uid_t s_uid; + struct nls_table *s_nls_iocharset; /* Native language support table */ }; #endif diff -u --recursive --new-file v2.1.59/linux/include/linux/module.h linux/include/linux/module.h --- v2.1.59/linux/include/linux/module.h Mon Jul 7 16:02:01 1997 +++ linux/include/linux/module.h Thu Oct 23 14:32:26 1997 @@ -130,6 +130,9 @@ #define __MODULE_STRING_1(x) #x #define __MODULE_STRING(x) __MODULE_STRING_1(x) +/* Find a symbol exported by the kernel or another module */ +extern unsigned long get_module_symbol(char *, char *); + #if defined(MODULE) && !defined(__GENKSYMS__) /* Embedded module documentation macros. */ diff -u --recursive --new-file v2.1.59/linux/include/linux/msdos_fs.h linux/include/linux/msdos_fs.h --- v2.1.59/linux/include/linux/msdos_fs.h Tue Sep 23 16:48:50 1997 +++ linux/include/linux/msdos_fs.h Thu Oct 23 14:32:30 1997 @@ -73,7 +73,9 @@ #define EOF_FAT12 0xFF8 /* standard EOF */ #define EOF_FAT16 0xFFF8 -#define EOF_FAT(s) (MSDOS_SB(s)->fat_bits == 16 ? 0xFFF8 : 0xFF8) +#define EOF_FAT32 0xFFFFFF8 +#define EOF_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? EOF_FAT32 : \ + MSDOS_SB(s)->fat_bits == 16 ? EOF_FAT16 : EOF_FAT12) /* * Inode flags @@ -83,8 +85,8 @@ /* * ioctl commands */ -#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, long) -#define VFAT_IOCTL_READDIR_SHORT _IOW('r', 2, long) +#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2]) +#define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct dirent [2]) /* * Conversion from and to little-endian byte order. (no-op on i386/i486) @@ -98,7 +100,7 @@ #define CT_LE_W(v) cpu_to_le16(v) #define CT_LE_L(v) cpu_to_le32(v) -struct msdos_boot_sector { +struct fat_boot_sector { __s8 ignored[3]; /* Boot strap short or near jump */ __s8 system_id[8]; /* Name - can be used to special case partition manager volumes */ @@ -114,6 +116,24 @@ __u16 heads; /* number of heads */ __u32 hidden; /* hidden sectors (unused) */ __u32 total_sect; /* number of sectors (if sectors == 0) */ + + /* The following fields are only used by FAT32 */ + __u32 fat32_length; /* sectors/FAT */ + __u16 flags; /* bit 8: fat mirroring, low 4: active fat */ + __u8 version[2]; /* major, minor filesystem version */ + __u32 root_cluster; /* first cluster in root directory */ + __u16 info_sector; /* filesystem info sector */ + __u16 backup_boot; /* backup boot sector */ + __u16 reserved2[6]; /* Unused */ +}; + +struct fat_boot_fsinfo { + __u32 reserved1; /* Nothing as far as I can tell */ + __u32 signature; /* 0x61417272L */ + __u32 free_clusters; /* Free cluster count. -1 if unknown */ + __u32 next_cluster; /* Most recently allocated cluster. + * Unused under Linux. */ + __u32 reserved2[4]; }; struct msdos_dir_entry { @@ -124,7 +144,7 @@ __u16 ctime; /* Creation time */ __u16 cdate; /* Creation date */ __u16 adate; /* Last access date */ - __u8 unused[2]; + __u16 starthi; /* High 16 bits of cluster in FAT32 */ __u16 time,date,start;/* time, date and first cluster */ __u32 size; /* file size (in bytes) */ }; @@ -137,7 +157,7 @@ __u8 reserved; /* always 0 */ __u8 alias_checksum; /* checksum for 8.3 alias */ __u8 name5_10[12]; /* 6 more characters in name */ - __u8 start[2]; /* starting cluster number */ + __u16 start; /* starting cluster number, 0 in long slots */ __u8 name11_12[4]; /* last 2 characters in name */ }; @@ -190,6 +210,7 @@ struct msdos_dir_entry **res_de,int *ino,char scantype); extern int fat_parent_ino(struct inode *dir,int locked); extern int fat_subdirs(struct inode *dir); +void fat_clusters_flush(struct super_block *sb); /* fat.c */ extern int fat_access(struct super_block *sb,int nr,int new_value); @@ -227,8 +248,8 @@ /* file.c */ extern struct inode_operations fat_file_inode_operations; extern struct inode_operations fat_file_inode_operations_1024; -extern long fat_file_read(struct inode *, struct file *, char *, unsigned long); -extern long fat_file_write(struct inode *, struct file *, const char *, unsigned long); +extern ssize_t fat_file_read(struct file *, char *, size_t, loff_t *); +extern ssize_t fat_file_write(struct file *, const char *, size_t, loff_t *); extern void fat_truncate(struct inode *inode); /* mmap.c */ @@ -257,12 +278,30 @@ extern int msdos_rename(struct inode *old_dir,struct dentry *old_dentry, struct inode *new_dir,struct dentry *new_dentry); +/* nls.c */ +extern int init_fat_nls(void); +extern struct fat_nls_table *fat_load_nls(int codepage); + +/* tables.c */ +extern unsigned char fat_uni2esc[]; +extern unsigned char fat_esc2uni[]; + /* fatfs_syms.c */ extern int init_fat_fs(void); +extern void cleanup_fat_fs(void); + +/* nls.c */ +extern int fat_register_nls(struct fat_nls_table * fmt); +extern int fat_unregister_nls(struct fat_nls_table * fmt); +extern struct fat_nls_table *fat_find_nls(int codepage); +extern struct fat_nls_table *fat_load_nls(int codepage); +extern void fat_unload_nls(int codepage); +extern int init_fat_nls(void); /* vfat/namei.c - these are for dmsdos */ extern int vfat_create(struct inode *dir,struct dentry *dentry,int mode); extern int vfat_unlink(struct inode *dir,struct dentry *dentry); +extern int vfat_unlink_uvfat(struct inode *dir,struct dentry *dentry); extern int vfat_mkdir(struct inode *dir,struct dentry *dentry,int mode); extern int vfat_rmdir(struct inode *dir,struct dentry *dentry); extern int vfat_rename(struct inode *old_dir,struct dentry *old_dentry, @@ -272,6 +311,9 @@ int silent); extern void vfat_read_inode(struct inode *inode); extern int vfat_lookup(struct inode *dir,struct dentry *); + +/* vfat/vfatfs_syms.c */ +extern struct file_system_type vfat_fs_type; #endif /* __KERNEL__ */ diff -u --recursive --new-file v2.1.59/linux/include/linux/msdos_fs_i.h linux/include/linux/msdos_fs_i.h --- v2.1.59/linux/include/linux/msdos_fs_i.h Sun Apr 21 01:11:13 1996 +++ linux/include/linux/msdos_fs_i.h Thu Oct 23 14:00:15 1997 @@ -26,6 +26,7 @@ */ struct pipe_inode_info reserved; int i_start; /* first cluster or 0 */ + int i_logstart; /* logical first cluster */ int i_attrs; /* unused attribute bits */ int i_busy; /* file is either deleted but still open, or inconsistent (mkdir) */ diff -u --recursive --new-file v2.1.59/linux/include/linux/msdos_fs_sb.h linux/include/linux/msdos_fs_sb.h --- v2.1.59/linux/include/linux/msdos_fs_sb.h Mon Aug 4 16:25:40 1997 +++ linux/include/linux/msdos_fs_sb.h Thu Oct 23 14:00:15 1997 @@ -9,6 +9,8 @@ uid_t fs_uid; gid_t fs_gid; unsigned short fs_umask; + unsigned short codepage; /* Codepage for shortname conversions */ + char *iocharset; /* Charset used for filename input/display */ unsigned char name_check; /* r = relaxed, n = normal, s = strict */ unsigned char conversion; /* b = binary, t = text, a = auto */ unsigned quiet:1, /* set = fake successful chmods and chowns */ @@ -16,12 +18,18 @@ sys_immutable:1, /* set = system files are immutable */ dotsOK:1, /* set = hidden and system files are named '.filename' */ isvfat:1, /* 0=no vfat long filename support, 1=vfat support */ + utf8:1, /* Use of UTF8 character set (Default) */ unicode_xlate:1, /* create escape sequences for unhandled Unicode */ posixfs:1, /* Allow names like makefile and Makefile to coexist */ numtail:1, /* Does first alias have a numeric '~1' type tail? */ - atari:1; /* Use Atari GEMDOS variation of MS-DOS fs */ + atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ + fat32:1; /* Is this a FAT32 partition? */ }; +struct vfat_unicode { + unsigned char uni1; + unsigned char uni2; +}; struct msdos_sb_info { unsigned short cluster_size; /* sectors/cluster */ @@ -30,11 +38,15 @@ unsigned short dir_start,dir_entries; /* root dir start & entries */ unsigned short data_start; /* first data sector */ unsigned long clusters; /* number of clusters */ + unsigned long root_cluster; /* first cluster of the root directory */ + unsigned long fsinfo_offset; /* FAT32 fsinfo offset from start of disk */ struct wait_queue *fat_wait; int fat_lock; int prev_free; /* previously returned free cluster number */ int free_clusters; /* -1 if undefined */ struct fat_mount_options options; + struct nls_table *nls_disk; /* Codepage used on disk */ + struct nls_table *nls_io; /* Charset used for input and display */ }; #endif diff -u --recursive --new-file v2.1.59/linux/include/linux/nls.h linux/include/linux/nls.h --- v2.1.59/linux/include/linux/nls.h Wed Dec 31 16:00:00 1969 +++ linux/include/linux/nls.h Thu Oct 23 14:00:15 1997 @@ -0,0 +1,54 @@ +struct nls_unicode { + unsigned char uni1; + unsigned char uni2; +}; + +struct nls_table { + char *charset; + unsigned char **page_uni2charset; + struct nls_unicode *charset2uni; + + void (*inc_use_count) (void); + void (*dec_use_count) (void); + struct nls_table *next; +}; + +/* nls.c */ +extern int init_nls(void); +extern int register_nls(struct nls_table *); +extern int unregister_nls(struct nls_table *); +extern struct nls_table *find_nls(char *); +extern struct nls_table *load_nls(char *); +extern void unload_nls(struct nls_table *); +extern struct nls_table *load_nls_default(void); + +extern int utf8_mbtowc(__u16 *, const __u8 *, int); +extern int utf8_mbstowcs(__u16 *, const __u8 *, int); +extern int utf8_wctomb(__u8 *, __u16, int); +extern int utf8_wcstombs(__u8 *, const __u16 *, int); + +extern int init_nls_iso8859_1(void); +extern int init_nls_iso8859_2(void); +extern int init_nls_iso8859_3(void); +extern int init_nls_iso8859_4(void); +extern int init_nls_iso8859_5(void); +extern int init_nls_iso8859_6(void); +extern int init_nls_iso8859_7(void); +extern int init_nls_iso8859_8(void); +extern int init_nls_iso8859_9(void); +extern int init_nls_cp437(void); +extern int init_nls_cp737(void); +extern int init_nls_cp775(void); +extern int init_nls_cp850(void); +extern int init_nls_cp852(void); +extern int init_nls_cp855(void); +extern int init_nls_cp857(void); +extern int init_nls_cp860(void); +extern int init_nls_cp861(void); +extern int init_nls_cp862(void); +extern int init_nls_cp863(void); +extern int init_nls_cp864(void); +extern int init_nls_cp865(void); +extern int init_nls_cp866(void); +extern int init_nls_cp869(void); +extern int init_nls_cp874(void); diff -u --recursive --new-file v2.1.59/linux/include/linux/pci.h linux/include/linux/pci.h --- v2.1.59/linux/include/linux/pci.h Sun Sep 7 13:10:43 1997 +++ linux/include/linux/pci.h Mon Oct 20 17:25:16 1997 @@ -221,10 +221,15 @@ */ #define PCI_VENDOR_ID_COMPAQ 0x0e11 #define PCI_DEVICE_ID_COMPAQ_1280 0x3033 -#define PCI_DEVICE_ID_COMPAQ_NETELL100 0xae32 -#define PCI_DEVICE_ID_COMPAQ_NETELL10 0xae34 -#define PCI_DEVICE_ID_COMPAQ_NETFLEX3 0xae35 +#define PCI_DEVICE_ID_COMPAQ_SMART2P 0xae10 +#define PCI_DEVICE_ID_COMPAQ_NETEL100 0xae32 +#define PCI_DEVICE_ID_COMPAQ_NETEL10 0xae34 +#define PCI_DEVICE_ID_COMPAQ_NETFLEX3I 0xae35 +#define PCI_DEVICE_ID_COMPAQ_NETEL100D 0xae40 +#define PCI_DEVICE_ID_COMPAQ_NETEL100PI 0xae43 +#define PCI_DEVICE_ID_COMPAQ_NETEL100I 0xb011 #define PCI_DEVICE_ID_COMPAQ_THUNDER 0xf130 +#define PCI_DEVICE_ID_COMPAQ_NETFLEX3B 0xf150 #define PCI_VENDOR_ID_NCR 0x1000 #define PCI_DEVICE_ID_NCR_53C810 0x0001 @@ -241,7 +246,9 @@ #define PCI_DEVICE_ID_ATI_68800 0x4158 #define PCI_DEVICE_ID_ATI_215CT222 0x4354 #define PCI_DEVICE_ID_ATI_210888CX 0x4358 +#define PCI_DEVICE_ID_ATI_215GP 0x4750 #define PCI_DEVICE_ID_ATI_215GT 0x4754 +#define PCI_DEVICE_ID_ATI_215GTB 0x4755 #define PCI_DEVICE_ID_ATI_210888GX 0x4758 #define PCI_DEVICE_ID_ATI_264VT 0x5654 @@ -334,6 +341,8 @@ #define PCI_VENDOR_ID_MIRO 0x1031 #define PCI_DEVICE_ID_MIRO_36050 0x5601 +#define PCI_VENDOR_ID_NEC 0x1033 + #define PCI_VENDOR_ID_FD 0x1036 #define PCI_DEVICE_ID_FD_36C70 0x0000 @@ -397,11 +406,6 @@ #define PCI_VENDOR_ID_PROMISE 0x105a #define PCI_DEVICE_ID_PROMISE_5300 0x5300 -#define PCI_VENDOR_ID_APPLE 0x106b -#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 -#define PCI_DEVICE_ID_APPLE_GC 0x0002 -#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e - #define PCI_VENDOR_ID_N9 0x105d #define PCI_DEVICE_ID_N9_I128 0x2309 #define PCI_DEVICE_ID_N9_I128_2 0x2339 @@ -420,6 +424,14 @@ #define PCI_VENDOR_ID_X 0x1061 #define PCI_DEVICE_ID_X_AGX016 0x0001 +#define PCI_VENDOR_ID_PICOP 0x1066 +#define PCI_DEVICE_ID_PICOP_PT86C52X 0x0001 + +#define PCI_VENDOR_ID_APPLE 0x106b +#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 +#define PCI_DEVICE_ID_APPLE_GC 0x0002 +#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e + #define PCI_VENDOR_ID_NEXGEN 0x1074 #define PCI_DEVICE_ID_NEXGEN_82C501 0x4e78 @@ -459,7 +471,7 @@ #define PCI_DEVICE_ID_VISION_QD8580 0x0002 #define PCI_VENDOR_ID_BROOKTREE 0x109e -#define PCI_DEVICE_ID_BT848 0x0350 /* 0x350 = 848 */ +#define PCI_DEVICE_ID_BROOKTREE_848 0x0350 #define PCI_VENDOR_ID_SIERRA 0x10a8 #define PCI_DEVICE_ID_SIERRA_STB 0x0000 @@ -485,6 +497,7 @@ #define PCI_DEVICE_ID_3COM_3C905TX 0x9050 #define PCI_VENDOR_ID_SMC 0x10b8 +#define PCI_DEVICE_ID_SMC_EPIC100 0x0005 #define PCI_VENDOR_ID_AL 0x10b9 #define PCI_DEVICE_ID_AL_M1445 0x1445 @@ -494,13 +507,20 @@ #define PCI_DEVICE_ID_AL_M1489 0x1489 #define PCI_DEVICE_ID_AL_M1511 0x1511 #define PCI_DEVICE_ID_AL_M1513 0x1513 +#define PCI_DEVICE_ID_AL_M1521 0x1521 +#define PCI_DEVICE_ID_AL_M1523 0x1523 +#define PCI_DEVICE_ID_AL_M1531 0x1531 +#define PCI_DEVICE_ID_AL_M1533 0x1533 #define PCI_DEVICE_ID_AL_M4803 0x5215 +#define PCI_DEVICE_ID_AL_M5219 0x5219 +#define PCI_DEVICE_ID_AL_M5229 0x5229 #define PCI_VENDOR_ID_MITSUBISHI 0x10ba #define PCI_VENDOR_ID_NEOMAGIC 0x10c8 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2070 0x0001 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128V 0x0002 +#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZV 0x0003 #define PCI_VENDOR_ID_ASP 0x10cd #define PCI_DEVICE_ID_ASP_ABP940 0x1200 @@ -543,9 +563,13 @@ #define PCI_DEVICE_ID_VIA_82C586_1 0x0571 #define PCI_DEVICE_ID_VIA_82C576 0x0576 #define PCI_DEVICE_ID_VIA_82C585 0x0585 -#define PCI_DEVICE_ID_VIA_82C586 0x0586 +#define PCI_DEVICE_ID_VIA_82C586_0 0x0586 #define PCI_DEVICE_ID_VIA_82C926 0x0926 +#define PCI_DEVICE_ID_VIA_82C595 0x0595 #define PCI_DEVICE_ID_VIA_82C416 0x1571 +#define PCI_DEVICE_ID_VIA_82C595_97 0x1595 +#define PCI_DEVICE_ID_VIA_82C586_2 0x3038 +#define PCI_DEVICE_ID_VIA_82C586_3 0x3040 #define PCI_VENDOR_ID_VORTEX 0x1119 #define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 @@ -562,6 +586,24 @@ #define PCI_DEVICE_ID_VORTEX_GDT6x25 0x000b #define PCI_DEVICE_ID_VORTEX_GDT6535 0x000c #define PCI_DEVICE_ID_VORTEX_GDT6555 0x000d +#define PCI_DEVICE_ID_VORTEX_GDT6x17RP 0x0100 +#define PCI_DEVICE_ID_VORTEX_GDT6x27RP 0x0101 +#define PCI_DEVICE_ID_VORTEX_GDT6537RP 0x0102 +#define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x0103 +#define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x0104 +#define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x0105 +#define PCI_DEVICE_ID_VORTEX_GDT6x17RP1 0x0110 +#define PCI_DEVICE_ID_VORTEX_GDT6x27RP1 0x0111 +#define PCI_DEVICE_ID_VORTEX_GDT6537RP1 0x0112 +#define PCI_DEVICE_ID_VORTEX_GDT6557RP1 0x0113 +#define PCI_DEVICE_ID_VORTEX_GDT6x11RP1 0x0114 +#define PCI_DEVICE_ID_VORTEX_GDT6x21RP1 0x0115 +#define PCI_DEVICE_ID_VORTEX_GDT6x17RP2 0x0120 +#define PCI_DEVICE_ID_VORTEX_GDT6x27RP2 0x0121 +#define PCI_DEVICE_ID_VORTEX_GDT6537RP2 0x0122 +#define PCI_DEVICE_ID_VORTEX_GDT6557RP2 0x0123 +#define PCI_DEVICE_ID_VORTEX_GDT6x11RP2 0x0124 +#define PCI_DEVICE_ID_VORTEX_GDT6x21RP2 0x0125 #define PCI_VENDOR_ID_EF 0x111a #define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000 @@ -583,6 +625,7 @@ #define PCI_VENDOR_ID_ALLIANCE 0x1142 #define PCI_DEVICE_ID_ALLIANCE_PROMOTIO 0x3210 #define PCI_DEVICE_ID_ALLIANCE_PROVIDEO 0x6422 +#define PCI_DEVICE_ID_ALLIANCE_AT24 0x6424 #define PCI_VENDOR_ID_VMIC 0x114a #define PCI_DEVICE_ID_VMIC_VME 0x7587 @@ -625,6 +668,7 @@ #define PCI_DEVICE_ID_ZORAN_36120 0x6120 #define PCI_VENDOR_ID_COMPEX 0x11f6 +#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 #define PCI_DEVICE_ID_COMPEX_RL2000 0x1401 #define PCI_VENDOR_ID_RP 0x11fe @@ -652,6 +696,15 @@ #define PCI_DEVICE_ID_OPTIBASE_VPLEXCC 0x2120 #define PCI_DEVICE_ID_OPTIBASE_VQUEST 0x2130 +#define PCI_VENDOR_ID_ENSONIQ 0x1274 +#define PCI_DEVICE_ID_ENSONIQ_AUDIOPCI 0x5000 + +#define PCI_VENDOR_ID_PICTUREL 0x12c5 +#define PCI_DEVICE_ID_PICTUREL_PCIVST 0x0081 + +#define PCI_VENDOR_ID_NVIDIA 0x12d2 +#define PCI_DEVICE_ID_NVIDIA_RIVA128 0x0018 + #define PCI_VENDOR_ID_SYMPHONY 0x1c1c #define PCI_DEVICE_ID_SYMPHONY_101 0x0001 @@ -668,7 +721,11 @@ #define PCI_DEVICE_ID_AVANCE_ALG2064 0x2064 #define PCI_DEVICE_ID_AVANCE_2302 0x2302 +#define PCI_VENDOR_ID_NETVIN 0x4a14 +#define PCI_DEVICE_ID_NETVIN_NV5000SC 0x5000 + #define PCI_VENDOR_ID_S3 0x5333 +#define PCI_DEVICE_ID_S3_PLATO_PXS 0x0551 #define PCI_DEVICE_ID_S3_ViRGE 0x5631 #define PCI_DEVICE_ID_S3_TRIO 0x8811 #define PCI_DEVICE_ID_S3_AURORA64VP 0x8812 @@ -684,6 +741,7 @@ #define PCI_DEVICE_ID_S3_TRIO64V2 0x8901 #define PCI_DEVICE_ID_S3_PLATO_PXG 0x8902 #define PCI_DEVICE_ID_S3_ViRGE_DXGX 0x8a01 +#define PCI_DEVICE_ID_S3_ViRGE_GX2 0x8a10 #define PCI_VENDOR_ID_INTEL 0x8086 #define PCI_DEVICE_ID_INTEL_82375 0x0482 @@ -714,7 +772,7 @@ #define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 #define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 #define PCI_DEVICE_ID_INTEL_P6 0x84c4 -#define PCI_DEVICE_ID_INTEL_P6_2 0x84c5 +#define PCI_DEVICE_ID_INTEL_82450GX 0x84c5 #define PCI_VENDOR_ID_KTI 0x8e2e #define PCI_DEVICE_ID_KTI_ET32P2 0x3000 diff -u --recursive --new-file v2.1.59/linux/include/linux/sysctl.h linux/include/linux/sysctl.h --- v2.1.59/linux/include/linux/sysctl.h Thu Sep 4 17:07:31 1997 +++ linux/include/linux/sysctl.h Thu Oct 23 13:30:28 1997 @@ -69,7 +69,8 @@ KERN_CTLALTDEL, /* int: allow ctl-alt-del to reboot */ KERN_PRINTK, /* sturct: control printk logging parameters */ KERN_NAMETRANS, /* Name translation */ - KERN_STATINODE + KERN_STATINODE, + KERN_DENTRY /* dentry statistics */ }; diff -u --recursive --new-file v2.1.59/linux/include/linux/sysv_fs.h linux/include/linux/sysv_fs.h --- v2.1.59/linux/include/linux/sysv_fs.h Tue Sep 23 16:48:50 1997 +++ linux/include/linux/sysv_fs.h Thu Oct 23 14:33:45 1997 @@ -385,7 +385,7 @@ extern struct buffer_head * sysv_getblk(struct inode *, unsigned int, int); extern struct buffer_head * sysv_file_bread(struct inode *, int, int); -extern long sysv_file_read(struct inode *, struct file *, char *, unsigned long); +extern ssize_t sysv_file_read(struct file *, char *, size_t, loff_t *); extern void sysv_truncate(struct inode *); extern void sysv_put_super(struct super_block *); diff -u --recursive --new-file v2.1.59/linux/include/linux/tty_ldisc.h linux/include/linux/tty_ldisc.h --- v2.1.59/linux/include/linux/tty_ldisc.h Mon Jul 7 16:02:02 1997 +++ linux/include/linux/tty_ldisc.h Thu Oct 23 14:32:17 1997 @@ -25,22 +25,22 @@ * buffers of any input characters it may have queued to be * delivered to the user mode process. * - * int (*chars_in_buffer)(struct tty_struct *tty); + * ssize_t (*chars_in_buffer)(struct tty_struct *tty); * * This function returns the number of input characters the line * iscpline may have queued up to be delivered to the user mode * process. * - * int (*read)(struct tty_struct * tty, struct file * file, - * unsigned char * buf, unsigned int nr); + * ssize_t (*read)(struct tty_struct * tty, struct file * file, + * unsigned char * buf, size_t nr); * * This function is called when the user requests to read from * the tty. The line discpline will return whatever characters * it has buffered up for the user. If this function is not * defined, the user will receive an EIO error. * - * int (*write)(struct tty_struct * tty, struct file * file, - * const unsigned char * buf, unsigned int nr); + * ssize_t (*write)(struct tty_struct * tty, struct file * file, + * const unsigned char * buf, size_t nr); * * This function is called when the user requests to write to the * tty. The line discpline will deliver the characters to the @@ -111,11 +111,11 @@ int (*open)(struct tty_struct *); void (*close)(struct tty_struct *); void (*flush_buffer)(struct tty_struct *tty); - int (*chars_in_buffer)(struct tty_struct *tty); - int (*read)(struct tty_struct * tty, struct file * file, - unsigned char * buf, unsigned int nr); - int (*write)(struct tty_struct * tty, struct file * file, - const unsigned char * buf, unsigned int nr); + ssize_t (*chars_in_buffer)(struct tty_struct *tty); + ssize_t (*read)(struct tty_struct * tty, struct file * file, + unsigned char * buf, size_t nr); + ssize_t (*write)(struct tty_struct * tty, struct file * file, + const unsigned char * buf, size_t nr); int (*ioctl)(struct tty_struct * tty, struct file * file, unsigned int cmd, unsigned long arg); void (*set_termios)(struct tty_struct *tty, struct termios * old); diff -u --recursive --new-file v2.1.59/linux/kernel/ksyms.c linux/kernel/ksyms.c --- v2.1.59/linux/kernel/ksyms.c Wed Oct 15 16:04:24 1997 +++ linux/kernel/ksyms.c Thu Oct 23 14:00:15 1997 @@ -90,6 +90,9 @@ }; #endif +#ifdef CONFIG_MODULES +EXPORT_SYMBOL(get_module_symbol); +#endif #ifdef CONFIG_KERNELD EXPORT_SYMBOL(kerneld_send); #endif diff -u --recursive --new-file v2.1.59/linux/kernel/module.c linux/kernel/module.c --- v2.1.59/linux/kernel/module.c Sun Sep 7 13:10:43 1997 +++ linux/kernel/module.c Thu Oct 23 14:00:15 1997 @@ -871,7 +871,6 @@ } safe_copy_cstr("]"); } - safe_copy_cstr("\n"); #undef safe_copy_str @@ -930,6 +929,34 @@ if (len > length) len = length; return len; +} + +/* + * Gets the address for a symbol in the given module. If modname is + * NULL, it looks for the name in any registered symbol table. If the + * modname is an empty string, it looks for the symbol in kernel exported + * symbol tables. + */ +unsigned long +get_module_symbol(char *modname, char *symname) +{ + struct module *mp; + struct module_symbol *sym; + int i; + + for (mp = module_list; mp; mp = mp->next) { + if (((modname == NULL) || (strcmp(mp->name, modname) == 0)) && + (mp->flags == MOD_RUNNING) && (mp->nsyms > 0)) { + for (i = mp->nsyms, sym = mp->syms; + i > 0; --i, ++sym) { + + if (strcmp(sym->name, symname) == 0) { + return sym->value; + } + } + } + } + return 0; } #else /* CONFIG_MODULES */ diff -u --recursive --new-file v2.1.59/linux/kernel/sys.c linux/kernel/sys.c --- v2.1.59/linux/kernel/sys.c Wed Sep 24 20:05:48 1997 +++ linux/kernel/sys.c Tue Oct 21 08:57:30 1997 @@ -358,8 +358,8 @@ fs = get_fs(); set_fs(KERNEL_DS); - acct_file.f_op->write(acct_file.f_dentry->d_inode, &acct_file, - (char *)&ac, sizeof(struct acct)); + acct_file.f_op->write(&acct_file, (char *)&ac, sizeof(struct acct), + &acct_file.f_pos); set_fs(fs); } return 0; diff -u --recursive --new-file v2.1.59/linux/kernel/sysctl.c linux/kernel/sysctl.c --- v2.1.59/linux/kernel/sysctl.c Wed Oct 15 16:04:24 1997 +++ linux/kernel/sysctl.c Thu Oct 23 13:30:31 1997 @@ -69,10 +69,8 @@ #ifdef CONFIG_PROC_FS -static long proc_readsys(struct inode * inode, struct file * file, - char * buf, unsigned long count); -static long proc_writesys(struct inode * inode, struct file * file, - const char * buf, unsigned long count); +static ssize_t proc_readsys(struct file *, char *, size_t, loff_t *); +static ssize_t proc_writesys(struct file *, const char *, size_t, loff_t *); static int proc_sys_permission(struct inode *, int); struct file_operations proc_sys_file_operations = @@ -113,6 +111,7 @@ extern struct proc_dir_entry proc_sys_root; extern int inodes_stat[]; +extern int dentry_stat[]; static void register_proc_table(ctl_table *, struct proc_dir_entry *); static void unregister_proc_table(ctl_table *, struct proc_dir_entry *); #endif @@ -151,6 +150,8 @@ 0444, NULL, &proc_dointvec}, {KERN_MAXFILE, "file-max", &max_files, sizeof(int), 0644, NULL, &proc_dointvec}, + {KERN_DENTRY, "dentry-state", &dentry_stat, 6*sizeof(int), + 0444, NULL, &proc_dointvec}, {KERN_SECURELVL, "securelevel", &securelevel, sizeof(int), 0444, NULL, &proc_dointvec, (ctl_handler *)&do_securelevel_strategy}, {KERN_PANIC, "panic", &panic_timeout, sizeof(int), @@ -522,17 +523,16 @@ } } - -static long do_rw_proc(int write, struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t do_rw_proc(int write, struct file * file, char * buf, + size_t count, loff_t *ppos) { int op; struct proc_dir_entry *de; struct ctl_table *table; size_t res; - long error; + ssize_t error; - de = (struct proc_dir_entry*) inode->u.generic_ip; + de = (struct proc_dir_entry*) file->f_dentry->d_inode->u.generic_ip; if (!de || !de->data) return -ENOTDIR; table = (struct ctl_table *) de->data; @@ -543,22 +543,27 @@ return -EPERM; res = count; + + /* + * FIXME: we need to pass on ppos to the handler. + */ + error = (*table->proc_handler) (table, write, file, buf, &res); if (error) return error; return res; } -static long proc_readsys(struct inode * inode, struct file * file, - char * buf, unsigned long count) +static ssize_t proc_readsys(struct file * file, char * buf, + size_t count, loff_t *ppos) { - return do_rw_proc(0, inode, file, buf, count); + return do_rw_proc(0, file, buf, count, ppos); } -static long proc_writesys(struct inode * inode, struct file * file, - const char * buf, unsigned long count) +static ssize_t proc_writesys(struct file * file, const char * buf, + size_t count, loff_t *ppos) { - return do_rw_proc(1, inode, file, (char *) buf, count); + return do_rw_proc(1, file, (char *) buf, count, ppos); } static int proc_sys_permission(struct inode *inode, int op) diff -u --recursive --new-file v2.1.59/linux/mm/filemap.c linux/mm/filemap.c --- v2.1.59/linux/mm/filemap.c Wed Oct 15 16:04:24 1997 +++ linux/mm/filemap.c Tue Oct 21 08:57:30 1997 @@ -555,11 +555,12 @@ * of the logic when it comes to error handling etc. */ -long generic_file_read(struct inode * inode, struct file * filp, - char * buf, unsigned long count) +ssize_t generic_file_read(struct file * filp, char * buf, + size_t count, loff_t *ppos) { - int error, read; - unsigned long pos, ppos, page_cache; + struct inode *inode = filp->f_dentry->d_inode; + ssize_t error, read; + size_t pos, pgpos, page_cache; int reada_ok; if (!access_ok(VERIFY_WRITE, buf, count)) @@ -570,8 +571,8 @@ read = 0; page_cache = 0; - pos = filp->f_pos; - ppos = pos & PAGE_MASK; + pos = *ppos; + pgpos = pos & PAGE_MASK; /* * If the current position is outside the previous read-ahead window, * we reset the current read-ahead context and set read ahead max to zero @@ -579,7 +580,7 @@ * otherwise, we assume that the file accesses are sequential enough to * continue read-ahead. */ - if (ppos > filp->f_raend || ppos + filp->f_rawin < filp->f_raend) { + if (pgpos > filp->f_raend || pgpos + filp->f_rawin < filp->f_raend) { reada_ok = 0; filp->f_raend = 0; filp->f_ralen = 0; @@ -600,7 +601,7 @@ } else { unsigned long needed; - needed = ((pos + count) & PAGE_MASK) - ppos; + needed = ((pos + count) & PAGE_MASK) - pgpos; if (filp->f_ramax < needed) filp->f_ramax = needed; @@ -736,7 +737,7 @@ break; } - filp->f_pos = pos; + *ppos = pos; filp->f_reada = 1; if (page_cache) free_page(page_cache); @@ -909,7 +910,8 @@ old_fs = get_fs(); set_fs(KERNEL_DS); retval = -EIO; - if (size == file->f_op->write(inode, file, (const char *) page, size)) + if (size == file->f_op->write(file, (const char *) page, + size, &file->f_pos)) retval = 0; set_fs(old_fs); return retval; @@ -1299,21 +1301,23 @@ * file system has to do this all by itself, unfortunately. * okir@monad.swb.de */ -long -generic_file_write(struct inode *inode, struct file *file, const char *buf, unsigned long count) +ssize_t +generic_file_write(struct file *file, const char *buf, + size_t count, loff_t *ppos) { + struct inode *inode = file->f_dentry->d_inode; struct page *page, **hash; unsigned long page_cache = 0; - unsigned long ppos, offset; - unsigned int bytes, written; + unsigned long pgpos, offset; + unsigned long bytes, written; unsigned long pos; - int status, sync, didread; + long status, sync, didread; if (!inode->i_op || !inode->i_op->updatepage) return -EIO; sync = file->f_flags & O_SYNC; - pos = file->f_pos; + pos = *ppos; written = 0; status = 0; @@ -1326,13 +1330,13 @@ * allocate a free page. */ offset = (pos & ~PAGE_MASK); - ppos = pos & PAGE_MASK; + pgpos = pos & PAGE_MASK; if ((bytes = PAGE_SIZE - offset) > count) bytes = count; - hash = page_hash(inode, ppos); - if (!(page = __find_page(inode, ppos, *hash))) { + hash = page_hash(inode, pgpos); + if (!(page = __find_page(inode, pgpos, *hash))) { if (!page_cache) { page_cache = __get_free_page(GFP_KERNEL); if (!page_cache) { @@ -1342,7 +1346,7 @@ continue; } page = mem_map + MAP_NR(page_cache); - add_to_page_cache(page, inode, ppos, hash); + add_to_page_cache(page, inode, pgpos, hash); page_cache = 0; } @@ -1362,7 +1366,7 @@ * after the current end of file. */ if (!PageUptodate(page)) { - if (bytes < PAGE_SIZE && ppos < inode->i_size) { + if (bytes < PAGE_SIZE && pgpos < inode->i_size) { if (didread < 2) status = inode->i_op->readpage(inode, page); else @@ -1388,7 +1392,7 @@ pos += status; buf += status; } - file->f_pos = pos; + *ppos = pos; if (pos > inode->i_size) inode->i_size = pos; diff -u --recursive --new-file v2.1.59/linux/mm/vmscan.c linux/mm/vmscan.c --- v2.1.59/linux/mm/vmscan.c Wed Oct 15 16:04:24 1997 +++ linux/mm/vmscan.c Thu Oct 23 13:30:25 1997 @@ -17,12 +17,11 @@ #include #include #include -#include #include -#include #include #include #include +#include #include #include @@ -352,6 +351,8 @@ int i=6; int stop; + /* Let the dcache know we're looking for memory ... */ + shrink_dcache_memory(); /* Always trim SLAB caches when memory gets low. */ (void) kmem_cache_reap(0, dma, wait); diff -u --recursive --new-file v2.1.59/linux/net/netsyms.c linux/net/netsyms.c --- v2.1.59/linux/net/netsyms.c Sun Sep 7 13:10:44 1997 +++ linux/net/netsyms.c Thu Oct 23 14:30:45 1997 @@ -319,7 +319,6 @@ EXPORT_SYMBOL(dev_alloc_skb); EXPORT_SYMBOL(netif_rx); EXPORT_SYMBOL(dev_tint); -EXPORT_SYMBOL(irq2dev_map); EXPORT_SYMBOL(dev_add_pack); EXPORT_SYMBOL(dev_remove_pack); EXPORT_SYMBOL(dev_get); diff -u --recursive --new-file v2.1.59/linux/net/socket.c linux/net/socket.c --- v2.1.59/linux/net/socket.c Tue Sep 23 16:48:50 1997 +++ linux/net/socket.c Tue Oct 21 08:57:30 1997 @@ -97,10 +97,10 @@ static long long sock_lseek(struct file *file, long long offset, int whence); -static long sock_read(struct inode *inode, struct file *file, - char *buf, unsigned long size); -static long sock_write(struct inode *inode, struct file *file, - const char *buf, unsigned long size); +static ssize_t sock_read(struct file *file, char *buf, + size_t size, loff_t *ppos); +static ssize_t sock_write(struct file *file, const char *buf, + size_t size, loff_t *ppos); static int sock_close(struct inode *inode, struct file *file); static unsigned int sock_poll(struct file *file, poll_table *wait); @@ -362,18 +362,20 @@ * area ubuf...ubuf+size-1 is writable before asking the protocol. */ -static long sock_read(struct inode *inode, struct file *file, - char *ubuf, unsigned long size) +static ssize_t sock_read(struct file *file, char *ubuf, + size_t size, loff_t *ppos) { struct socket *sock; struct iovec iov; struct msghdr msg; - sock = socki_lookup(inode); - + if (ppos != &file->f_pos) + return -ESPIPE; if (size==0) /* Match SYS5 behaviour */ return 0; + sock = socki_lookup(file->f_dentry->d_inode); + msg.msg_name=NULL; msg.msg_namelen=0; msg.msg_iov=&iov; @@ -389,21 +391,23 @@ /* - * Write data to a socket. We verify that the user area ubuf..ubuf+size-1 is - * readable by the user process. + * Write data to a socket. We verify that the user area ubuf..ubuf+size-1 + * is readable by the user process. */ -static long sock_write(struct inode *inode, struct file *file, - const char *ubuf, unsigned long size) +static ssize_t sock_write(struct file *file, const char *ubuf, + size_t size, loff_t *ppos) { struct socket *sock; struct msghdr msg; struct iovec iov; - sock = socki_lookup(inode); - + if (ppos != &file->f_pos) + return -ESPIPE; if(size==0) /* Match SYS5 behaviour */ return 0; + + sock = socki_lookup(file->f_dentry->d_inode); msg.msg_name=NULL; msg.msg_namelen=0;