3 #ifndef SCM_WIN32_DIRENT_H
4 #define SCM_WIN32_DIRENT_H
6 /* Copyright (C) 2001, 2006 Free Software Foundation, Inc.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but 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.
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 02110-1301 USA
23 /* Directory stream type.
24 The miscellaneous Unix `readdir' implementations read directory data
25 into a buffer and return `struct dirent *' pointers into it. */
27 #include <sys/types.h>
31 int fd; /* File descriptor. */
32 char *data; /* Directory block. */
33 size_t allocation; /* Space allocated for the block. */
34 size_t size; /* Total valid data in the block. */
35 size_t offset; /* Current offset into the block. */
36 off_t filepos; /* Position of next entry to read. */
37 char *mask; /* Initial file mask. */
44 unsigned short int d_reclen;
49 #define d_fileno d_ino /* Backwards compatibility. */
51 /* This is the data type of directory stream objects.
52 The actual structure is opaque to users. */
54 typedef struct dirstream DIR;
56 DIR * opendir (const char * name);
57 struct dirent * readdir (DIR * dir);
58 int closedir (DIR * dir);
59 void rewinddir (DIR * dir);
60 void seekdir (DIR * dir, off_t offset);
61 off_t telldir (DIR * dir);
62 int dirfd (DIR * dir);
64 #endif /* SCM_WIN32_DIRENT_H */