Added my crappy old script for gettin constants from headers
Kartik Thakore [Wed, 11 Nov 2009 18:58:56 +0000 (13:58 -0500)]
scripts/auto_constants.pl [new file with mode: 0644]

diff --git a/scripts/auto_constants.pl b/scripts/auto_constants.pl
new file mode 100644 (file)
index 0000000..a8f958b
--- /dev/null
@@ -0,0 +1,26 @@
+#!perl
+use strict;
+use warnings;
+
+my $head_loc = `sdl-config --cflags`;
+  $head_loc = (split ' ', $head_loc)[0];
+  $head_loc =~ s/-I//;
+print 'Getting header constants from '.$head_loc."\n";
+
+
+my @header = qw/ SDL.h /;
+
+foreach (@header)
+{
+  open FH, $head_loc.'/'.$_;
+   while(<FH>)
+   {
+    if ($_ =~ /#define SDL_/)
+    {
+      my $line = $_;
+      my @cop = (split ' ', $line);
+      print  'sub '.$cop[1].' {return '.$cop[2].'}'."\n" ;
+     }
+   }
+  close FH;
+}