comparison src/ndir.h @ 428:3ecd8885ac67 r21-2-22

Import from CVS: tag r21-2-22
author cvs
date Mon, 13 Aug 2007 11:28:15 +0200
parents
children 8de8e3f6228a
comparison
equal deleted inserted replaced
427:0a0253eac470 428:3ecd8885ac67
1 /* This file is part of XEmacs.
2
3 XEmacs is free software; you can redistribute it and/or modify it
4 under the terms of the GNU General Public License as published by the
5 Free Software Foundation; either version 2, or (at your option) any
6 later version.
7
8 XEmacs is distributed in the hope that it will be useful, but WITHOUT
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with XEmacs; see the file COPYING. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. */
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 #define DIRBLKSIZ 512 /* size of directory block */
27 #ifdef WINDOWSNT
28 #define MAXNAMLEN 255
29 #else /* not WINDOWSNT */
30 #define MAXNAMLEN 15 /* maximum filename length */
31 #endif /* not WINDOWSNT */
32 /* NOTE: MAXNAMLEN must be one less than a multiple of 4 */
33
34 struct direct /* data from readdir() */
35 {
36 long d_ino; /* inode number of entry */
37 unsigned short d_reclen; /* length of this record */
38 unsigned short d_namlen; /* length of string in d_name */
39 char d_name[MAXNAMLEN+1]; /* name of file */
40 };
41
42 typedef struct
43 {
44 int dd_fd; /* file descriptor */
45 int dd_loc; /* offset in block */
46 int dd_size; /* amount of valid data */
47 char dd_buf[DIRBLKSIZ]; /* directory block */
48 } DIR; /* stream data from opendir() */
49
50 DIR *opendir (CONST char *filename);
51 int closedir (DIR *dirp);
52 struct direct *readdir (DIR *dirp);
53 struct direct *readdirver (DIR *dirp);
54 long telldir (DIR *dirp);
55 void seekdir (DIR *dirp, long loc);
56
57 #define rewinddir( dirp ) seekdir( dirp, 0L )