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