Debian Codegraph @

bin/defunc

raw
1 #!/usr/local/bin/perl
2
3 while (<>)
4 {
5 if (defined $func)
6 {
7 if (/__FUNCTION__/)
8 {
9 s/__FUNCTION__/"$func"/g;
10 }
11 undef $func if (/^}/);
12 }
13 else
14 {
15 $func = $1 if (/^(\w+)\s*\(/);
16 }
17 print;
18 }