]> git.donarmstrong.com Git - lilypond.git/blob - genheader
partial: 0.0.34.hanjan
[lilypond.git] / genheader
1 #!/usr/bin/perl -w
2
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
13
14   source file of the LilyPond music typesetter
15
16   (c) 1997 $username <$MAILADRESS>
17 */\n";
18
19 my $startdef= $fn;
20 $startdef =~ s/\./_/;
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"  
26 }
27
28 print $headstr, $terminatestr;
29
30
31