2 #############################################################################
3 ## Name: script/make_exp_list.pl
4 ## Purpose: builds lib/Wx/_Exp.pm (export lists for Wx and Wx::Event)
5 ## Author: Mattia Barbon
8 ## RCS-ID: $Id: make_exp_list.pl 2057 2007-06-18 23:03:00Z mbarbon $
9 ## Copyright: (c) 2000-2003, 2005 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 #############################################################################
15 # @EXPORT_OK and %EXPORT_TAGS for Wx.pm (constants in Constant.xs)
18 my $ext = shift @ARGV;
26 my( $values, $tags ) = @_;
28 foreach my $i ( split '\s+', $values ) {
29 next if $i =~ /^\s*$/;
31 foreach my $j ( split '\s+', $tags ) {
32 next if $_ =~ /^\s*$/;
34 push @{ $packages{$package}{tags}{$j} }, $i;
37 push @{ $packages{$package}{exp_ok} }, $i;
41 foreach my $i ( @ARGV ) {
42 open IN, '< ' . $i or die "unable to open '$i'";
48 m/^\W+?\!(\w+):\s*(.*)$/ && do {
49 my( $t, $v ) = ( $1, $2 );
51 if( $t eq 'parser' ) { $parser = eval "$v"; die if $@ }
52 if( $t eq 'package' ) { $package = $v }
53 if( $t eq 'tag' ) { $tag = $v }
54 if( $t eq 'export' ) { add_to_exports( $v, $tag ); next }
59 my @values = $parser->( $_ );
60 ( defined( $values[0] ) && length( $values[0] ) ) || next;
63 add_to_exports( $values[0], "$values[1] $tag" );
75 open OUT, '> '. $ext || die "unable to open file '$ext'";
77 binmode OUT; # Perl 5.004 on Unix complains for CR
80 #############################################################################
81 ## Name: lib/Wx/Wx_Exp.pm
82 ## Purpose: export lists (AUTOGENERATED, DO NOT EDIT)
83 ## Author: Mattia Barbon
85 ## Licence: This program is free software; you can redistribute it and/or
86 ## modify it under the same terms as Perl itself
87 #############################################################################
89 package Wx::Wx_Exp; # for RPM
93 foreach my $package ( sort keys %packages ) {
98 push \@EXPORT_OK, qw(@{$packages{$package}{exp_ok}});
100 \$EXPORT_TAGS{'everything'} = \\\@EXPORT_OK;
104 foreach my $tag ( sort keys %{ $packages{$package}{tags} } ) {
105 next unless length $tag;
107 \$EXPORT_TAGS{'$tag'} = [ qw(@{ $packages{$package}{tags}{$tag} }) ];