Partially sync files.el from XEmacs 21.5 for wildcard support.
[sxemacs] / src / ndir.h
1 /*
2 This file is part of SXEmacs
3
4 SXEmacs is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 SXEmacs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17
18 /* Synched up with: FSF 19.30. */
19
20 /*
21         <dir.h> -- definitions for 4.2BSD-compatible directory access
22
23         last edit:      09-Jul-1983     D A Gwyn
24 */
25
26 #ifndef INCLUDED_ndir_h_
27 #define INCLUDED_ndir_h_
28
29 #define DIRBLKSIZ       512     /* size of directory block */
30 #define MAXNAMLEN       15      /* maximum filename length */
31         /* NOTE:  MAXNAMLEN must be one less than a multiple of 4 */
32
33 struct direct {                 /* data from readdir() */
34         long d_ino;             /* inode number of entry */
35         unsigned short d_reclen;        /* length of this record */
36         unsigned short d_namlen;        /* length of string in d_name */
37         char d_name[MAXNAMLEN + 1];     /* name of file */
38 };
39
40 typedef struct {
41         int dd_fd;              /* file descriptor */
42         int dd_loc;             /* offset in block */
43         int dd_size;            /* amount of valid data */
44         char dd_buf[DIRBLKSIZ]; /* directory block */
45 } DIR;                          /* stream data from opendir() */
46
47 DIR *opendir(const char *filename);
48 int closedir(DIR * dirp);
49 struct direct *readdir(DIR * dirp);
50 struct direct *readdirver(DIR * dirp);
51 long telldir(DIR * dirp);
52 void seekdir(DIR * dirp, long loc);
53
54 #define rewinddir( dirp )       seekdir( dirp, 0L )
55
56 #endif                          /* INCLUDED_ndir_h_ */