summaryrefslogtreecommitdiff
path: root/debian/fixheaders
diff options
context:
space:
mode:
Diffstat (limited to 'debian/fixheaders')
-rw-r--r--debian/fixheaders24
1 files changed, 24 insertions, 0 deletions
diff --git a/debian/fixheaders b/debian/fixheaders
new file mode 100644
index 0000000..93ce13d
--- /dev/null
+++ b/debian/fixheaders
@@ -0,0 +1,24 @@
+#!perl -w
+
+#
+# Fix up generated .ph files
+#
+
+use strict;
+use File::Find;
+
+my @args = @ARGV;
+@ARGV = ();
+find sub { push @ARGV, $File::Find::name if -f and /\.ph$/ }, @args;
+
+$^I = '';
+
+die "$0: no headers under @args?\n" unless @ARGV;
+while (<>)
+{
+ # discard casts
+ s/(?<!\$sizeof\{)(&__const\s+)?\\'struct[^\\']+\\'[^;]*;/1;/g;
+ s/'char'\[\d+\]/1/g;
+
+ print;
+}