changeset 115:83aadf17d3d0

use .dg files preferentially than .h
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Mon, 02 Dec 2019 11:45:48 +0900
parents f3ebb813d0bf
children e45b8d57b9e8
files src/gearsTools/lib/Gears/Context.pm src/interface/file.dg
diffstat 2 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/gearsTools/lib/Gears/Context.pm	Mon Dec 02 11:25:51 2019 +0900
+++ b/src/gearsTools/lib/Gears/Context.pm	Mon Dec 02 11:45:48 2019 +0900
@@ -193,9 +193,13 @@
   my $header_paths = Gears::Util->find_headers_path($search_bash_path);
   map {
     /(\w+)\.h/;
-    my $header_tile = $1;
-    if (exists $res{$header_tile}){
-      $res{$header_tile} = $_;
+    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;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/interface/file.dg	Mon Dec 02 11:45:48 2019 +0900
@@ -0,0 +1,9 @@
+typedef struct file <Impl> {
+    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;