1*1424dfb3Schristos /* Private details of the DIR type.
2*1424dfb3Schristos    Copyright (C) 2011-2020 Free Software Foundation, Inc.
3*1424dfb3Schristos 
4*1424dfb3Schristos    This program is free software: you can redistribute it and/or modify
5*1424dfb3Schristos    it under the terms of the GNU General Public License as published by
6*1424dfb3Schristos    the Free Software Foundation; either version 3 of the License, or
7*1424dfb3Schristos    (at your option) any later version.
8*1424dfb3Schristos 
9*1424dfb3Schristos    This program is distributed in the hope that it will be useful,
10*1424dfb3Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*1424dfb3Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*1424dfb3Schristos    GNU General Public License for more details.
13*1424dfb3Schristos 
14*1424dfb3Schristos    You should have received a copy of the GNU General Public License
15*1424dfb3Schristos    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
16*1424dfb3Schristos 
17*1424dfb3Schristos #ifndef _DIRENT_PRIVATE_H
18*1424dfb3Schristos #define _DIRENT_PRIVATE_H 1
19*1424dfb3Schristos 
20*1424dfb3Schristos #define WIN32_LEAN_AND_MEAN
21*1424dfb3Schristos #include <windows.h>
22*1424dfb3Schristos 
23*1424dfb3Schristos /* Don't assume that UNICODE is not defined.  */
24*1424dfb3Schristos #undef WIN32_FIND_DATA
25*1424dfb3Schristos #define WIN32_FIND_DATA WIN32_FIND_DATAA
26*1424dfb3Schristos 
27*1424dfb3Schristos struct gl_directory
28*1424dfb3Schristos {
29*1424dfb3Schristos   /* Status, or error code to produce in next readdir() call.
30*1424dfb3Schristos      -2 means the end of the directory is already reached,
31*1424dfb3Schristos      -1 means the entry was already filled by FindFirstFile,
32*1424dfb3Schristos      0 means the entry needs to be filled using FindNextFile.
33*1424dfb3Schristos      A positive value is an error code.  */
34*1424dfb3Schristos   int status;
35*1424dfb3Schristos   /* Handle, reading the directory, at current position.  */
36*1424dfb3Schristos   HANDLE current;
37*1424dfb3Schristos   /* Found directory entry.  */
38*1424dfb3Schristos   WIN32_FIND_DATA entry;
39*1424dfb3Schristos   /* Argument to pass to FindFirstFile.  It consists of the absolutized
40*1424dfb3Schristos      directory name, followed by a directory separator and the wildcards.  */
41*1424dfb3Schristos   char dir_name_mask[1];
42*1424dfb3Schristos };
43*1424dfb3Schristos 
44*1424dfb3Schristos #endif /* _DIRENT_PRIVATE_H */
45