source: codelist.pl @ 4fd3c04

Last change on this file since 4fd3c04 was 4fd3c04, checked in by Anders Kaseorg <andersk@mit.edu>, 7 years ago
Remove AIM support This code has received almost no security attention, and anyway, AIM is shutting down on December 15, 2017. https://aimemories.tumblr.com/post/166091776077/aimemories Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Property mode set to 100755
File size: 702 bytes
Line 
1#! /usr/bin/perl
2
3my $guard_symbol = "INC_BARNOWL_OWL_PROTOTYPES_H";
4print "#ifndef $guard_symbol\n";
5print "#define $guard_symbol\n";
6foreach $file (@ARGV) {
7    open(FILE, $file);
8
9    print "/* -------------------------------- $file -------------------------------- */\n";
10    while (<FILE>) {
11        if (/^\S/
12            && (/\{\s*$/ || /\)\s*$/)
13            && !/\}/
14            && !/^\{/
15            && !/^#/
16            && !/^static/
17            && !/^system/
18            && !/^XS/
19            && !/\/\*/
20            && !/ZWRITEOPTIONS/)
21        {
22
23            s/\s+\{/\;/;
24            s/\)[ \t]*$/\)\;/;
25            print "extern ";
26            print;
27        } elsif (/^#if/ || /^#else/ || /^#endif/) {
28            print;
29        }
30           
31    }
32    close(FILE);
33    print "\n";
34}
35print "#endif /* $guard_symbol */\n";
Note: See TracBrowser for help on using the repository browser.