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