Subversion Repositories SvarDOS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2019 mateusz.vi 1
/****************************************************************************
2
 
2028 mateusz.vi 3
  Win32 File compatibility for DOS.
2019 mateusz.vi 4
  [This version does support LFNs, if available.]
5
 
6
  Written by: Kenneth J. Davis
7
  Date:       August, 2000
8
  Contact:    jeremyd@computer.org
9
 
10
 
11
Copyright (c): Public Domain [United States Definition]
12
 
13
Permission is hereby granted, free of charge, to any person obtaining a copy
14
of this software and associated documentation files (the "Software"), to deal
15
in the Software without restriction, including without limitation the rights
16
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
copies of the Software, and to permit persons to whom the Software is
18
furnished to do so, subject to the following conditions:
19
 
20
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23
NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR AUTHORS BE
24
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
25
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
26
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
DEALINGS IN THE SOFTWARE.
28
 
29
****************************************************************************/
30
 
31
#ifndef W32FDOS_H
32
#define W32FDOS_H
33
 
2047 mateusz.vi 34
#define FILE_A_READONLY  0x0001
35
#define FILE_A_HIDDEN    0x0002
36
#define FILE_A_SYSTEM    0x0004
37
#define FILE_A_VOL       0x0008
38
#define FILE_A_DIR       0x0010
39
#define FILE_A_ARCH      0x0020
2019 mateusz.vi 40
 
41
typedef short BOOL;
42
typedef unsigned char BYTE;
43
typedef unsigned short WORD;
44
typedef unsigned long DWORD;
45
 
46
typedef struct FILETIME   /* should correspond to a quad word */
2028 mateusz.vi 47
{
2019 mateusz.vi 48
  WORD ldw[2];  /* LowDoubleWord  */
49
  DWORD hdw;    /* HighDoubleWord */
50
} FILETIME;
51
 
2040 mateusz.vi 52
struct WIN32_FIND_DATA {
2047 mateusz.vi 53
  unsigned short attrib;
2019 mateusz.vi 54
  FILETIME ftCreationTime;
55
  FILETIME ftLastAccessTime;
56
  FILETIME ftLastWriteTime;
57
  DWORD    nFileSizeHigh;
58
  DWORD    nFileSizeLow;
59
  DWORD    dwReserved0;
60
  DWORD    dwReserved1;
61
  char cFileName[ 260 ];
62
  char cAlternateFileName[ 14 ];
2040 mateusz.vi 63
};
2019 mateusz.vi 64
 
65
 
2044 mateusz.vi 66
_Packed struct FFDTA { /* same format as a ffblk struct */
2019 mateusz.vi 67
  BYTE reserved[21]; /* dos positioning info */
2041 mateusz.vi 68
  BYTE ff_attr;      /* file attributes */
2019 mateusz.vi 69
  WORD ff_ftime;     /* time when file created/modified */
70
  WORD ff_fdate;     /* date when file created/modified */
71
  DWORD ff_fsize;    /* low word followed by high word */
72
  BYTE ff_name[13];  /* file name, not space padded, period, '\0' terminated, wildcards replaced */
2041 mateusz.vi 73
};
2019 mateusz.vi 74
 
75
 
2046 mateusz.vi 76
struct FFDTA *FindFirstFile(const char *pathname, struct WIN32_FIND_DATA *findData);
77
int FindNextFile(struct FFDTA *hnd, struct WIN32_FIND_DATA *findData);
78
void FindClose(struct FFDTA *hnd);
2019 mateusz.vi 79
 
2047 mateusz.vi 80
int GetFileAttributes(unsigned short *attr, const char *pathname);
2019 mateusz.vi 81
 
82
/* Only the 1st 4 arguments are used and returns zero on error */
2042 mateusz.vi 83
int GetVolumeInformation(const char *lpRootPathName, char *lpVolumeNameBuffer,
84
  DWORD nVolumeNameSize, DWORD *lpVolumeSerialNumber);
2019 mateusz.vi 85
 
86
#endif