Mercurial > hg > GearsTemplate
changeset 558:8a825fc15817
tweak
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 18 Nov 2019 21:32:08 +0900 |
parents | 1eb2a22ec1e3 |
children | 2dc06f944a85 |
files | src/parallel_execution/lib/Gears/Util.pm src/parallel_execution/trans_impl.pl |
diffstat | 2 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/lib/Gears/Util.pm Mon Nov 18 21:22:34 2019 +0900 +++ b/src/parallel_execution/lib/Gears/Util.pm Mon Nov 18 21:32:08 2019 +0900 @@ -86,20 +86,24 @@ return $f; } -sub find_interface { - my ($class, $interface) = @_; - my $result = ''; +sub find_header { + my $class = shift; + my $header_name = shift; + + my $find_path = shift // "."; + my $header_file = ''; + find( { wanted => sub { - if ($_ =~ /\/$interface\.h/) { - $result = $_; + if ($_ =~ /\/$header_name\.h/) { + $header_file = $_; } }, no_chdir => 1, }, - "."); - return $result; + $find_path); + return $header_file; } 1;
--- a/src/parallel_execution/trans_impl.pl Mon Nov 18 21:22:34 2019 +0900 +++ b/src/parallel_execution/trans_impl.pl Mon Nov 18 21:32:08 2019 +0900 @@ -7,8 +7,11 @@ use Gears::Util; use DDP { deparse => 1}; +my $cur_path = "$FindBin::Bin"; my $impl_file = shift or die 'require impl file'; my $ir = Gears::Util->parse_impl($impl_file); -my $hoge = Gears::Util->find_interface($ir->{isa}); -my $foo = Gears::Util->slup($hoge); +my $hoge = Gears::Util->find_header($ir->{isa},$cur_path); +#my $foo = Gears::Util->slup($hoge); +p $hoge; +