Browse Source

* 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 năm trước cách đây
mục cha
commit
255a9e7d22
1 tập tin đã thay đổi với 18 bổ sung0 xóa
  1. 18 0
      rtl/bsd/ostypes.inc

+ 18 - 0
rtl/bsd/ostypes.inc

@@ -106,6 +106,7 @@ TYPE
    pStat = ^stat;
 
   { directory services }
+{$ifndef darwinarm}
    dirent  = record
         d_fileno      : cuint32;                        // file number of entry
         d_reclen      : cuint16;                        // length of this record
@@ -113,6 +114,19 @@ TYPE
         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
    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;
    pDirent = ^dirent;
 
@@ -130,6 +144,10 @@ TYPE
 {$endif}
         dd_rewind : clong;        // magic cookie for rewinding
         dd_flags  : cint;         // flags for readdir
+{$ifdef darwin}
+        __dd_lock : pthread_mutex_t; // for thread locking
+        __dd_td : pointer;        // telldir position recording
+{$endif}
    end;
    TDir    = dir;
    pDir    = ^dir;