Change Guile license to LGPLv3+
[bpt/guile.git] / libguile / win32-dirent.h
1 /* classes: h_files */
2
3 #ifndef SCM_WIN32_DIRENT_H
4 #define SCM_WIN32_DIRENT_H
5
6 /* Copyright (C) 2001, 2006 Free Software Foundation, Inc.
7 *
8 * This library is free software; you can redistribute it and/or
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.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
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
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
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
65 #endif /* SCM_WIN32_DIRENT_H */