瀏覽代碼

* dirent structure available on 10.6 and iPhoneOS
* added some missing private fields to "dir" type for all Darwin platforms

git-svn-id: trunk@14334 -

Jonas Maebe 15 年之前
父節點
當前提交
255a9e7d22
共有 1 個文件被更改,包括 18 次插入0 次删除
  1. 18 0
      rtl/bsd/ostypes.inc

+ 18 - 0
rtl/bsd/ostypes.inc

@@ -106,6 +106,7 @@ TYPE
    pStat = ^stat;
    pStat = ^stat;
 
 
   { directory services }
   { directory services }
+{$ifndef darwinarm}
    dirent  = record
    dirent  = record
         d_fileno      : cuint32;                        // file number of entry
         d_fileno      : cuint32;                        // file number of entry
         d_reclen      : cuint16;                        // length of this record
         d_reclen      : cuint16;                        // length of this record
@@ -113,6 +114,19 @@ TYPE
         d_namlen      : cuint8;                         // length of string in d_name
         d_namlen      : cuint8;                         // length of string in d_name
         d_name        : array[0..(255 + 1)-1] of char;  // name must be no longer than this
         d_name        : array[0..(255 + 1)-1] of char;  // name must be no longer than this
    end;
    end;
+{$else not darwinarm}
+   {$packrecords 4}
+   { available on Mac OS X 10.6 and later, and used by all iPhoneOS versions }
+   dirent  = record
+        d_fileno      : cuint64;                        // file number of entry
+        d_seekoff     : cuint64;                        // seek offset (optional, used by servers)
+        d_reclen      : cuint16;                        // length of this record
+        d_namlen      : cuint16;                        // length of string in d_name
+        d_type        : cuint8;                         // file type, see below
+        d_name        : array[0..PATH_MAX-1] of char;        // name must be no longer than this
+   end;
+   {$packrecords c}
+{$endif darwinarm}
    TDirent = dirent;
    TDirent = dirent;
    pDirent = ^dirent;
    pDirent = ^dirent;
 
 
@@ -130,6 +144,10 @@ TYPE
 {$endif}
 {$endif}
         dd_rewind : clong;        // magic cookie for rewinding
         dd_rewind : clong;        // magic cookie for rewinding
         dd_flags  : cint;         // flags for readdir
         dd_flags  : cint;         // flags for readdir
+{$ifdef darwin}
+        __dd_lock : pthread_mutex_t; // for thread locking
+        __dd_td : pointer;        // telldir position recording
+{$endif}
    end;
    end;
    TDir    = dir;
    TDir    = dir;
    pDir    = ^dir;
    pDir    = ^dir;