Debian Codegraph @

debian/fixheaders

raw
1 #!perl -w
2
3 #
4 # Fix up generated .ph files
5 #
6
7 use strict;
8 use File::Find;
9
10 my @args = @ARGV;
11 @ARGV = ();
12 find sub { push @ARGV, $File::Find::name if -f and /\.ph$/ }, @args;
13
14 $^I = '';
15
16 die "$0: no headers under @args?\n" unless @ARGV;
17 while (<>)
18 {
19 # discard casts
20 s/(?<!\$sizeof\{)(&__const\s+)?\\'struct[^\\']+\\'[^;]*;/1;/g;
21 s/'char'\[\d+\]/1/g;
22
23 print;
24 }