@x
@ This is the third phase.

@a
SRTN phase_three(VOID)
{
if (no_xref)
       {
 finish_line();
 out_str("\\vfill\\end"); @+ finish_line();
       }
else
       {
 phase=3; printf("\nWriting the index...");

 if (change_exists)
               {
           finish_line(); @<Tell about changed modules@>;
                 }

 finish_line();
out_str(w_style.indx.preamble); @+ finish_line();
@.\\Winx@>

 @<Do the first pass of sorting@>;
 @<Sort and output the index@>;
 out_str(w_style.indx.postamble); @+ finish_line();
@.\\Wfin@>

@<Print the command line, etc.@>;
 @<Output all the module names@>;
 out_str("\\Wcon"); @+ finish_line();
@.\\Wcon@>
       }

printf("Done.");
check_complete(); /* Was all of the change file used? */
}
@y
@ This is the third phase.

@a
SRTN phase_three(VOID)

{
if (no_xref) {
 finish_line();
 out_str("\\vfill\\end"); @+ finish_line();
       }
else
       {
 phase=3; printf("\nWriting the index...");
 finish_line();
 out_str("\\input INDEX"); finish_line(); finish_line();
 out_str("\\input MODULE_NAMES"); finish_line();
 out_str("\\bigskip");
 @<Print the command line, etc.@>;
 out_str("\\Wcon"); @+ finish_line();
@.\\Wcon@>

 fclose(tex_file);
 if ((tex_file=fopen("INDEX.tex","w"))==NULL)
   fatal("! Cannot open ouput file ","INDEX.tex");

 if (change_exists) {
   @<Tell about changed modules@>;
   finish_line();  finish_line(); }

 out_str(w_style.indx.preamble); @+ finish_line();
@.\\Winx@>

 @<Do the first pass of sorting@>;
 @<Sort and output the index@>;
 out_str(w_style.indx.postamble); @+ finish_line();
@.\\Wfin@>

 fclose(tex_file);
 if ((tex_file=fopen("MODULE_NAMES.tex","w"))==NULL)
   fatal("! Cannot open ouput file ","MODULE_NAMES.tex");

 @<Output all the module names@>;

 fclose(tex_file); }

printf("Done. aTm 1.00");
check_complete(); /* Was all of the change file used? */
}
@z