aboutsummaryrefslogtreecommitdiffstats
path: root/vms/vms.h
diff options
context:
space:
mode:
authorJohn Malmberg <wb8tyw@qsl.net>2016-02-02 21:29:10 -0600
committerJohn Malmberg <wb8tyw@qsl.net>2016-02-02 21:31:58 -0600
commitafe565753eb654aa1b2280908701e8c0d8e7ccbb (patch)
treefe62520061f61a22fafbe4f28c727912b46653c2 /vms/vms.h
parentea508868203a26ce441d28fc4cbb0dff35ddaab6 (diff)
downloadegawk-afe565753eb654aa1b2280908701e8c0d8e7ccbb.tar.gz
egawk-afe565753eb654aa1b2280908701e8c0d8e7ccbb.tar.bz2
egawk-afe565753eb654aa1b2280908701e8c0d8e7ccbb.zip
Use VMS provided descriptor struct
Diffstat (limited to 'vms/vms.h')
-rw-r--r--vms/vms.h73
1 files changed, 52 insertions, 21 deletions
diff --git a/vms/vms.h b/vms/vms.h
index 3991d39b..43ca837d 100644
--- a/vms/vms.h
+++ b/vms/vms.h
@@ -3,7 +3,7 @@
* Pat Rankin, Nov'89
*/
-#if 0
+#if 1
#include <iodef.h>
#else
#define IO$_WRITEVBLK 48 /* write virtual block */
@@ -11,7 +11,7 @@
#define IO$M_CANCTRLO (1 << IO$V_CANCTRLO)
#endif
-#if 0
+#if 1
#include <clidef.h>
#include <cliverbdef.h>
#include <fscndef.h>
@@ -22,19 +22,26 @@
#define FSCN$_FILESPEC 1
#endif
-#if 0
+#if 1
#include <climsgdef.h>
#else
-#define CLI$_RUNUSED 0x00030000 /* value returned by $CLI for "RUN" */
-#define CLI$_SYNTAX 0x000310FC /* error signalled by CLI$DCL_PARSE */
#define CLI$_INSFPRM 0x00038048 /* insufficient parameters */
#define CLI$_VALREQ 0x00038150 /* missing required value */
#define CLI$_NEGATED 0x000381F8 /* explicitly negated */
#define CLI$_CONFLICT 0x00038258 /* conflicting qualifiers */
#define CLI$_NOOPTPRS 0x00038840 /* no option present */
#endif
+/* Missing in VAX/VMS 7.3 */
+#ifndef CLI$_RUNUSED
+#define CLI$_RUNUSED 0x00030000 /* value returned by $CLI for "RUN" */
+#endif
+/* Missing as of VMS 8.4 */
+#ifndef CLI$_SYNTAX
+#define CLI$_SYNTAX 0x000310FC /* error signalled by CLI$DCL_PARSE */
+#endif
+
-#if 0
+#if 1
#include <psldef.h>
#else
#define PSL$C_USER 3 /* user mode */
@@ -44,36 +51,60 @@
typedef unsigned long U_Long;
typedef unsigned short U_Short;
-typedef struct _dsc { int len; char *adr; } Dsc; /* limited string descriptor */
- /* standard VMS itemlist-3 structure */
+#include <descrip.h>
+#include <stsdef.h>
+
+#pragma member_alignment save
+#pragma nomember_alignment longword
+#pragma message save
+#pragma message disable misalgndmem
typedef struct _itm { U_Short len, code; void *buffer; U_Short *retlen; } Itm;
+#pragma message restore
+#pragma member_alignment restore
+
-#define vmswork(sts) ((sts)&1)
-#define vmsfail(sts) (!vmswork(sts))
+#define vmswork(sts) $VMS_STATUS_SUCCESS(sts)
+#define vmsfail(sts) (!$VMS_STATUS_SUCCESS(sts))
#define CondVal(sts) ((sts)&0x0FFFFFF8) /* strip severity & msg inhibit */
-#define Descrip(strdsc,strbuf) Dsc strdsc = {sizeof strbuf - 1, (char *)strbuf}
+#define Descrip(strdsc,strbuf) struct dsc$descriptor_s \
+ strdsc = {sizeof strbuf - 1, DSC$K_DTYPE_T, DSC$K_CLASS_S, (char *)strbuf}
extern int shell$is_shell(void);
-extern U_Long LIB$FIND_FILE(const Dsc *, Dsc *, void *, ...);
+extern U_Long LIB$FIND_FILE(const struct dsc$descriptor_s *,
+ struct dsc$descriptor_s *, void *, ...);
extern U_Long LIB$FIND_FILE_END(void *);
#ifndef NO_TTY_FWRITE
extern U_Long LIB$GET_EF(long *);
-extern U_Long SYS$ASSIGN(const Dsc *, short *, long, const Dsc *);
+extern U_Long SYS$ASSIGN(const struct dsc$descriptor_s *, short *, long,
+ const struct dsc$descriptor_s *);
extern U_Long SYS$DASSGN(short);
extern U_Long SYS$QIO(U_Long, U_Long, U_Long, void *,
void (*)(U_Long), U_Long,
const char *, int, int, U_Long, int, int);
extern U_Long SYS$SYNCH(long, void *);
#endif /*!NO_TTY_FWRITE*/
-extern U_Long LIB$SPAWN(const Dsc *,const Dsc *,const Dsc *,
- const U_Long *,const Dsc *,U_Long *,U_Long *,...);
+extern U_Long LIB$SPAWN(const struct dsc$descriptor_s *,
+ const struct dsc$descriptor_s *,
+ const struct dsc$descriptor_s *,
+ const U_Long *,
+ const struct dsc$descriptor_s *,
+ U_Long *, U_Long * ,...);
/* system services for logical name manipulation */
-extern U_Long SYS$TRNLNM(const U_Long *,const Dsc *,const Dsc *,
- const unsigned char *,Itm *);
-extern U_Long SYS$CRELNM(const U_Long *,const Dsc *,const Dsc *,
- const unsigned char *,const Itm *);
-extern U_Long SYS$CRELOG(int,const Dsc *,const Dsc *,unsigned char);
-extern U_Long SYS$DELLNM(const Dsc *,const Dsc *,const unsigned char *);
+extern U_Long SYS$TRNLNM(const U_Long *,
+ const struct dsc$descriptor_s *,
+ const struct dsc$descriptor_s *,
+ const unsigned char *, Itm *);
+extern U_Long SYS$CRELNM(const U_Long *,
+ const struct dsc$descriptor_s *,
+ const struct dsc$descriptor_s *,
+ const unsigned char *, const Itm *);
+extern U_Long SYS$CRELOG(int,
+ const struct dsc$descriptor_s *,
+ const struct dsc$descriptor_s *,
+ unsigned char);
+extern U_Long SYS$DELLNM(const struct dsc$descriptor_s *,
+ const struct dsc$descriptor_s *,
+ const unsigned char *);
extern void v_add_arg(int, const char *);
extern void vms_exit(int);