summaryrefslogtreecommitdiff
path: root/lib/sbin/c_file_processor.pl
blob: 2e7084abd07b6d12203830b63c293b27f93f4c66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/perl

$home = shift(@ARGV);

$/ = ";";
$*=1;

if (! -e "$home/fortran_name.pl" ) 
{
    die "Unable to get fortran name file!";
}

require "$home/fortran_name.pl";

while(<>)
{
    $line = $_;
    if($line =~ m:FORTRAN_NAME\s*\(([^\)]*)\):)
    {
        $arglist = $1;
        $arglist =~ s:[\s\n\t]+::g;

	@args = split(",", $arglist );

	$new = &fortran_name($args[$#args]);

	$line =~ s:FORTRAN_NAME\s*\(([^\)]*)\):$new:;
    }
    print $line;
}