xref: /openbsd/gnu/usr.bin/cvs/vms/ndir.h (revision 17df1aa7)
1 /*
2 	<ndir.h> -- definitions for 4.2BSD-compatible directory access
3 
4 	28-dec-1994	Richard Levitte
5 	See ChangeLog for more recent modification history.
6 */
7 
8 #ifndef NDIR_H
9 
10 #if 0
11 #ifndef FAB$C_BID
12 #include <fab.h>
13 #endif
14 #endif
15 #ifndef NAM$C_BID
16 #include <nam.h>
17 #endif
18 #if 0
19 #ifndef RMS$_SUC
20 #include <rmsdef.h>
21 #endif
22 #include <dir.h>
23 #else
24 #define	DIR$S_NAME	80
25 #endif
26 
27 #define DIRBLKSIZ	512		/* size of directory block */
28 #ifdef VMS
29 #define MAXNAMLEN	(DIR$S_NAME + 7) /* 80 plus room for version #.  */
30 #define MAXFULLSPEC	NAM$C_MAXRSS /* Maximum full spec */
31 #else
32 #define MAXNAMLEN	15		/* maximum filename length */
33 #endif /* VMS */
34 	/* NOTE:  MAXNAMLEN must be one less than a multiple of 4 */
35 
36 struct direct				/* data from readdir() */
37 	{
38 	long		d_ino;		/* inode number of entry */
39 	unsigned short	d_reclen;	/* length of this record */
40 	unsigned short	d_namlen;	/* length of string in d_name */
41 	char		d_name[MAXNAMLEN+1];	/* name of file */
42 	};
43 
44 typedef struct
45 	{
46 	int	dd_fd;			/* file descriptor */
47 	int	dd_loc;			/* offset in block */
48 	int	dd_size;		/* amount of valid data */
49 	char	dd_buf[DIRBLKSIZ];	/* directory block */
50 	}	DIR;			/* stream data from opendir() */
51 
52 extern DIR		*vms_opendir();
53 extern struct direct	*vms_readdir();
54 #ifndef VMS
55 extern long		telldir();
56 extern void		seekdir();
57 #endif
58 extern int		vms_closedir();
59 
60 #define rewinddir( dirp )	seekdir( dirp, 0L )
61 
62 #define NDIR_H 1
63 #endif /* ndir.h */
64