%%%%%%%%%%%%%%%%%%%%%%%%%%% arabwin.sty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% arabwin.sty based on iso88596.sty 
% Scanner module for the encoding used by Windows with Arabic support 
% how to install it:
% with LaTeX2e, say "\usepackage {arabwin}"
% with LaTeX 2.09, add the style option "arabwin"
% with Plain TeX, say "\input arabwin.sty"
% how to activate it: say "\setcode {arabwin}"
% 10.04.1997
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (c) Isam G. Ishaq
%     (isam0732@mailszrz.zrz.TU-Berlin.DE) 
% (c) Klaus Lagally
%     Institut fuer Informatik
%     Universitaet Stuttgart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\UsePackage {asmo449}		\catcode `\@ = 11
\a@ident {arabwin.sty} {3.05 Arabic Windows encoding} {10.04.1997}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def \win@scan #1>{% modified scanner call: token sequence -> \a@tokens
\iftest@scan \ifshow \else \lowercase {\a@verb #1>}\fi
\tracingmacros = 1 \fi
\gdef \a@rest {}\a@tokens = {}\lowercase {\sc@beg #1\@ \@@ }% transform
\iftest@scan \tracingmacros = 0 %
\expandafter \a@verb \expandafter (\the\a@tokens )>\fi }

\def \win@endscan \@@ {\gdef \a@scan {\win@scan }}

\def \win@back #1\@ \@@ {% end scanning, push back into input
\gdef \a@scan {\a@@scan }%
\gdef \a@rest {#1 \reset@win }%
\global\let \test@token \test@rest }

\def \reset@win {% after pushback
\gdef \a@scan {\win@scan }%
\gdef \sc@endscan {\win@endscan }}

\def \a@c@reset@win {% after pushback
\reset@win \test@token }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcount \win@s  \newcount \win@d      

\def \awin@loop #1#2#3{% transform characters
\win@s = #1 \win@d = #2 \loop \lccode \win@s = \win@d
\advance \win@d 1 \advance \win@s 1     \ifnum \win@d < #3 \repeat }

\def \set@awin {% substitute scanner for Windows with Arabic support 
\awin@loop {160}{32}{44}	% arabic space (NBSP)
\awin@loop {161}{44}{45}	% arabic comma
\awin@loop {173}{45}{46}	% soft hyphen
\awin@loop {186}{59}{60}	% arabic semicolon
\awin@loop {191}{63}{87}
\awin@loop {216}{87}{91}
\awin@loop {220}{96}{100}
\awin@loop {225}{100}{101}	% lam
\awin@loop {227}{101}{105}
\awin@loop {236}{105}{107}
\awin@loop {240}{107}{111}
\awin@loop {245}{111}{113}
\awin@loop {248}{113}{114}
\awin@loop {250}{114}{115}

\win@d = 193   \win@s = 225
\loop \catcode \win@s = 11 \catcode \win@d = 11 % make letters
\advance \win@d 1 \advance \win@s 1     \ifnum \win@d < 224 \repeat

\catcode 192 = 10  \catcode 255 = 15  \catcode 220 = 12

\set@asmo          \global\let \a@scan \win@scan 
\a@first = {^^dc}
\let \sc@back \win@back	\let \sc@endscan \win@endscan 
\message {input encoding set to Windows cp1256 conventions}}

\xpa \def \xpa \sc@table \xpa {\sc@table % add the CP 1256 encoding
arabwin\set@awin	cp1256\set@awin	}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\message {scanner for Arabic Windows encoding (CP1256) installed.}
\setcode {arabwin}

\catcode `\@ = \asmoatcode % !!
\endinput
%%%%%%%%%%%%%%%%%%%%%%%% EOF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

