source:
codelist.pl
@
b017b03
Last change on this file since b017b03 was 0982901, checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago | |
---|---|
|
|
File size: 675 bytes |
Rev | Line | |
---|---|---|
[69894d2] | 1 | #! /usr/bin/perl |
[1aee7d9] | 2 | # $Id$ |
3 | ||
[7d4fbcd] | 4 | if ($#ARGV eq -1) { |
5 | @ARGV=`ls *.c`; | |
6 | chop(@ARGV); | |
7 | } | |
8 | ||
9 | foreach $file (@ARGV) { | |
[0982901] | 10 | next if $file eq 'perlglue.c'; |
[7d4fbcd] | 11 | open(FILE, $file); |
12 | ||
13 | print "/* -------------------------------- $file -------------------------------- */\n"; | |
14 | while (<FILE>) { | |
15 | if (/^\S/ | |
[ac70242] | 16 | && (/\{\s*$/ || /\)\s*$/) |
[7d4fbcd] | 17 | && !/\}/ |
18 | && !/^\{/ | |
[ac70242] | 19 | && !/^#/ |
[7d4fbcd] | 20 | && !/^static/ |
[69894d2] | 21 | && !/^system/ |
[4594d83] | 22 | && !/^XS/ |
[0ff8fb57] | 23 | && !/\/\*/ |
24 | && !/ZWRITEOPTIONS/ | |
[09489b89] | 25 | && !/owlfaim_priv/) |
[0ff8fb57] | 26 | { |
[09489b89] | 27 | |
[4594d83] | 28 | s/\s+\{/\;/; |
29 | s/\)[ \t]*$/\)\;/; | |
30 | print "extern "; | |
31 | print; | |
[09489b89] | 32 | } elsif (/^#if/ || /^#else/ || /^#endif/) { |
33 | print; | |
[4594d83] | 34 | } |
[7d4fbcd] | 35 | |
36 | } | |
37 | close(FILE); | |
38 | print "\n"; | |
39 | } | |
[4594d83] | 40 | |
41 |
Note: See TracBrowser
for help on using the repository browser.