--- parser3/src/include/pa_dir.h 2005/11/18 10:11:08 1.18 +++ parser3/src/include/pa_dir.h 2015/06/29 17:59:13 1.26 @@ -1,14 +1,14 @@ /** @file Parser: directory scanning for different OS-es decls. - Copyright (c) 2000,2001-2005 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2000-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_DIR_H #define PA_DIR_H -static const char * const IDENT_DIR_H="$Date: 2005/11/18 10:11:08 $"; +#define IDENT_PA_DIR_H "$Id: pa_dir.h,v 1.26 2015/06/29 17:59:13 moko Exp $" #include "pa_config_includes.h" @@ -17,54 +17,54 @@ static const char * const IDENT_DIR_H="$ for findfirst/next/close interface */ -#ifdef WIN32 +#ifdef _MSC_VER #include #define MAXPATH MAX_PATH -#define FA_DIREC FILE_ATTRIBUTE_DIRECTORY struct ffblk { - DWORD ff_attrib;/*dwFileAttributes;*/ - FILETIME ftCreationTime; - FILETIME ftLastAccessTime; - FILETIME ftLastWriteTime; - DWORD nFileSizeHigh; - DWORD nFileSizeLow; - DWORD dwReserved0; - DWORD dwReserved1; - CHAR ff_name[ MAX_PATH ];/*cFileName[ MAX_PATH ];*/ - CHAR cAlternateFileName[ 14 ]; + DWORD ff_attrib;/*dwFileAttributes;*/ + FILETIME ftCreationTime; + FILETIME ftLastAccessTime; + FILETIME ftLastWriteTime; + DWORD nFileSizeHigh; + DWORD nFileSizeLow; + DWORD dwReserved0; + DWORD dwReserved1; + CHAR ff_name[ MAX_PATH ];/*cFileName[ MAX_PATH ];*/ + CHAR cAlternateFileName[ 14 ]; /*helper*/ HANDLE handle; -/* - - unsigned char ff_attrib __attribute__((packed)); - unsigned short ff_ftime __attribute__((packed)); - unsigned short ff_fdate __attribute__((packed)); - unsigned long ff_fsize __attribute__((packed)); - char ff_name[260] __attribute__((packed)); - */ + bool is_dir(bool); + double size(); + time_t c_timestamp(); + time_t m_timestamp(); + time_t a_timestamp(); }; #else -#include -#include -#include -#include - #define MAXPATH 1000 /*NAME_MAX*/ -#define FA_DIREC S_IFDIR struct ffblk { /*as if in windows :)*/ - unsigned char ff_attrib; char ff_name[ MAXPATH ]; /*helpers*/ DIR *dir; - char filePath[MAXPATH]; + const char *filePath; + struct stat _st; + +#ifdef HAVE_STRUCT_DIRENT_D_TYPE + unsigned char _d_type; +#endif + bool is_dir(bool); + void stat_file(); + double size(); + time_t c_timestamp(); + time_t m_timestamp(); + time_t a_timestamp(); }; #endif