Annotation of parser3/src/lib/ltdl/libltdl/lt__dirent.h, revision 1.2
1.1 moko 1: /* lt__dirent.h -- internal directory entry scanning interface
2:
1.2 ! moko 3: Copyright (C) 2001, 2004, 2006, 2011-2019, 2021-2024 Free Software
! 4: Foundation, Inc.
1.1 moko 5: Written by Bob Friesenhahn, 2001
6:
7: NOTE: The canonical source of this file is maintained with the
8: GNU Libtool package. Report bugs to bug-libtool@gnu.org.
9:
10: GNU Libltdl is free software; you can redistribute it and/or
11: modify it under the terms of the GNU Lesser General Public
12: License as published by the Free Software Foundation; either
13: version 2 of the License, or (at your option) any later version.
14:
15: As a special exception to the GNU Lesser General Public License,
16: if you distribute this file as part of a program or library that
17: is built using GNU Libtool, you may include this file under the
18: same distribution terms that you use for the rest of that program.
19:
20: GNU Libltdl is distributed in the hope that it will be useful,
21: but WITHOUT ANY WARRANTY; without even the implied warranty of
22: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23: GNU Lesser General Public License for more details.
24:
25: You should have received a copy of the GNU Lesser General Public
1.2 ! moko 26: License along with GNU Libltdl. If not, see <https://www.gnu.org/licenses/>.
1.1 moko 27: */
28:
1.2 ! moko 29: #if !defined LT__DIRENT_H
1.1 moko 30: #define LT__DIRENT_H 1
31:
1.2 ! moko 32: #if defined LT_CONFIG_H
1.1 moko 33: # include LT_CONFIG_H
34: #else
35: # include <config.h>
36: #endif
37:
38: #include "lt_system.h"
39:
40: #ifdef HAVE_DIRENT_H
41: /* We have a fully operational dirent subsystem. */
42: # include <dirent.h>
43: # define D_NAMLEN(dirent) (strlen((dirent)->d_name))
44:
45: #elif defined __WINDOWS__
46: /* Use some wrapper code to emulate dirent on windows.. */
47: # define WINDOWS_DIRENT_EMULATION 1
48:
49: # include <windows.h>
50:
51: # define D_NAMLEN(dirent) (strlen((dirent)->d_name))
52: # define dirent lt__dirent
53: # define DIR lt__DIR
54: # define opendir lt__opendir
55: # define readdir lt__readdir
56: # define closedir lt__closedir
57:
58: LT_BEGIN_C_DECLS
59:
60: struct dirent
61: {
62: char d_name[LT_FILENAME_MAX];
63: int d_namlen;
64: };
65:
66: typedef struct
67: {
68: HANDLE hSearch;
69: WIN32_FIND_DATA Win32FindData;
70: BOOL firsttime;
71: struct dirent file_info;
72: } DIR;
73:
74:
75: LT_SCOPE DIR * opendir (const char *path);
76: LT_SCOPE struct dirent *readdir (DIR *entry);
77: LT_SCOPE void closedir (DIR *entry);
78:
79: LT_END_C_DECLS
80:
1.2 ! moko 81: #else /* !defined __WINDOWS__*/
1.1 moko 82: ERROR - cannot find dirent
1.2 ! moko 83: #endif /*!defined __WINDOWS__*/
1.1 moko 84:
1.2 ! moko 85: #endif /*!defined LT__DIRENT_H*/
E-mail: