1 | /*
|
---|
2 | * vms.h - miscellaneous definitions for use with VMS system services.
|
---|
3 | * Pat Rankin, Nov'89
|
---|
4 | */
|
---|
5 |
|
---|
6 | #if 0
|
---|
7 | #include <iodef.h>
|
---|
8 | #else
|
---|
9 | #define IO$_WRITEVBLK 48 /* write virtual block */
|
---|
10 | #define IO$V_CANCTRLO 6 /* cancel <ctrl/O> (ie, resume tty output) */
|
---|
11 | #define IO$M_CANCTRLO (1 << IO$V_CANCTRLO)
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | #if 0
|
---|
15 | #include <clidef.h>
|
---|
16 | #include <cliverbdef.h>
|
---|
17 | #include <fscndef.h>
|
---|
18 | #else
|
---|
19 | #define CLI$K_GETCMD 1
|
---|
20 | #define CLI$K_VERB_MCR 33
|
---|
21 | #define CLI$K_VERB_RUN 36
|
---|
22 | #define FSCN$_FILESPEC 1
|
---|
23 | #endif
|
---|
24 |
|
---|
25 | #if 0
|
---|
26 | #include <climsgdef.h>
|
---|
27 | #else
|
---|
28 | #define CLI$_RUNUSED 0x00030000 /* value returned by $CLI for "RUN" */
|
---|
29 | #define CLI$_SYNTAX 0x000310FC /* error signalled by CLI$DCL_PARSE */
|
---|
30 | #define CLI$_INSFPRM 0x00038048 /* insufficient parameters */
|
---|
31 | #define CLI$_VALREQ 0x00038150 /* missing required value */
|
---|
32 | #define CLI$_CONFLICT 0x00038258 /* conflicting qualifiers */
|
---|
33 | #define CLI$_NOOPTPRS 0x00038840 /* no option present */
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | #if 0
|
---|
37 | #include <psldef.h>
|
---|
38 | #else
|
---|
39 | #define PSL$C_USER 3 /* user mode */
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | /* note: `ulong' and `u_long' end up conflicting with various header files */
|
---|
43 | typedef unsigned long U_Long;
|
---|
44 | typedef unsigned short U_Short;
|
---|
45 |
|
---|
46 | typedef struct _dsc { int len; char *adr; } Dsc; /* limited string descriptor */
|
---|
47 | /* standard VMS itemlist-3 structure */
|
---|
48 | typedef struct _itm { U_Short len, code; void *buffer; U_Short *retlen; } Itm;
|
---|
49 |
|
---|
50 | #define vmswork(sts) ((sts)&1)
|
---|
51 | #define vmsfail(sts) (!vmswork(sts))
|
---|
52 | #define CondVal(sts) ((sts)&0x0FFFFFF8) /* strip severity & msg inhibit */
|
---|
53 | #define Descrip(strdsc,strbuf) Dsc strdsc = {sizeof strbuf - 1, (char *)strbuf}
|
---|
54 |
|
---|
55 | extern int shell$is_shell P((void));
|
---|
56 | extern U_Long lib$find_file P((const Dsc *, Dsc *, void *, ...));
|
---|
57 | extern U_Long lib$find_file_end P((void *));
|
---|
58 | #ifndef NO_TTY_FWRITE
|
---|
59 | extern U_Long lib$get_ef P((long *));
|
---|
60 | extern U_Long sys$assign P((const Dsc *, short *, long, const Dsc *));
|
---|
61 | extern U_Long sys$dassgn P((short));
|
---|
62 | extern U_Long sys$qio P((U_Long, U_Long, U_Long, void *,
|
---|
63 | void (*)(U_Long), U_Long,
|
---|
64 | const char *, int, int, U_Long, int, int));
|
---|
65 | extern U_Long sys$synch P((long, void *));
|
---|
66 | #endif /*!NO_TTY_FWRITE*/
|
---|
67 | extern U_Long lib$spawn P((const Dsc *,const Dsc *,const Dsc *,
|
---|
68 | const U_Long *,const Dsc *,U_Long *,U_Long *,...));
|
---|
69 | /* system services for logical name manipulation */
|
---|
70 | extern U_Long sys$trnlnm P((const U_Long *,const Dsc *,const Dsc *,
|
---|
71 | const unsigned char *,Itm *));
|
---|
72 | extern U_Long sys$crelnm P((const U_Long *,const Dsc *,const Dsc *,
|
---|
73 | const unsigned char *,const Itm *));
|
---|
74 | extern U_Long sys$crelog P((int,const Dsc *,const Dsc *,unsigned char));
|
---|
75 | extern U_Long sys$dellnm P((const Dsc *,const Dsc *,const unsigned char *));
|
---|
76 |
|
---|
77 | extern void v_add_arg P((int, const char *));
|
---|
78 | extern void vms_exit P((int));
|
---|
79 | extern char *vms_strerror P((int));
|
---|
80 | extern char *vms_strdup P((const char *));
|
---|
81 | extern int vms_devopen P((const char *,int));
|
---|
82 | extern int vms_execute P((const char *, const char *, const char *));
|
---|
83 | extern int vms_gawk P((void));
|
---|
84 | extern U_Long Cli_Present P((const char *));
|
---|
85 | extern U_Long Cli_Get_Value P((const char *, char *, int));
|
---|
86 | extern U_Long Cli_Parse_Command P((const void *, const char *));
|
---|
87 |
|
---|