%
%    Czech/Slovak input file encodings for LaTeX2e (JZ)
%
%%% File: input-encoding
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{input-encoding}[1994/09/18 Czech/Slovak input encoding package]

%\DeclareOption{KOI}{\AtBeginDocument{\inputencoding{KOI}}}
%\DeclareOption{IL2}{\AtBeginDocument{\inputencoding{IL2}}}
%\DeclareOption{T1}{\AtBeginDocument{\inputencoding{T1}}}

\expandafter\ifx\csname KOI input\endcsname\relax
                \expandafter\newtoks\csname KOI input\endcsname\fi
\expandafter\ifx\csname T1 input\endcsname\relax
                \expandafter\newtoks\csname T1 input\endcsname\fi
\expandafter\ifx\csname IL2 input\endcsname\relax
                \expandafter\newtoks\csname IL2 input\endcsname\fi

\def\i@encoding{}

\bgroup
\count0=128
\loop \catcode\count0=\active
      \advance\count0 by 1
      \ifnum\count0<256 \repeat
\gdef\DefineInputCode#1#2#3#4{%
  \def\SelectCode##1##2{\bgroup\count0=128
    \def\PickCode####1{\ifnum\count0=##1 
                        \expandafter\IgnoreRest\expandafter####1%
                      \else
                        \advance\count0 by 1
                        \expandafter\PickCode
                      \fi}%
    \def\adddef####1{\egroup\global\csname##2 input\endcsname=\expandafter
                                \expandafter\expandafter
                                {\expandafter\the\csname##2 input\endcsname
                                 \def####1}}
    \def\IgnoreRest####1####2{\ifx####2\end\expandafter\adddef\expandafter
                              {\expandafter####1\expandafter}%
                            \else
                              \expandafter\IgnoreRest\expandafter####1%
                            \fi}%
  \PickCode
  ^^80^^81^^82^^83^^84^^85^^86^^87^^88^^89^^8a^^8b^^8c^^8d^^8e^^8f%
  ^^90^^91^^92^^93^^94^^95^^96^^97^^98^^99^^9a^^9b^^9c^^9d^^9e^^9f%
  ^^a0^^a1^^a2^^a3^^a4^^a5^^a6^^a7^^a8^^a9^^aa^^ab^^ac^^ad^^ae^^af%
  ^^b0^^b1^^b2^^b3^^b4^^b5^^b6^^b7^^b8^^b9^^ba^^bb^^bc^^bd^^be^^bf%
  ^^c0^^c1^^c2^^c3^^c4^^c5^^c6^^c7^^c8^^c9^^ca^^cb^^cc^^cd^^ce^^cf%
  ^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da^^db^^dc^^dd^^de^^df%
  ^^e0^^e1^^e2^^e3^^e4^^e5^^e6^^e7^^e8^^e9^^ea^^eb^^ec^^ed^^ee^^ef%
  ^^f0^^f1^^f2^^f3^^f4^^f5^^f6^^f7^^f8^^f9^^fa^^fb^^fc^^fd^^fe^^ff\end%
  }%
 \global\csname#2 input\endcsname=\expandafter\expandafter\expandafter
                            {\expandafter\the\csname#2 input\endcsname
                             \catcode#4=\active}%
 \SelectCode{#4}{#2}%
 \global\csname#2 input\endcsname=\expandafter\expandafter\expandafter
                            {\expandafter\the\csname#2 input\endcsname
                             {#1#3}}%
}
\egroup

\DeclareOption{KOI}{\def\i@encoding{KOI}%
\if\the\csname KOI input\endcsname\relax\relax
\PackageInfo{input-encoding}{Setting up KOI input codes}
\DefineInputCode{\'}{KOI}{l}{"CB}%
\DefineInputCode{\'}{KOI}{r}{"C6}%
\DefineInputCode{\'}{KOI}{a}{"C1}%
\DefineInputCode{\'}{KOI}{e}{"D7}%
\DefineInputCode{\'}{KOI}{i}{"C9}%
\DefineInputCode{\'}{KOI}{o}{"CF}%
\DefineInputCode{\'}{KOI}{u}{"D5}%
\DefineInputCode{\'}{KOI}{y}{"D9}%
\DefineInputCode{\'}{KOI}{L}{"EB}%
\DefineInputCode{\'}{KOI}{R}{"E6}%
\DefineInputCode{\'}{KOI}{A}{"E1}%
\DefineInputCode{\'}{KOI}{E}{"F7}%
\DefineInputCode{\'}{KOI}{I}{"E9}%
\DefineInputCode{\'}{KOI}{O}{"EF}%
\DefineInputCode{\'}{KOI}{U}{"F5}%
\DefineInputCode{\'}{KOI}{Y}{"F9}%
\DefineInputCode{\v}{KOI}{c}{"C3}%
\DefineInputCode{\v}{KOI}{e}{"C5}%
\DefineInputCode{\v}{KOI}{n}{"CE}%
\DefineInputCode{\v}{KOI}{r}{"D2}%
\DefineInputCode{\v}{KOI}{s}{"D3}%
\DefineInputCode{\v}{KOI}{z}{"DA}%
\DefineInputCode{\v}{KOI}{d}{"C4}%
\DefineInputCode{\v}{KOI}{t}{"D4}%
\DefineInputCode{\v}{KOI}{l}{"CC}%
\DefineInputCode{\v}{KOI}{u}{"CA}%
\DefineInputCode{\v}{KOI}{C}{"E3}%
\DefineInputCode{\v}{KOI}{D}{"E4}%
\DefineInputCode{\v}{KOI}{E}{"E5}%
\DefineInputCode{\v}{KOI}{N}{"EE}%
\DefineInputCode{\v}{KOI}{R}{"F2}%
\DefineInputCode{\v}{KOI}{S}{"F3}%
\DefineInputCode{\v}{KOI}{T}{"F4}%
\DefineInputCode{\v}{KOI}{Z}{"FA}%
\DefineInputCode{\v}{KOI}{L}{"EC}%
\DefineInputCode{\v}{KOI}{U}{"EA}%
\DefineInputCode{\^}{KOI}{o}{"D0}%
\DefineInputCode{\^}{KOI}{O}{"F0}%
\DefineInputCode{\"}{KOI}{a}{"D1}%
\DefineInputCode{\"}{KOI}{o}{"CD}%
\DefineInputCode{\"}{KOI}{u}{"C8}%
\DefineInputCode{\"}{KOI}{A}{"F1}%
\DefineInputCode{\"}{KOI}{O}{"ED}%
\DefineInputCode{\"}{KOI}{U}{"E8}%
\DefineInputCode{\r}{KOI}{u}{"CA}%
\fi}%
\DeclareOption{T1}{\def\i@encoding{T1}%
\if\the\csname T1 input\endcsname\relax\relax
\PackageInfo{input-encoding}{Setting up T1 input codes}
\DefineInputCode{\AA}{T1}{}{197}
\DefineInputCode{\AE}{T1}{}{198}
\DefineInputCode{\L}{T1}{}{138}
\DefineInputCode{\O}{T1}{}{216}
\DefineInputCode{\OE}{T1}{}{215}
\DefineInputCode{\S}{T1}{}{159}
\DefineInputCode{\SS}{T1}{}{223}
\DefineInputCode{\aa}{T1}{}{229}
\DefineInputCode{\ae}{T1}{}{230}
\DefineInputCode{\l}{T1}{}{170}
\DefineInputCode{\o}{T1}{}{248}
\DefineInputCode{\oe}{T1}{}{247}
\DefineInputCode{\pounds}{T1}{}{191}
\DefineInputCode{\ss}{T1}{}{255}
\DefineInputCode{\NG}{T1}{}{141}
\DefineInputCode{\ng}{T1}{}{173}
\DefineInputCode{\TH}{T1}{}{222}
\DefineInputCode{\th}{T1}{}{254}
\DefineInputCode{\DH}{T1}{}{208}
\DefineInputCode{\dh}{T1}{}{240}
\DefineInputCode{\DJ}{T1}{}{208}
\DefineInputCode{\dj}{T1}{}{158}
\DefineInputCode{\u}{T1}{A}{128}
\DefineInputCode{\k}{T1}{A}{129}
\DefineInputCode{\'}{T1}{C}{130}
\DefineInputCode{\v}{T1}{C}{131}
\DefineInputCode{\v}{T1}{D}{132}
\DefineInputCode{\v}{T1}{E}{133}
\DefineInputCode{\k}{T1}{E}{134}
\DefineInputCode{\u}{T1}{G}{135}
\DefineInputCode{\'}{T1}{L}{136}
\DefineInputCode{\v}{T1}{L}{137}
\DefineInputCode{\'}{T1}{N}{139}
\DefineInputCode{\v}{T1}{N}{140}
\DefineInputCode{\H}{T1}{O}{142}
\DefineInputCode{\'}{T1}{R}{143}
\DefineInputCode{\v}{T1}{R}{144}
\DefineInputCode{\'}{T1}{S}{145}
\DefineInputCode{\v}{T1}{S}{146}
\DefineInputCode{\c}{T1}{S}{147}
\DefineInputCode{\v}{T1}{T}{148}
\DefineInputCode{\c}{T1}{T}{149}
\DefineInputCode{\H}{T1}{U}{150}
\DefineInputCode{\r}{T1}{U}{151}
\DefineInputCode{\"}{T1}{Y}{152}
\DefineInputCode{\'}{T1}{Z}{153}
\DefineInputCode{\v}{T1}{Z}{154}
\DefineInputCode{\.}{T1}{Z}{155}
\DefineInputCode{\.}{T1}{I}{157}
\DefineInputCode{\u}{T1}{a}{160}
\DefineInputCode{\k}{T1}{a}{161}
\DefineInputCode{\'}{T1}{c}{162}
\DefineInputCode{\v}{T1}{c}{163}
\DefineInputCode{\v}{T1}{d}{164}
\DefineInputCode{\v}{T1}{e}{165}
\DefineInputCode{\k}{T1}{e}{166}
\DefineInputCode{\u}{T1}{g}{167}
\DefineInputCode{\'}{T1}{l}{168}
\DefineInputCode{\v}{T1}{l}{169}
\DefineInputCode{\'}{T1}{n}{171}
\DefineInputCode{\v}{T1}{n}{172}
\DefineInputCode{\H}{T1}{o}{174}
\DefineInputCode{\'}{T1}{r}{175}
\DefineInputCode{\v}{T1}{r}{176}
\DefineInputCode{\'}{T1}{s}{177}
\DefineInputCode{\v}{T1}{s}{178}
\DefineInputCode{\c}{T1}{s}{179}
\DefineInputCode{\v}{T1}{t}{180}
\DefineInputCode{\c}{T1}{t}{181}
\DefineInputCode{\H}{T1}{u}{182}
\DefineInputCode{\r}{T1}{u}{183}
\DefineInputCode{\"}{T1}{y}{184}
\DefineInputCode{\'}{T1}{z}{185}
\DefineInputCode{\v}{T1}{z}{186}
\DefineInputCode{\.}{T1}{z}{187}
\DefineInputCode{\`}{T1}{A}{192}
\DefineInputCode{\'}{T1}{A}{193}
\DefineInputCode{\^}{T1}{A}{194}
\DefineInputCode{\~}{T1}{A}{195}
\DefineInputCode{\"}{T1}{A}{196}
\DefineInputCode{\r}{T1}{A}{197}
\DefineInputCode{\c}{T1}{C}{199}
\DefineInputCode{\`}{T1}{E}{200}
\DefineInputCode{\'}{T1}{E}{201}
\DefineInputCode{\^}{T1}{E}{202}
\DefineInputCode{\"}{T1}{E}{203}
\DefineInputCode{\`}{T1}{I}{204}
\DefineInputCode{\'}{T1}{I}{205}
\DefineInputCode{\^}{T1}{I}{206}
\DefineInputCode{\"}{T1}{I}{207}
\DefineInputCode{\~}{T1}{N}{209}
\DefineInputCode{\`}{T1}{O}{210}
\DefineInputCode{\'}{T1}{O}{211}
\DefineInputCode{\^}{T1}{O}{212}
\DefineInputCode{\~}{T1}{O}{213}
\DefineInputCode{\"}{T1}{O}{214}
\DefineInputCode{\`}{T1}{U}{217}
\DefineInputCode{\'}{T1}{U}{218}
\DefineInputCode{\^}{T1}{U}{219}
\DefineInputCode{\"}{T1}{U}{220}
\DefineInputCode{\'}{T1}{Y}{221}
\DefineInputCode{\`}{T1}{a}{224}
\DefineInputCode{\'}{T1}{a}{225}
\DefineInputCode{\^}{T1}{a}{226}
\DefineInputCode{\~}{T1}{a}{227}
\DefineInputCode{\"}{T1}{a}{228}
\DefineInputCode{\r}{T1}{a}{229}
\DefineInputCode{\c}{T1}{c}{231}
\DefineInputCode{\`}{T1}{e}{232}
\DefineInputCode{\'}{T1}{e}{233}
\DefineInputCode{\^}{T1}{e}{234}
\DefineInputCode{\"}{T1}{e}{235}
\DefineInputCode{\`}{T1}{i}{236}
\DefineInputCode{\`}{T1}{\i}{236}
\DefineInputCode{\'}{T1}{i}{237}
\DefineInputCode{\'}{T1}{\i}{237}
\DefineInputCode{\^}{T1}{i}{238}
\DefineInputCode{\^}{T1}{\i}{238}
\DefineInputCode{\"}{T1}{i}{239}
\DefineInputCode{\"}{T1}{\i}{239}
\DefineInputCode{\~}{T1}{n}{241}
\DefineInputCode{\`}{T1}{o}{242}
\DefineInputCode{\'}{T1}{o}{243}
\DefineInputCode{\^}{T1}{o}{244}
\DefineInputCode{\~}{T1}{o}{245}
\DefineInputCode{\"}{T1}{o}{246}
\DefineInputCode{\`}{T1}{u}{249}
\DefineInputCode{\'}{T1}{u}{250}
\DefineInputCode{\^}{T1}{u}{251}
\DefineInputCode{\"}{T1}{u}{252}
\DefineInputCode{\'}{T1}{y}{253}
\fi}
\DeclareOption{IL2}{\def\i@encoding{IL2}%                  
\if\the\csname IL2 input\endcsname\relax\relax
\PackageInfo{input-encoding}{Setting up IL2 input codes}
\DefineInputCode{\'}{IL2}{l}{'345}%
\DefineInputCode{\'}{IL2}{r}{'340}%
\DefineInputCode{\'}{IL2}{a}{'341}%
\DefineInputCode{\'}{IL2}{e}{'351}%
\DefineInputCode{\'}{IL2}{i}{'355}%
\DefineInputCode{\'}{IL2}{o}{'363}%
\DefineInputCode{\'}{IL2}{u}{'372}%
\DefineInputCode{\'}{IL2}{y}{'375}%
\DefineInputCode{\'}{IL2}{L}{'305}%
\DefineInputCode{\'}{IL2}{R}{'300}%
\DefineInputCode{\'}{IL2}{A}{'301}%
\DefineInputCode{\'}{IL2}{E}{'311}%
\DefineInputCode{\'}{IL2}{I}{'315}%
\DefineInputCode{\'}{IL2}{O}{'323}%
\DefineInputCode{\'}{IL2}{U}{'332}%
\DefineInputCode{\'}{IL2}{Y}{'335}%
\DefineInputCode{\`}{IL2}{a}{'270}%
\DefineInputCode{\`}{IL2}{A}{'230}%
\DefineInputCode{\v}{IL2}{c}{'350}%
\DefineInputCode{\v}{IL2}{d}{'357}%
\DefineInputCode{\v}{IL2}{e}{'354}%
\DefineInputCode{\v}{IL2}{l}{'265}%
\DefineInputCode{\v}{IL2}{n}{'362}%
\DefineInputCode{\v}{IL2}{r}{'370}%
\DefineInputCode{\v}{IL2}{s}{'271}%
\DefineInputCode{\v}{IL2}{z}{'276}%
\DefineInputCode{\v}{IL2}{t}{'273}%
\DefineInputCode{\v}{IL2}{u}{'371}%
\DefineInputCode{\v}{IL2}{C}{'310}%
\DefineInputCode{\v}{IL2}{D}{'317}%
\DefineInputCode{\v}{IL2}{E}{'314}%
\DefineInputCode{\v}{IL2}{L}{'245}%
\DefineInputCode{\v}{IL2}{N}{'322}%
\DefineInputCode{\v}{IL2}{R}{'330}%
\DefineInputCode{\v}{IL2}{S}{'251}%
\DefineInputCode{\v}{IL2}{T}{'253}%
\DefineInputCode{\v}{IL2}{Z}{'256}%
\DefineInputCode{\v}{IL2}{U}{'331}%
\DefineInputCode{\^}{IL2}{o}{'364}%
\DefineInputCode{\^}{IL2}{O}{'324}%
\DefineInputCode{\"}{IL2}{a}{'344}%
\DefineInputCode{\"}{IL2}{o}{'366}%
\DefineInputCode{\"}{IL2}{u}{'374}%
\DefineInputCode{\"}{IL2}{A}{'304}%
\DefineInputCode{\"}{IL2}{O}{'326}%
\DefineInputCode{\"}{IL2}{U}{'334}%
\DefineInputCode{\r}{IL2}{u}{'371}%
\DefineInputCode{\r}{IL2}{U}{'331}%
\fi}
\DeclareOption*{\PackageError{input-encoding}{Unknown input encoding:
                 \CurrentOption}{Only T1, IL2, and KOI known in this version.}}
\def\inputencoding#1%
                {\@ifundefined{#1 input}%
                  {\PackageError{input-encoding}{Unknown input encoding: #1}%
                  {Input font encoding #1 not defined in the
                   `input-encoding' package.\MessageBreak
                   Only T1, IL2, and KOI known in this version (and must be used
                   \MessageBreak
                   in the list of options passed to `input-encoding' package).
                   \MessageBreak
                   Input encoding change ignored.}}%
                  {\if\the\csname#1 input\endcsname\relax\relax
                    \PackageError{input-encoding}{Unknown input encoding: #1}%
                    {Input font encoding #1 not   
                     used in the list of options.\MessageBreak
                     Input encoding change ignored.}%
                   \else
                    \expandafter\the\csname#1 input\endcsname
                    \PackageWarning{input-encoding}{Switching to #1 input}%
                    \def\i@encoding{#1}%
                   \fi}%
                 }
\ProcessOptions*
\if\i@encoding\relax\relax
\PackageError{input-encoding}{No option given}%
                 {Input font encodings to be used must be specified as 
                  \MessageBreak
                  options passed to `input-encoding' package.\MessageBreak
                  The last of them will become active at document beginning.}%
\else\AtBeginDocument{\inputencoding{\i@encoding}}\fi
\endinput

