Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / script / make_typemap.pl
1 #!/usr/bin/perl -w
2 #############################################################################
3 ## Name:        script/make_typemap.pl
4 ## Purpose:     Preprocess the typemap file
5 ## Author:      Mattia Barbon
6 ## Modified by:
7 ## Created:     27/03/2007
8 ## RCS-ID:      $Id: make_typemap.pl 2050 2007-05-13 18:38:33Z mbarbon $
9 ## Copyright:   (c) 2007 Mattia Barbon
10 ## Licence:     This program is free software; you can redistribute it and/or
11 ##              modify it under the same terms as Perl itself
12 #############################################################################
13
14 use strict;
15 use Fatal qw(open close);
16
17 open my $in, '<', $ARGV[0];
18 undef $/;
19 $_ = <$in>;
20 close $in;
21
22 s{typemap\.tmpl}{typemap};
23 s{PERL_CLASS}'${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt}'g;
24 s{CPP_CLASS}'${(my $t=$type)=~s/^Wx_/wx/;\$t}'g;
25
26 open my $out, '>', $ARGV[1];
27 print $out $_;
28 close $out;
29
30 exit 0;