diff options
author | Keith Marshall <keithmarshall@@users.sf.net> | 2011-08-27 20:16:47 +0000 |
---|---|---|
committer | Keith Marshall <keithmarshall@@users.sf.net> | 2011-08-27 20:16:47 +0000 |
commit | 36ccb620ec90661974de944299ca4d4b975bafee (patch) | |
tree | b2005dcc8aa5e6d1992b2d8e5629ad850649490b /winsup/mingw/mingwex | |
parent | f4ec8743281979dcf223b961395a8a76a036b376 (diff) | |
download | cygnal-36ccb620ec90661974de944299ca4d4b975bafee.tar.gz cygnal-36ccb620ec90661974de944299ca4d4b975bafee.tar.bz2 cygnal-36ccb620ec90661974de944299ca4d4b975bafee.zip |
Don't expose implementation detail for opaque DIRENT structures.
Diffstat (limited to 'winsup/mingw/mingwex')
-rw-r--r-- | winsup/mingw/mingwex/dirent.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/dirent.c b/winsup/mingw/mingwex/dirent.c index 399a8d1b3..0d3e54a09 100644 --- a/winsup/mingw/mingwex/dirent.c +++ b/winsup/mingw/mingwex/dirent.c @@ -28,6 +28,60 @@ #define SUFFIX _T("*") #define SLASH _T("\\") +struct __dirstream_t +{ + /* Actual (private) declaration for opaque data type "DIR". */ + + /* disk transfer area for this dir */ + struct _finddata_t dd_dta; + + /* dirent struct to return from dir (NOTE: this makes this thread + * safe as long as only one thread uses a particular DIR struct at + * a time) */ + struct dirent dd_dir; + + /* _findnext handle */ + intptr_t dd_handle; + + /* + * Status of search: + * (type is now int -- was short in older versions). + * 0 = not started yet (next entry to read is first entry) + * -1 = off the end + * positive = 0 based index of next entry + */ + int dd_stat; + + /* given path for dir with search pattern (struct is extended) */ + char dd_name[1]; +}; + +struct __wdirstream_t +{ + /* Actual (private) declaration for opaque data type "_WDIR". */ + + /* disk transfer area for this dir */ + struct _wfinddata_t dd_dta; + + /* dirent struct to return from dir (NOTE: this makes this thread + * safe as long as only one thread uses a particular DIR struct at + * a time) */ + struct _wdirent dd_dir; + + /* _findnext handle */ + intptr_t dd_handle; + + /* + * Status of search: + * 0 = not started yet (next entry to read is first entry) + * -1 = off the end + * positive = 0 based index of next entry + */ + int dd_stat; + + /* given path for dir with search pattern (struct is extended) */ + wchar_t dd_name[1]; +}; /* Helper for opendir(). */ static inline unsigned _tGetFileAttributes (const _TCHAR * tPath) |