#
#  file: patent-util.pl
#  auth: Brad Burdick
#  desc: general utility routines and data types
#
##########################################################################
#  Copyright (c) 1994, 1995 Internet Multicasting Service
#
#  The Patent APS/Full-Text Dissemination processing software ("software")
#  was developed by the Internet Multicasting Service and may 
#  be used for academic, research, government, and internal business
#  purposes without charge.  You may not resell this code or include it
#  in a product that you are selling without prior permission of the
#  Internet Multicasting Service.
#
#  This software is provided ``as is'', without express or implied
#  warranty, and with no support nor obligation to assist in its
#  use, correction, modification or enhancement.  We assume no liability
#  with respect to the infringement of copyrights, trade secrets, or any
#  patents, and are not responsible for consequential damages.  Proper
#  use of the software is entirely the responsibility of the user.
##########################################################################

#
# format tags with matching indentation amounts in number of spaces.
#   -1 means do NOT reformat.
#   PAC is a special case in that the text needs to be centered, but it is
# here to be complete.
#
%indentation = (
	'EQU', -1,
	'FNT', 0,
	'PA0', 1,
	'PA1', 2,
	'PA2', 3,
	'PA3', 4,
	'PA4', 5,
	'PA5', 6,
	'PAC', -1,
	'PAL', 0,
	'PAR', 0,
	'TBL', -1,
	'TBL3', -1,
);


#
# output patent info
#
sub write_patent {
	local($outfile) = shift;
	local(*patent) = shift;
	local($subdir) = '';

	$subdir = substr($outfile, 0, 5);
	if (! -d "$workdir/$subdir") {
		mkdir("$workdir/$subdir", 0755);
	}
	open(OUT, ">$workdir/$subdir/$outfile") ||
	  die "$prog: unable to open $outfile: $!\n";
	print OUT join("\n", @patent), "\n";

	close(OUT);
}

# keep require happy
1;

