%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% idxmake.4ht                          2001-12-14-17:07 %
% Copyright (C) 2000--2001      Eitan M. Gurari         %
%                                                       %
% This program can redistributed and/or modified under  %
% the terms of the LaTeX Project Public License         %
% Distributed from CTAN archives in directory           %
% macros/latex/base/lppl.txt; either version 1 of the   %
% License, or (at your option) any later version.       %
%                                                       %
% However, you are allowed to modify this program       %
% without changing its name, if you modify its          %
% signature. Changes to the signature can be introduced %
% with a directive of the form                          %
%            \message{signature}                        %
%                                                       %
%                             gurari@cis.ohio-state.edu %
%                 http://www.cis.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\immediate\write-1{version 2001-12-14-17:07}


\def\SourceIn#1#2#3#4#5{#1.#2}
\def\SourceOut#1#2#3#4#5{#1.#3}
\def\MakefileIn#1#2#3#4#5{#1.#4}
\def\MakefileOut#1#2#3#4#5{#1.#5}

\newwrite\idx
\immediate\openout\idx=\expandafter\SourceIn\filename\relax
\begingroup
\catcode`\#=12\relax
\immediate\write\idx{\def\string\LNK#1#2#3#4{\string
   \ifx \string\NewConfigure\string\UnDef \string\else \string
   \Link[#1]{#2}{}\string\HAdvance\string\LNKno 1
      \def\string\THIrd{#3}\string\ifx \string\THIrd\string\empty
         \string\LNKno
      \string\else  #3\string\fi
      \string\EndLink\string\fi}}
\immediate\write\idx{%
   \def\string\LNKno{0}%
   \string\input\space
       \expandafter\MakefileOut\filename\relax}
\endgroup
\immediate\closeout\idx\relax

\newcount\cnt
\def\noXcatcodes{%
   \cnt=0
   \def\noXXcatcodes{%
      \catcode\cnt12
      \ifnum\cnt<255
          \advance\cnt  1  \expandafter\noXXcatcodes
      \fi }%
   \noXXcatcodes }

\immediate\openout\idx=\expandafter\MakefileIn\filename\relax
\def\beforeentry#1#2#3#4{
   \def\file{#1}\def\anchor{#2}\def\pointer{#3}
   \begingroup   \noXcatcodes
     \catcode`\^^M=10    \catcode`\ =10    \catcode`\^^I=10
     \catcode`\{=1 \catcode`\}=2 \getentries
}
\def\getentries#1#2{\endgroup
   \immediate\write\idx{\string
       \indexentry{#1|LNK{\file}{\anchor}{\pointer}}{#2}}}
\input \expandafter\SourceOut\filename\relax
\immediate\closeout\idx

\bye
\endinput

