annotate src/ndir.h @ 22:8fc7fe29b841 r19-15b94

Import from CVS: tag r19-15b94
author cvs
date Mon, 13 Aug 2007 08:50:29 +0200
parents 376386a54a3c
children 1370575f1259
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 /* Synched up with: FSF 19.30. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 <dir.h> -- definitions for 4.2BSD-compatible directory access
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 last edit: 09-Jul-1983 D A Gwyn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #ifdef VMS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #ifndef FAB$C_BID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #include <fab.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #ifndef NAM$C_BID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #include <nam.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #ifndef RMS$_SUC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 #include <rmsdef.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #include "vms-dir.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #endif /* VMS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 #define DIRBLKSIZ 512 /* size of directory block */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #ifdef VMS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #define MAXNAMLEN (DIR$S_NAME + 7) /* 80 plus room for version #. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 #define MAXFULLSPEC NAM$C_MAXRSS /* Maximum full spec */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 #ifdef WINDOWSNT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 #define MAXNAMLEN 255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 #else /* not WINDOWSNT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 #define MAXNAMLEN 15 /* maximum filename length */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 #endif /* not WINDOWSNT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 #endif /* VMS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 /* NOTE: MAXNAMLEN must be one less than a multiple of 4 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 struct direct /* data from readdir() */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 long d_ino; /* inode number of entry */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 unsigned short d_reclen; /* length of this record */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 unsigned short d_namlen; /* length of string in d_name */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 char d_name[MAXNAMLEN+1]; /* name of file */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 typedef struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 int dd_fd; /* file descriptor */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 int dd_loc; /* offset in block */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 int dd_size; /* amount of valid data */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 char dd_buf[DIRBLKSIZ]; /* directory block */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 } DIR; /* stream data from opendir() */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 extern DIR *opendir (CONST char *filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 extern int closedir (DIR *dirp);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 extern struct direct *readdir (DIR *dirp);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 extern struct direct *readdirver (DIR *dirp);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 extern long telldir (DIR *dirp);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 extern void seekdir (DIR *dirp, long loc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 #define rewinddir( dirp ) seekdir( dirp, 0L )