# HG changeset patch # User anatofuz # Date 1580191822 -32400 # Node ID 0a74a7bbe76589ffbffe3c3143975483ef802489 # Parent 98aea649e37bc5da7de56e2d25f444f3cd1cfbd7 tweak... diff -r 98aea649e37b -r 0a74a7bbe765 src/gearsTools/gen_Stub.pl --- a/src/gearsTools/gen_Stub.pl Tue Jan 28 14:23:29 2020 +0900 +++ b/src/gearsTools/gen_Stub.pl Tue Jan 28 15:10:22 2020 +0900 @@ -15,4 +15,4 @@ my $target_cbc_file = shift; my $stubManager = Gears::Stub->new(file_name => File::Spec->rel2abs($target_cbc_file)); -$stubManager->findInterfacewImpl($stubManager->slup()); +$stubManager->findInterfacewImpl(File::Spec->rel2abs($target_cbc_file)); diff -r 98aea649e37b -r 0a74a7bbe765 src/gearsTools/lib/Gears/Stub.pm --- a/src/gearsTools/lib/Gears/Stub.pm Tue Jan 28 14:23:29 2020 +0900 +++ b/src/gearsTools/lib/Gears/Stub.pm Tue Jan 28 15:10:22 2020 +0900 @@ -18,35 +18,12 @@ } -sub slup { - my $self = shift; - my @contents = (); - open my $fh, '<', $self->{file_name}; - while (my $line = <$fh>) { - push(@contents,$line); - } - close $fh; - return \@contents; -} - sub findInterfacewImpl { - my ($self, $cbc_file_content) = @_; - my %findInterfaces; - - extraction_dg_compile_sources - #for my $i (0..$#{$cbc_file_content}) { - # my $line = $cbc_file_content->[$i]; - # if ($line =~ /#interface\s*"([\w.]+)"/) { - # push(@{$findInterfaces{$1}},[$i, $line]); - # next; - # } - - # if ($line =~ /data_gear\s*"([\w.]+)"/) { - # push(@{$findInterfaces{$1}},[$i, $line]); - # } - #} - p %findInterfaces; + my $self = shift; + my $cbc_file = shift // $self->{file_name}; + my $findInterfaces = Gears::Context->extraction_dg_compile_sources([$cbc_file]); + p $findInterfaces; } 1;