#
# SCCS:		%W% %G% %U%
#
# Name:		html_files.pl
#
# Description:	Front end to perl script which processes HTML files.
#
# Options: 
# -i	Input directory - where the source HTML files are located.
#	Default: current directory.
#
# -o	Output directory - where the processed HTML files are located.
#	Default: /tmp (which is never really useful on DOS systems).
#		
# Author:	DPJ Cater
#
# History:
#-----------------------------------------------------------------------------
#  Date		Modifications
#  21/04/2000	Initial version for Linux
#-----------------------------------------------------------------------------

select STDOUT; $| = 1;
select STDERR; $| = 1;

#
# Process any options.
#
use Getopt::Std;
getopt('io');

if(defined($opt_i) && ($opt_i ne "")) {
    $i_dir = $opt_i;
} else {
    $i_dir = ".";
}

if(defined($opt_o) && ($opt_o ne "")) {
    $o_dir = $opt_o;
} else {
    $o_dir = "/tmp";
}

opendir(DIRH, $i_dir) or die "Can't opendir($i_dir)";
@html_files = sort grep { /^[0-9].*\.html$/ } readdir(DIRH);
closedir(DIRH);  
foreach (@html_files) {
    chomp;
    $html_file = $_;
    print "Processing $html_file\n";
    `perl html_mklinks.pl -i $i_dir -o $o_dir $html_file`;
}

exit 0;
