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