1 /*
2  * Author:	George Carrette, <GJC@MITECH.COM>
3  *
4  * @(#)$Header: /mm2/home/cvs/bc-src/tgif/vms_comp.h,v 1.1 2004/06/18 23:19:10 william Exp $
5  */
6 
7 /* Header file for vms_comp routines, generally useful functions
8    to aid in porting/running Unix and BSD code under VAX/VMS.
9 
10    **  Written by George Carrette, <GJC@MITECH.COM>.
11    **  Includes modified VMS readdir() routines.
12    **  Written by Rich $alz, <rsalz@bbn.com> in August, 1990.
13 
14 To use:
15 
16 #include "vms_comp.h"
17 
18 */
19 #ifndef _VMS_COMP_H_
20 #define _VMS_COMP_H_
21 
22 #include <stdio.h>
23 
24 #ifdef VMS
25 
26 #include <ctype.h>
27 #include <errno.h>
28 #include <descrip.h>
29 #include <string.h>
30 #include <stdlib.h>       /* RN */
31 #include <stat.h>         /* RN */
32 
33 #include <unixio.h>       /* RN */
34 #include <unistd.h>       /* RN */
35 #include <rmsdef.h>
36 #include <ssdef.h>
37 #include <clidef.h>       /* RN */
38 #include <lib$routines.h> /* RN */
39 #include <starlet.h>      /* RN */
40 
41 #if __VMS_VER < 70000000 /* RN */
42 #  define bcopy memmove
43 #  define rindex strrchr
44 #endif
45 
46 #define lstat stat
47 #define unlink delete
48 
49 #ifndef DESCRIP_H_DEFINED
50 #include <descrip.h>
51 #endif
52 
53 int ioctl(int fildes, int request,... /* arg */); /* RN */
54 
55 /* 12-NOV-1990 added d_namlen field -GJC@MITECH.COM */
56 
57     /* Data structure returned by READDIR(). */
58 struct dirent {
59     char	d_name[100];		/* File name		*/
60     int         d_namlen;
61     int		vms_verscount;		/* Number of versions	*/
62     int		vms_versions[20];	/* Version numbers	*/
63 };
64 
65     /* Handle returned by opendir(), used by the other routines.  You
66      * are not supposed to care what's inside this structure. */
67 typedef struct _dirdesc {
68     long			context;
69     int				vms_wantversions;
70     char			*pattern;
71     struct dirent		entry;
72     struct dsc$descriptor_s	pat;
73 } DIR;
74 
75 /* Another name for this? Used by TGIF */
76 
77 struct direct {
78     char	d_name[100];		/* File name		*/
79     int         d_namlen;
80     int		vms_verscount;		/* Number of versions	*/
81     int		vms_versions[20];	/* Version numbers	*/
82 };
83 
84 
85 #define rewinddir(dirp)		seekdir((dirp), 0L)
86 
87 extern DIR		*opendir();
88 extern struct dirent	*readdir();
89 extern long		telldir();
90 extern void		seekdir();
91 extern void		closedir();
92 extern void		vmsreaddirversions();
93 
94 #endif /* VMS */
95 
96 #endif /*_VMS_COMP_H_*/
97