From 7b40ff231aae5e0d9cbc4550884e68ff9267c229 Mon Sep 17 00:00:00 2001 From: Steffen Mueller Date: Fri, 11 Feb 2011 18:31:44 +0100 Subject: [PATCH] Make ExtUtils::ParseXS use ExtUtils::Typemaps This is just the quick'n'dirty conversion to make it use EU::Typemaps. Eventually, we want to use it in its full object-oriented goodness! --- .../lib/ExtUtils/ParseXS/Utilities.pm | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm index 8412056..eb3ba17 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm @@ -375,19 +375,22 @@ sub process_typemaps { push @tm, standard_typemap_locations( \@INC ); - my ($type_kind_ref, $proto_letter_ref, $input_expr_ref, $output_expr_ref) - = ( {}, {}, {}, {} ); - - foreach my $typemap (@tm) { - next unless -f $typemap; + my $typemap = ExtUtils::Typemaps->new; + foreach my $typemap_loc (@tm) { + next unless -f $typemap_loc; # skip directories, binary files etc. - warn("Warning: ignoring non-text typemap file '$typemap'\n"), next - unless -T $typemap; - ($type_kind_ref, $proto_letter_ref, $input_expr_ref, $output_expr_ref) = - process_single_typemap( $typemap, - $type_kind_ref, $proto_letter_ref, $input_expr_ref, $output_expr_ref); + warn("Warning: ignoring non-text typemap file '$typemap_loc'\n"), next + unless -T $typemap_loc; + + $typemap->merge(file => $typemap_loc, replace => 1); } - return ($type_kind_ref, $proto_letter_ref, $input_expr_ref, $output_expr_ref); + + return ( + $typemap->_get_typemap_hash(), + $typemap->_get_prototype_hash(), + $typemap->_get_inputmap_hash(), + $typemap->_get_outputmap_hash(), + ); } =head2 C -- 1.8.3.1