Commit | Line | Data |
0a753a76 |
1 | // dirent.h |
2 | |
3 | // djl |
4 | // Provide UNIX compatibility |
5 | |
6 | #ifndef _INC_DIRENT |
7 | #define _INC_DIRENT |
8 | |
9 | // |
10 | // NT versions of readdir(), etc |
11 | // From the MSDOS implementation |
12 | // |
13 | |
14 | // Directory entry size |
15 | #ifdef DIRSIZ |
16 | #undef DIRSIZ |
17 | #endif |
18 | #define DIRSIZ(rp) (sizeof(struct direct)) |
19 | |
20 | // needed to compile directory stuff |
21 | #define DIRENT direct |
22 | |
23 | // structure of a directory entry |
24 | typedef struct direct |
25 | { |
26 | long d_ino; // inode number (not used by MS-DOS) |
27 | int d_namlen; // Name length |
28 | char d_name[257]; // file name |
29 | } _DIRECT; |
30 | |
31 | // structure for dir operations |
32 | typedef struct _dir_struc |
33 | { |
34 | char *start; // Starting position |
35 | char *curr; // Current position |
36 | long size; // Size of string table |
37 | long nfiles; // number if filenames in table |
38 | struct direct dirstr; // Directory structure to return |
39 | } DIR; |
40 | |
41 | DIR *opendir(char *filename); |
42 | struct direct *readdir(DIR *dirp); |
43 | long telldir(DIR *dirp); |
44 | void seekdir(DIR *dirp,long loc); |
45 | void rewinddir(DIR *dirp); |
46 | int closedir(DIR *dirp); |
47 | |
48 | |
49 | #endif //_INC_DIRENT |