aboutsummaryrefslogtreecommitdiffstats
path: root/vms
diff options
context:
space:
mode:
Diffstat (limited to 'vms')
-rw-r--r--vms/descrip.mms2
-rw-r--r--vms/gawk.hlp53
-rw-r--r--vms/vms_args.c34
-rw-r--r--vms/vms_fwrite.c6
-rw-r--r--vms/vmsbuild.com2
5 files changed, 61 insertions, 36 deletions
diff --git a/vms/descrip.mms b/vms/descrip.mms
index f5872409..6c7910b9 100644
--- a/vms/descrip.mms
+++ b/vms/descrip.mms
@@ -109,7 +109,7 @@ VMSOTHR = $(VMSDIR)Descrip.MMS,$(VMSDIR)vmsbuild.com,$(VMSDIR)version.com,\
# Release of gawk
REL=2.15
-PATCHLVL=5
+PATCHLVL=6
# dummy target to allow building "gawk" in addition to explicit "gawk.exe"
gawk : gawk.exe
diff --git a/vms/gawk.hlp b/vms/gawk.hlp
index c8f4b453..97e0525c 100644
--- a/vms/gawk.hlp
+++ b/vms/gawk.hlp
@@ -2,6 +2,7 @@
! Pat Rankin, Jun'90
! revised, Jun'91
! revised, Jul'92
+! revised, Jan'95
! Online help for GAWK.
!
1 GAWK
@@ -89,6 +90,7 @@
>$vfile create 'vfile' as 'stdout', using RMS attributes appropriate
for a standard text file (variable length records with
implied carriage control)
+ >+bfile create 'bfile' as 'stdout' using binary mode
2>&1 route error messages into the regular output stream
1>&2 send output data to the error destination
<<sentinel error; reading stdin until 'sentinel' not supported
@@ -550,10 +552,10 @@
false (instead of actually re-evaluating it). In this case, the
increment-expression of a for-loop is also skipped.
- 'break' is only allowed within a loop ('for', 'while', or
- 'do-while'). If 'continue' is used outside of a loop, it is
- treated like 'next' (see action-controls). Inside nested loops,
- both 'break' and 'continue' only apply to the innermost loop.
+ Inside nested loops, both 'break' and 'continue' only apply to the
+ innermost loop. When in compatibility mode, 'break' or 'continue'
+ may be used outside of a loop; either will be treated like 'next'
+ (see action-controls).
4 action-controls
There are two special statements for controlling statement execution.
The 'next' statement, when executed, causes the rest of the current
@@ -575,7 +577,8 @@
4 other_statements
The delete statement is used to remove an element from an array.
The syntax is 'delete' keyword followed by array name, followed
- by index value enclosed in square brackets ([]).
+ by index value enclosed in square brackets ([]). Starting with
+ gawk version 2.15.4, 'delete' may also be used on an entire array.
The return statement is used in user-defined functions. The syntax
is the keyword 'return' optionally followed by a string or numeric
@@ -655,13 +658,12 @@
the comma is replaced by SUBSEP and the resulting index
is a concatenation of the values and SUBSEP(s); default
value is "\034"; value may be arbitrary string
- IGNORECASE regular expression matching flag; if true (non-zero)
- matching ignores differences between upper and lower case
- letters; affects the '~' and '!~' operators, the 'index',
- 'match', 'split', 'sub', and 'gsub' functions, and the
- field splitting based on FS; default value is false (0);
- has no effect if GAWK is in strict compatibility mode (via
- the -"W compat" option or /strict)
+ IGNORECASE string and regular expression matching flag; if true
+ (non-zero) matching ignores differences between upper and
+ lower case letters; affects the '~' and '!~' operators,
+ the 'index', 'match', 'split', 'sub', and 'gsub' functions,
+ and the field splitting based on FS; default value is false (0);
+ has no effect if GAWK is in strict compatibility mode
FIELDWIDTHS space or tab separated list of width sizes; takes
precedence over FS when set, but is cleared if FS has a
value assigned to it; [note: the current implementation
@@ -686,6 +688,8 @@
username), ["PATH"] (current default directory), ["HOME"]
(the user's login directory), and "[TERM]" (terminal type
if available) [all info provided by VAXCRTL's environ]
+ ERRNO information about the cause of failure for 'getline' or
+ 'close'; "0" if no such failure has occured.
ARGC number of elements in the ARGV array, counting [0] which is
the program name (ie, "gawk")
ARGV array of command-line arguments (in [0] to [ARGC-1]); the
@@ -696,6 +700,7 @@
can change values of ARGC and ARGV[] during execution in
order to alter which files are processed or which between-
file assignments are made
+ ARGIND current index into ARGV[]
4 arrays
awk supports associative arrays to collect data into tables. Array
elements can be either numeric or string, as can the indices used to
@@ -1050,10 +1055,11 @@
incorporated into the official GNU distribution of version 2.13 in
Spring 1991. (Version 2.12 was never publically released.)
2 release_notes
- GAWK 2.14 tested under VMS V5.5, July, 1992; compatible with VMS
- versions V4.6 and later. Current source code compatible with DEC's
- VAXC v3.x and v2.4 or v2.3; also compiles successfully with GNUC
- (GNU's gcc). VMS POSIX uses c89 and requires VAXC V3.x.
+ GAWK 2.15.6 tested under VAX/VMS V5.5-2, January, 1995; should be
+ compatible with VMS versions V4.6 and later. Current source code
+ compatible with DEC's VAX C v3.x and v2.4, or DEC C v4.x; also
+ compiles successfully with GNU C (GNU's gcc). VMS POSIX uses c89 and
+ requires VAX C V3.x (DEC C might work too, but hasn't been confirmed).
3 AWK_LIBRARY
GAWK uses a built in search path when looking for a program file
specified by the -f option (or the /input qualifier) when that file
@@ -1090,6 +1096,7 @@
Another poor feature without a work-around is that there's no way to
specify "append if possible, create with RMS text attributes if not"
with the current command line I/O redirection. '>>$' isn't supported.
+ Ditto for binary output; '>>+' isn't supported.
4 RS_peculiarities
Changing the record separator to something other than newline ('\n')
will produce anomalous results for ordinary files. For example,
@@ -1139,6 +1146,18 @@
failure. The final exit status will be 1 (VMS success) if 0 is
used, or even (VMS non-success) if non-zero is used.
3 changes
+ Changes between version 2.15.6 and 2.14
+
+ General
+ Many obscure bugs fixed
+ `delete' may operate on an entire array
+ ARGIND and ERRNO builtin variables added
+
+ VMS-specific
+ `>+ file' binary-mode output redirection added
+ /variable=(foo=42) fixed
+ Floating point number formatting improved
+3 prior_changes
Changes between version 2.14 and 2.13.2:
General
@@ -1153,7 +1172,7 @@
Disk I/O throughput enhanced
Pipe emulation improved and incorrect interaction with user-mode
redefinition of SYS$OUTPUT eliminated
-3 prior_changes
+
Changes between version 2.13 and 2.11.1: (2.12 was not released)
General
diff --git a/vms/vms_args.c b/vms/vms_args.c
index c927b9b7..a32e5d0f 100644
--- a/vms/vms_args.c
+++ b/vms/vms_args.c
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 1991-1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -39,6 +39,8 @@
* >$vfile - create 'vfile' as 'stdout', using rms attributes
* appropriate for a standard text file (variable length
* records with implied carriage control)
+ * >+vfile - create 'vfile' as 'stdout' in binary mode (using
+ * variable length records with implied carriage control)
* 2>&1 - special case: direct error messages into output file
* 1>&2 - special case: direct output data to error destination
* <<sentinal - error; reading stdin until 'sentinal' not supported
@@ -76,6 +78,11 @@
* sharing permited, so that others can read our output file to check
* progess. For stream output ('>' or '>>'), sharing is disallowed
* (for performance reasons).
+ *
+ * Sep'94, gawk 2.15.6 [pr]
+ * Add '>+' to force binary mode output, to enable better control
+ * for the user when the output destination is a mailbox or socket.
+ * (ORS = "\r\n" for tcp/ip.) Contributed by Per Steinar Iversen.
*/
#include "awk.h" /* really "../awk.h" */
@@ -158,6 +165,9 @@ vms_arg_fixup( int *pargc, char ***pargv )
else if (*p == '$') /* '>$' => kludge for record format */
rms_rfm = "rfm=var", rms_shr = "shr=get,upi",
rms_mrs = "mrs=32767", p++;
+ else if (*p == '+') /* '>+' => kludge for binary output */
+ out_mode = "wb", rms_rfm = "rfm=var",
+ rms_mrs = "mrs=32767", p++;
else /* '>' => create */
{} /* use default values initialized prior to loop */
p = skipblanks(p);
@@ -244,41 +254,35 @@ ordinary_arg:
/*[ catch 22: we'll also redirect errors encountered doing <in or >out ]*/
if (f_err) { /* define logical name but don't open file */
int len = strlen(f_err);
- if (strncasecmp(f_err, "SYS$OUTPUT", len) == 0
- && (f_err[len] == ':' || f_err[len] == '\0'))
+ if (len >= (sizeof "SYS$OUTPUT" - sizeof "")
+ && strncasecmp(f_err, "SYS$OUTPUT:", len) == 0)
err_to_out_redirect = 1;
else
(void) vms_define("SYS$ERROR", f_err);
}
/* do stdin before stdout, so if we bomb we won't make empty output file */
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=32", "mbf=2");
- if (stdin != NULL)
+ if (freopen(f_in, "r", stdin,
+ "ctx=rec", "shr=get,put,del,upd",
+ "mrs=32767", "mbc=32", "mbf=2"))
(void) vms_define("SYS$INPUT", f_in);
else
fatal("<%s (%s)", f_in, strerror(errno));
}
if (f_out) {
- stdout = freopen(f_out, out_mode, stdout,
- rms_rfm, rms_shr, rms_mrs,
- "rat=cr", "mbc=32", "mbf=2");
- if (stdout != NULL)
+ if (freopen(f_out, out_mode, stdout,
+ rms_rfm, rms_shr, rms_mrs,
+ "rat=cr", "mbc=32", "mbf=2"))
(void) vms_define("SYS$OUTPUT", f_out);
else
fatal(">%s%s (%s)", (*out_mode == 'a' ? ">" : ""),
f_out, strerror(errno));
}
if (err_to_out_redirect) { /* special case for ``2>&1'' construct */
- (void) fclose(stderr);
(void) dup2(1, 2); /* make file 2 (stderr) share file 1 (stdout) */
- stderr = stdout;
(void) vms_define("SYS$ERROR", "SYS$OUTPUT:");
} else if (out_to_err_redirect) { /* ``1>&2'' */
- (void) fclose(stdout);
(void) dup2(2, 1); /* make file 1 (stdout) share file 2 (stderr) */
- stdout = stderr;
(void) vms_define("SYS$OUTPUT", "SYS$ERROR:");
}
diff --git a/vms/vms_fwrite.c b/vms/vms_fwrite.c
index 1cd31e6f..7ca8f5c4 100644
--- a/vms/vms_fwrite.c
+++ b/vms/vms_fwrite.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1991-1993 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1995 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -69,7 +69,9 @@ tty_fwrite( const void *buf, size_t size, size_t number, FILE *file )
short chan;
int file_num, result;
- if (!file || !*file)
+ if (!size || !number)
+ return 0;
+ else if (!file || !*file)
return 0 * (errno = EBADF); /* kludge alert! */
else if (file == prev_file)
file_num = prev_file_num;
diff --git a/vms/vmsbuild.com b/vms/vmsbuild.com
index de01cc74..50d2b5a0 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 = "5"
+$ PATCHLVL = "6"
$!
$! [ remove "/optimize=noinline" for VAX C V2.x or DEC C ]
$! [ add "/standard=VAXC" for DEC C and "/g_float" for Alpha ]