Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #if !defined(LT__DIRENT_H)
00032 #define LT__DIRENT_H 1
00033
00034 #if defined(LT_CONFIG_H)
00035 # include LT_CONFIG_H
00036 #else
00037 # include <config.h>
00038 #endif
00039
00040 #include "lt_system.h"
00041
00042 #ifdef HAVE_DIRENT_H
00043
00044 # include <dirent.h>
00045 # define D_NAMLEN(dirent) (strlen((dirent)->d_name))
00046
00047 #elif defined __WINDOWS__
00048
00049 # define WINDOWS_DIRENT_EMULATION 1
00050
00051 # include <windows.h>
00052
00053 # define D_NAMLEN(dirent) (strlen((dirent)->d_name))
00054 # define dirent lt__dirent
00055 # define DIR lt__DIR
00056 # define opendir lt__opendir
00057 # define readdir lt__readdir
00058 # define closedir lt__closedir
00059
00060 LT_BEGIN_C_DECLS
00061
00062 struct dirent
00063 {
00064 char d_name[LT_FILENAME_MAX];
00065 int d_namlen;
00066 };
00067
00068 typedef struct
00069 {
00070 HANDLE hSearch;
00071 WIN32_FIND_DATA Win32FindData;
00072 BOOL firsttime;
00073 struct dirent file_info;
00074 } DIR;
00075
00076
00077 LT_SCOPE DIR * opendir (const char *path);
00078 LT_SCOPE struct dirent *readdir (DIR *entry);
00079 LT_SCOPE void closedir (DIR *entry);
00080
00081 LT_END_C_DECLS
00082
00083 #else
00084 ERROR - cannot find dirent
00085 #endif
00087 #endif