flower-1.1.5
[lilypond.git] / genheader
blob7c36afe0ae8355ed8644889b7866a9e40e3e7c1c
1 #!/usr/bin/perl -w
3 die "arg needed\n" if (!($#ARGV+1));
4 my $fn = $ARGV[0];
5 my $hh_q = ($fn =~ /hh$/ );
6 my $MAILADRESS=$ENV{MAILADRESS};
7 my @pw=(getpwuid($<));
8 my $username=$pw[6];
9 my $what="implement ";
10 $what = "declare " if ($hh_q);
11 my $headstr ="/*
12 $fn -- $what
14 source file of the LilyPond music typesetter
16 (c) 1997 $username <$MAILADRESS>
17 */\n";
19 my $startdef= $fn;
20 $startdef =~ s/[\.-]/_/g;
21 $startdef =~ tr/a-z/A-Z/;
22 my $terminatestr="\n";
23 if ($hh_q) {
24 $headstr .= "\n\n#ifndef $startdef\n#define $startdef\n";
25 $terminatestr .= "#endif // $startdef\n"
28 print $headstr, $terminatestr;