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