source: bin/mkf77sym.pl.in@ 09bc09

Last change on this file since 09bc09 was 5d30c1, checked in by Frederik Heber <heber@…>, 13 years ago

Initial commit based on 3.0.0alpha (here claimed as 2.4).

  • simply added all files.
  • Property mode set to 100644
File size: 991 bytes
Line 
1#
2eval 'exec perl $0 $*'
3 if 0;
4
5$method = '@F77_SYMBOLS@';
6
7$in = shift;
8
9if ($in eq "-method") {
10 $method = shift;
11 $symbol = f77symbol($method, shift);
12 print "$symbol\n";
13}
14else {
15 $out = shift;
16
17 open(IN,"<$in");
18 open(OUT,">$out");
19
20 while(<IN>) {
21 if (/\# *define F77_([A-Z]+[A-Z0-9]+)/) {
22 $f77name = $1;
23 $cname = f77symbol($method, $f77name);
24 printf OUT "#define F77_%s %s\n", $f77name, $cname;
25 }
26 else {
27 printf OUT "%s", $_;
28 }
29 }
30}
31
32sub f77symbol {
33 my $method = shift;
34 my $f77name = shift;
35 my $cname;
36 if ($method eq "symbol_") {
37 $cname = lc($f77name);
38 $cname = "${cname}_";
39 }
40 elsif ($method eq "symbol") {
41 $cname = lc($f77name);
42 }
43 elsif ($method eq "SYMBOL") {
44 $cname = uc($f77name);
45 }
46 elsif ($method eq "SYMBOL_") {
47 $cname = uc($f77name);
48 $cname = "${cname}_";
49 }
50 return $cname;
51}
Note: See TracBrowser for help on using the repository browser.