source:
codelist.pl
@
e363375
Last change on this file since e363375 was 09489b89, checked in by James M. Kretchmar <kretch@mit.edu>, 21 years ago | |
---|---|
|
|
File size: 640 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) { | |
10 | open(FILE, $file); | |
11 | ||
12 | print "/* -------------------------------- $file -------------------------------- */\n"; | |
13 | while (<FILE>) { | |
14 | if (/^\S/ | |
[ac70242] | 15 | && (/\{\s*$/ || /\)\s*$/) |
[7d4fbcd] | 16 | && !/\}/ |
17 | && !/^\{/ | |
[ac70242] | 18 | && !/^#/ |
[7d4fbcd] | 19 | && !/^static/ |
[69894d2] | 20 | && !/^system/ |
[4594d83] | 21 | && !/^XS/ |
[0ff8fb57] | 22 | && !/\/\*/ |
23 | && !/ZWRITEOPTIONS/ | |
[09489b89] | 24 | && !/owlfaim_priv/) |
[0ff8fb57] | 25 | { |
[09489b89] | 26 | |
[4594d83] | 27 | s/\s+\{/\;/; |
28 | s/\)[ \t]*$/\)\;/; | |
29 | print "extern "; | |
30 | print; | |
[09489b89] | 31 | } elsif (/^#if/ || /^#else/ || /^#endif/) { |
32 | print; | |
[4594d83] | 33 | } |
[7d4fbcd] | 34 | |
35 | } | |
36 | close(FILE); | |
37 | print "\n"; | |
38 | } | |
[4594d83] | 39 | |
40 |
Note: See TracBrowser
for help on using the repository browser.