# HG changeset patch # User anatofuz # Date 1575256790 -32400 # Node ID e45b8d57b9e8ffcb00d173c1472064970e30bed1 # Parent 83aadf17d3d09cee378924a3e28cbb9a3532889f tweak context.pm diff -r 83aadf17d3d0 -r e45b8d57b9e8 src/file.h --- a/src/file.h Mon Dec 02 11:45:48 2019 +0900 +++ b/src/file.h Mon Dec 02 12:19:50 2019 +0900 @@ -1,3 +1,12 @@ +typedef struct file { + enum { FD_NONE, FD_PIPE, FD_INODE } type; + int ref; // reference count + char readable; + char writable; + struct pipe *pipe; + struct inode *ip; + uint off; +} file; // in-memory copy of an inode struct inode { uint dev; // Device number diff -r 83aadf17d3d0 -r e45b8d57b9e8 src/gearsTools/lib/Gears/Context.pm --- a/src/gearsTools/lib/Gears/Context.pm Mon Dec 02 11:45:48 2019 +0900 +++ b/src/gearsTools/lib/Gears/Context.pm Mon Dec 02 12:19:50 2019 +0900 @@ -58,7 +58,22 @@ next; } - if ($line =~ /ALLOCATE_(?:PTR_)?ARRAY\(context,\s*(\w+),[\s\w]+\)/) { + #Element* element = &ALLOCATE(cbc_context, Element)->Element; + if ($line =~ /ALLOCATE\w*\((?:cbc_)?context,\s*(\w+)\)/) { + my $implementation = $1; + $counter{impl}->{$implementation}++; + $self->{data_gears_with_count}->{$implementation}->{caller}->{$cbc_file}++; + next; + } + + if ($line =~ /ALLOCATE_(?:PTR_)?ARRAY\((?:cbc_)?context,\s*(\w+),[\s\w]+\)/) { + my $implementation = $1; + $counter{impl}->{$implementation}++; + $self->{data_gears_with_count}->{$implementation}->{caller}->{$cbc_file}++; + next; + } + + if ($line =~ /new\s+(\w+?)\([\w\s]*\);/) { my $implementation = $1; $counter{impl}->{$implementation}++; $self->{data_gears_with_count}->{$implementation}->{caller}->{$cbc_file}++; @@ -192,14 +207,15 @@ my $header_paths = Gears::Util->find_headers_path($search_bash_path); map { - /(\w+)\.h/; - my $header_file = $1; - if (exists $res{$header_file}) { - if ($res{$header_file} =~ /^\d+$/){ - $res{$header_file} = $_; - } elsif (($_ =~ /\.dg$/) && ($res{$header_file} =~ /\.h$/)) { - $res{$header_file} = $_; - } + if (/(\w+)\.h/) { + my $header_file = $1; + if (exists $res{$header_file}) { + if ($res{$header_file} =~ /^\d+$/){ + $res{$header_file} = $_; + } elsif (($_ =~ /\.dg$/) && ($res{$header_file} =~ /\.h$/)) { + $res{$header_file} = $_; + } + } } } sort @$header_paths; return \%res;