source: codelist.pl @ c854e74

release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since c854e74 was 0982901, checked in by Nelson Elhage <nelhage@mit.edu>, 12 years ago
codelist.pl: Don't scan perlglue.c for declarations.
  • Property mode set to 100755
File size: 675 bytes
RevLine 
[69894d2]1#! /usr/bin/perl
[1aee7d9]2# $Id$
3
[7d4fbcd]4if ($#ARGV eq -1) {
5    @ARGV=`ls *.c`;
6    chop(@ARGV);
7}
8
9foreach $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.