home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 Shareware (Platinum Edition) / QUEPLAT95.ISO / files / programm / lfnlib / lfn.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-23  |  2.1 KB  |  85 lines

  1. //lfn.h             lfn-handling file functions for 16-bit apps
  2. //created 5/25/95   Matt Ginzton
  3.  
  4. //(c) 1995 Matt Ginzton, MaDdoG Software
  5. //permission is granted to use and modify this code as long as attribution
  6. //is given.  Questions?  Email mginzton@leland.stanford.edu, or via
  7. //CompuServe, 75022,650.
  8.  
  9.  
  10. #ifndef _LFN_H_
  11. #define _LFN_H_
  12.  
  13. #include <tchar.h>
  14.  
  15. #ifndef _INC_WINDOWS
  16. typedef unsigned long DWORD;
  17. #endif
  18.  
  19. #ifndef MAX_PATH
  20. #define MAX_PATH    260
  21. #endif
  22.  
  23. typedef struct _FILETIME { // ft  
  24.     DWORD dwLowDateTime;
  25.     DWORD dwHighDateTime;
  26. } FILETIME;
  27.  
  28. //definition of _find_t -- straight out of dos.h
  29. #ifndef _FIND_T_DEFINED
  30. #pragma pack(2)
  31.  
  32. struct _find_t {
  33.     char reserved[21];
  34.     char attrib;
  35.     unsigned wr_time;
  36.     unsigned wr_date;
  37.     long size;
  38.     char name[13];
  39.     };
  40.  
  41. #ifndef __STDC__
  42. /* Non-ANSI name for compatibility */
  43. #define find_t _find_t
  44. #endif 
  45.  
  46. #pragma pack()
  47. #define _FIND_T_DEFINED
  48. #endif 
  49.  
  50. typedef struct _WIN32_FIND_DATA { // wfd  
  51.     DWORD dwFileAttributes;
  52.     FILETIME ftCreationTime;
  53.     FILETIME ftLastAccessTime;
  54.     FILETIME ftLastWriteTime;
  55.     DWORD    nFileSizeHigh;
  56.     DWORD    nFileSizeLow;
  57.     DWORD    dwReserved0;
  58.     DWORD    dwReserved1;
  59.     TCHAR    cFileName[ MAX_PATH ];
  60.     TCHAR    cAlternateFileName[ 14 ];
  61. } WIN32_FIND_DATA;
  62.  
  63.  
  64. typedef struct _lfnfind_t
  65. {
  66.     struct _find_t      SFN;
  67.     WIN32_FIND_DATA     LFN;
  68.     char *              name;       //since it could be in either
  69.     int                 bIsLong;    //so client can tell if it needs to
  70.     int                 Handle;     //win32 search handle
  71. } _lfnfind_t;
  72.  
  73.  
  74. int _lfn_init (char drive);
  75. unsigned _lfn_findfirst( const char *filename, unsigned attrib, _lfnfind_t *fileinfo );
  76. unsigned _lfn_findnext( _lfnfind_t *fileinfo );
  77. void _lfn_findclose ( _lfnfind_t * fileinfo);
  78. int _lfn_chdir ( const char * dirname);
  79. char * _lfn_getdcwd( int drive, char *buffer, int maxlen );
  80. char * _lfn_getcwd( char *buffer, int maxlen );
  81. unsigned _lfn_open( const char *filename, unsigned mode, int *handle );
  82. int _lfn_eof ( int handle );
  83.  
  84. #endif
  85.