Move fix for cygw32 icon issue from emacs-24 branch to trunk as Stefan Monnier requests
[bpt/emacs.git] / nt / inc / dirent.h
1 /*
2 <dirent.h> -- definitions for POSIX-compatible directory access
3
4 * The code here is forced by the interface, and is not subject to
5 * copyright, constituting the only possible expression of the
6 * algorithm in this format.
7 */
8
9 #define DIRBLKSIZ 512 /* size of directory block */
10 #ifdef WINDOWSNT
11 #define MAXNAMLEN 255
12 #else /* not WINDOWSNT */
13 #define MAXNAMLEN 15 /* maximum filename length */
14 #endif /* not WINDOWSNT */
15 /* NOTE: MAXNAMLEN must be one less than a multiple of 4 */
16
17 struct dirent /* data from readdir() */
18 {
19 long d_ino; /* inode number of entry */
20 unsigned short d_reclen; /* length of this record */
21 unsigned short d_namlen; /* length of string in d_name */
22 char d_name[MAXNAMLEN+1]; /* name of file */
23 };
24
25 typedef struct
26 {
27 int dd_fd; /* file descriptor */
28 int dd_loc; /* offset in block */
29 int dd_size; /* amount of valid data */
30 char dd_buf[DIRBLKSIZ]; /* directory block */
31 } DIR; /* stream data from opendir() */
32
33 extern DIR *opendir (char *);
34 extern struct dirent *readdir (DIR *);
35 extern void seekdir (DIR *, long);
36 extern void closedir (DIR *);
37
38 #define rewinddir( dirp ) seekdir( dirp, 0L )