123456789101112131415161718192021222324252627282930313233343536 |
- use warnings;
- use strict;
- my @lines = <>;
- my @protos = map { /^(sub \w+\s*\(.*\))/ ? ("$1;") : () } @lines;
- while (defined ($_ = shift @lines))
- {
- if (/^#!.* prototypes/i)
- {
- print "# BEGIN AUTOMATICALLY GENERATED PROTOTYPES\n";
- print join ("\n", sort @protos) . "\n";
- print "# END AUTOMATICALLY GENERATED PROTOTYPES\n";
- }
- else
- {
- print;
- }
- }
|