Commit | Line | Data |
---|---|---|
8dd6dfdc MV |
1 | /* classes: h_files */ |
2 | ||
b4e15479 SJ |
3 | #ifndef SCM_WIN32_DIRENT_H |
4 | #define SCM_WIN32_DIRENT_H | |
8dd6dfdc | 5 | |
2b829bbb | 6 | /* Copyright (C) 2001, 2006 Free Software Foundation, Inc. |
8dd6dfdc | 7 | * |
73be1d9e | 8 | * This library is free software; you can redistribute it and/or |
53befeb7 NJ |
9 | * modify it under the terms of the GNU Lesser General Public License |
10 | * as published by the Free Software Foundation; either version 3 of | |
11 | * the License, or (at your option) any later version. | |
8dd6dfdc | 12 | * |
53befeb7 NJ |
13 | * This library is distributed in the hope that it will be useful, but |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
73be1d9e MV |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 | * Lesser General Public License for more details. | |
8dd6dfdc | 17 | * |
73be1d9e MV |
18 | * You should have received a copy of the GNU Lesser General Public |
19 | * License along with this library; if not, write to the Free Software | |
53befeb7 NJ |
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
21 | * 02110-1301 USA | |
73be1d9e | 22 | */ |
8dd6dfdc MV |
23 | |
24 | /* Directory stream type. | |
25 | The miscellaneous Unix `readdir' implementations read directory data | |
26 | into a buffer and return `struct dirent *' pointers into it. */ | |
27 | ||
28 | #include <sys/types.h> | |
29 | ||
30 | struct dirstream | |
31 | { | |
32 | int fd; /* File descriptor. */ | |
33 | char *data; /* Directory block. */ | |
34 | size_t allocation; /* Space allocated for the block. */ | |
35 | size_t size; /* Total valid data in the block. */ | |
36 | size_t offset; /* Current offset into the block. */ | |
37 | off_t filepos; /* Position of next entry to read. */ | |
38 | char *mask; /* Initial file mask. */ | |
39 | }; | |
40 | ||
41 | struct dirent | |
42 | { | |
43 | long d_ino; | |
44 | off_t d_off; | |
45 | unsigned short int d_reclen; | |
46 | unsigned char d_type; | |
47 | char d_name[256]; | |
48 | }; | |
49 | ||
50 | #define d_fileno d_ino /* Backwards compatibility. */ | |
51 | ||
52 | /* This is the data type of directory stream objects. | |
53 | The actual structure is opaque to users. */ | |
54 | ||
55 | typedef struct dirstream DIR; | |
56 | ||
57 | DIR * opendir (const char * name); | |
58 | struct dirent * readdir (DIR * dir); | |
59 | int closedir (DIR * dir); | |
60 | void rewinddir (DIR * dir); | |
61 | void seekdir (DIR * dir, off_t offset); | |
62 | off_t telldir (DIR * dir); | |
63 | int dirfd (DIR * dir); | |
64 | ||
b4e15479 | 65 | #endif /* SCM_WIN32_DIRENT_H */ |