#!/usr/bin/perl -w

die "arg needed\n" if (!($#ARGV+1));
my $fn = $ARGV[0];
my $hh_q = ($fn =~ /hh$/ );
my $MAILADRESS=$ENV{MAILADRESS};
my @pw=(getpwuid($<));
my $username=$pw[6];
my $what="implement ";
$what = "declare " if ($hh_q);
my ($PROJECT, $cwd);
$PROJECT = "the LilyPond music typesetter";
chop($cwd = `pwd`);

$PROJECT= "the Flower Library" if ($cwd =~ /flower/);
my $headstr ="/*
  $fn -- $what

  source file of $PROJECT

  (c) 1997 $username <$MAILADRESS>
*/\n";

my $startdef= $fn;
$startdef =~ s/[\.-]/_/g;
$startdef =~ tr/a-z/A-Z/;
my $terminatestr="\n";
if ($hh_q) {
    $headstr .= "\n\n#ifndef $startdef\n#define $startdef\n";
    $terminatestr .= "#endif // $startdef\n"  
}

print $headstr, $terminatestr;



