eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' & eval 'exec perl -S $0 $argv:q' if 0; # # This perl script will combine a set of files into one or more HTML pages. # # The file fooNN.html will be created by combining the files: # fooNN.hdr # fooNN.pre # fooNN.bdy # fooNN.pst # # Where NN is a 2-digit number. If fooNN.hdr does not exist, the file 'hdr' # will be used. If any of the other file-parts don't exist, they will be # ignored. # # Usage: # combine *.html # combine *.pre # # Input files: # # # hdr # If no *.hdr exists for the current page, this is used. You will typically # use this to add
\n" ;
open(INPUT,"<$file") || die "Cannot open $file for read\n";
# Do some substitutes on each line to try and get the output to
# look like it does in fontified emacs.
while( )
{
s/\</g;
if( m,include\s+"ace/.*\.h", ) {
s,(ace/.*\.h),$1,;
s,\#\s*include,$&,;
}
else
{
s,\#(\s*)(e?l?if !?defined|pragma|ifn?def|define)(\W*)([\w\.]+),\#$1$2$3$4,;
s,\#\s*(include|endif),$&,;
s,"([^"]+)","$1",g;
s,//.*$,$&,;
s,/\*,$&,;
s,\*/,$&,;
s,\w+::\~?\w+,$&,;
}
print FILE $_;
}
print FILE "\n";
}
}