summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:30:13 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 12:30:13 +0300
commit66b0bdd602e952f20fa98f6ce5430cea68d4f598 (patch)
tree0b5f379a44720da132f3bd6a66cd900ca821a9aa /vms
parent61bb57af53ebe916d2db6e3585d4fc7ac1d99b92 (diff)
downloadgawk-66b0bdd602e952f20fa98f6ce5430cea68d4f598.tar.gz
Move to gawk-2.15.4.gawk-2.15.4
Diffstat (limited to 'vms')
-rw-r--r--vms/gawk.cld2
-rw-r--r--vms/vms.h2
-rw-r--r--vms/vms_args.c40
-rw-r--r--vms/vms_fwrite.c2
-rw-r--r--vms/vms_gawk.c23
-rw-r--r--vms/vms_misc.c19
-rw-r--r--vms/vms_popen.c2
-rw-r--r--vms/vmsbuild.com2
8 files changed, 54 insertions, 38 deletions
diff --git a/vms/gawk.cld b/vms/gawk.cld
index 23d4c28a..7ff50dae 100644
--- a/vms/gawk.cld
+++ b/vms/gawk.cld
@@ -9,7 +9,7 @@ define verb GAWK
qualifier input, value(required,list,type=$infile), label=progfile
qualifier commands, value(required), label=program
qualifier field_separator, value(required), label=field_sep
- qualifier reg_expr, value(type=reg_expr_keywords)
+ qualifier reg_expr, value(type=reg_expr_keywords) !(OBSOLETE)
qualifier variables, value(required,list)
qualifier copyright
qualifier version
diff --git a/vms/vms.h b/vms/vms.h
index f2a180a2..4fc16f50 100644
--- a/vms/vms.h
+++ b/vms/vms.h
@@ -50,7 +50,7 @@ typedef struct _itm { u_short len, code; void *buffer; u_short *retlen; } Itm;
#define vmswork(sts) ((sts)&1)
#define vmsfail(sts) (!vmswork(sts))
#define CondVal(sts) ((sts)&0x0FFFFFF8) /* strip severity & msg inhibit */
-#define Descrip(strdsc,strbuf) Dsc strdsc = {sizeof strbuf - 1, strbuf}
+#define Descrip(strdsc,strbuf) Dsc strdsc = {sizeof strbuf - 1, (char *)strbuf}
extern int shell$is_shell P((void));
extern u_long LIB$FIND_FILE P((const Dsc *, Dsc *, void *, ...));
diff --git a/vms/vms_args.c b/vms/vms_args.c
index 1ba179a3..c927b9b7 100644
--- a/vms/vms_args.c
+++ b/vms/vms_args.c
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 1991 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1993 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -97,8 +97,8 @@ static char **v_argv;
void
vms_arg_fixup( int *pargc, char ***pargv )
{
- char *f_in, *f_out, *f_err,
- *out_mode, *rms_opt1, *rms_opt2, *rms_opt3, *rms_opt4;
+ const char *f_in, *f_out, *f_err,
+ *out_mode, *rms_rfm, *rms_shr, *rms_mrs;
char **argv = *pargv;
int i, argc = *pargc;
int err_to_out_redirect = 0, out_to_err_redirect = 0;
@@ -120,9 +120,9 @@ vms_arg_fixup( int *pargc, char ***pargv )
f_in = f_out = f_err = NULL; /* stdio setup (no filenames yet) */
out_mode = "w"; /* default access for stdout */
- rms_opt1 = rms_opt2 = "ctx=stm"; /* ("context = stream") == no-opt */
- rms_opt3 = "shr=nil"; /* no sharing (for '>' output file) */
- rms_opt4 = "mrs=0"; /* maximum record size */
+ rms_rfm = "rfm=stmlf"; /* stream_LF format */
+ rms_shr = "shr=nil"; /* no sharing (for '>' output file) */
+ rms_mrs = "mrs=0"; /* no maximum record size */
for (i = 1; i < argc; i++) {
char *p, *fn;
@@ -156,8 +156,8 @@ vms_arg_fixup( int *pargc, char ***pargv )
else if (*p == '&') /* '>&' => stderr */
is_out = 0, p++;
else if (*p == '$') /* '>$' => kludge for record format */
- rms_opt1 = "rfm=var", rms_opt2 = "rat=cr",
- rms_opt3 = "shr=get", rms_opt4 = "mrs=32767", p++;
+ rms_rfm = "rfm=var", rms_shr = "shr=get,upi",
+ rms_mrs = "mrs=32767", p++;
else /* '>' => create */
{} /* use default values initialized prior to loop */
p = skipblanks(p);
@@ -254,7 +254,7 @@ ordinary_arg:
if (f_in) { /* [re]open file and define logical name */
stdin = freopen(f_in, "r", stdin,
"ctx=rec", "shr=get,put,del,upd",
- "mrs=32767", "mbc=24", "mbf=2");
+ "mrs=32767", "mbc=32", "mbf=2");
if (stdin != NULL)
(void) vms_define("SYS$INPUT", f_in);
else
@@ -262,8 +262,8 @@ ordinary_arg:
}
if (f_out) {
stdout = freopen(f_out, out_mode, stdout,
- rms_opt1, rms_opt2, rms_opt3, rms_opt4,
- "mbc=24", "mbf=2");
+ rms_rfm, rms_shr, rms_mrs,
+ "rat=cr", "mbc=32", "mbf=2");
if (stdout != NULL)
(void) vms_define("SYS$OUTPUT", f_out);
else
@@ -377,19 +377,21 @@ vms_define( const char *log_name, const char *trans_val )
{
Dsc log_dsc;
static Descrip(lnmtable,"LNM$PROCESS_TABLE");
- static long attr = LNM$M_CONFINE;
- static Itm itemlist[] = { {sizeof attr,LNM$_ATTRIBUTES,&attr,0},
- {0,LNM$_STRING,0,0}, {0,0} };
+ static u_long attr = LNM$M_CONFINE;
+ static Itm itemlist[] = { {0,LNM$_STRING,0,0}, {0,0} };
static unsigned char acmode = PSL$C_USER;
+ unsigned len = strlen(log_name);
/* avoid "define SYS$OUTPUT sys$output:" for redundant ">sys$output:" */
- if (strncasecmp(log_name, trans_val, strlen(log_name)) == 0)
+ if (strncasecmp(log_name, trans_val, len) == 0
+ && (trans_val[len] == '\0' || trans_val[len] == ':'))
return 0;
- log_dsc.len = strlen(log_dsc.adr = (char *)log_name);
- itemlist[1].buffer = (char *)trans_val;
- itemlist[1].len = strlen(trans_val);
- return SYS$CRELNM((u_long *)0, &lnmtable, &log_dsc, &acmode, itemlist);
+ log_dsc.adr = (char *)log_name;
+ log_dsc.len = len;
+ itemlist[0].buffer = (char *)trans_val;
+ itemlist[0].len = strlen(trans_val);
+ return SYS$CRELNM(&attr, &lnmtable, &log_dsc, &acmode, itemlist);
}
/* t_strstr -- strstr() substitute; search 'str' for 'sub' */
diff --git a/vms/vms_fwrite.c b/vms/vms_fwrite.c
index 6f2637b3..1cd31e6f 100644
--- a/vms/vms_fwrite.c
+++ b/vms/vms_fwrite.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1991 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1993 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
diff --git a/vms/vms_gawk.c b/vms/vms_gawk.c
index 0d826a49..69c91134 100644
--- a/vms/vms_gawk.c
+++ b/vms/vms_gawk.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1991 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1993 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -101,6 +101,7 @@ vms_gawk()
misc_argp = misc_args;
*misc_argp++ = '-'; /* now points at &misc_args[1] */
+#if 0 /* as of 2.12, -a and -e are obsolete */
if (Present("REG_EXPR")) {
if (Present("REG_EXPR.AWK")) /* /reg_exp=awk -> -a */
*misc_argp++ = 'a';
@@ -108,6 +109,7 @@ vms_gawk()
|| Present("REG_EXPR.POSIX")) /* /reg_exp=posix -> -e */
*misc_argp++ = 'e';
}
+#endif /* 0 */
#if 0 /* gawk 2.11.1 */
if (Present("STRICT")) /* /strict -> -c */
*misc_argp++ = 'c';
@@ -179,24 +181,25 @@ vms_gawk()
static int /* note: doesn't return anything; allows 'return vms_usage()' */
vms_usage( int complaint )
{
-static char
- *usage_txt = "\n\
+ static const char
+ *usage_txt = "\n\
usage: %s /COMMANDS=\"awk program text\" data_file[,data_file,...] \n\
or %s /INPUT=awk_file data_file[,\"Var=value\",data_file,...] \n\
or %s /INPUT=(awk_file1,awk_file2,...) data_file[,...] \n\
-", *options_txt = "\n\
+",
+ *options_txt = "\n\
options: /FIELD_SEPARATOR=\"FS_value\" \n\
- /VARIABLES=(\"Var1=value1\",\"Var2=value2\",...) \n\
- - /REG_EXPR= AWK or EGREP or POSIX \n\
- /LINT /POSIX /[NO]STRICT /VERSION /COPYRIGHT /USAGE \n\
- /OUTPUT=out_file \n\
-", *no_prog = "missing required element: /COMMANDS or /INPUT",
- *no_file = "missing required element: data_file \n\
+",
+ *no_prog = "missing required element: /COMMANDS or /INPUT",
+ *no_file = "missing required element: data_file \n\
(use \"SYS$INPUT:\" to read data lines from the terminal)",
- *bad_combo = "invalid combination of qualifiers \n\
+ *bad_combo = "invalid combination of qualifiers \n\
(/INPUT=awk_file and /COMMANDS=\"awk program\" are mutually exclusive)",
- *run_used = "\"RUN\" was used; required command components missing";
-int status, argc;
+ *run_used = "\"RUN\" was used; required command components missing";
+ int status, argc;
fflush(stdout);
switch (complaint) {
diff --git a/vms/vms_misc.c b/vms/vms_misc.c
index 35be9cc7..31c24ed7 100644
--- a/vms/vms_misc.c
+++ b/vms/vms_misc.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1991 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1993 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -30,6 +30,7 @@
#ifndef O_RDONLY
#include <fcntl.h>
#endif
+#include <rmsdef.h>
#include <ssdef.h>
#include <stsdef.h>
@@ -114,8 +115,10 @@ extern int open P((const char *,int,unsigned,...));
int
vms_open( const char *name, int mode, ... )
{
+ int result;
+
if (mode == (O_WRONLY|O_CREAT|O_TRUNC))
- return creat(name, 0, "shr=nil", "mbc=24");
+ result = creat(name, 0, "shr=nil", "mbc=32");
else {
struct stat stb;
const char *mbc, *shr = "shr=get";
@@ -123,11 +126,19 @@ vms_open( const char *name, int mode, ... )
if (stat((char *)name, &stb) < 0) { /* assume DECnet */
mbc = "mbc=8";
} else { /* ordinary file; allow full sharing iff record format */
- mbc = "mbc=12";
+ mbc = "mbc=32";
if (stb.st_fab_rfm < FAB$C_STM) shr = "shr=get,put,upd";
}
- return open(name, mode, 0, shr, mbc, "mbf=2");
+ result = open(name, mode, 0, shr, mbc, "mbf=2");
}
+
+ /* This is only approximate; the ACP -> RMS -> VAXCRTL interface
+ discards too much potentially useful status information... */
+ if (result < 0 && errno == EVMSERR
+ && (vaxc$errno == RMS$_ACC || vaxc$errno == RMS$_CRE))
+ errno = EMFILE; /* redirect() should close 1 file & try again */
+
+ return result;
}
/*
diff --git a/vms/vms_popen.c b/vms/vms_popen.c
index b962d01d..5c9c1a05 100644
--- a/vms/vms_popen.c
+++ b/vms/vms_popen.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1991 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1993 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
diff --git a/vms/vmsbuild.com b/vms/vmsbuild.com
index 1504ce55..d255fe15 100644
--- a/vms/vmsbuild.com
+++ b/vms/vmsbuild.com
@@ -5,7 +5,7 @@ $! gawk 2.14 revised, Sep'92
$! gawk 2.15 revised, Oct'93
$!
$ REL = "2.15" !release version number
-$ PATCHLVL = "3"
+$ PATCHLVL = "4"
$!
$! [ remove "/optimize=noinline" for VAX C V2.x or DEC C ]
$! [ add "/standard=VAXC" for DEC C and "/g_float" for Alpha ]