diff options
Diffstat (limited to 'vms')
-rw-r--r-- | vms/ChangeLog | 67 | ||||
-rw-r--r-- | vms/descrip.mms | 42 | ||||
-rw-r--r-- | vms/gawk.hlp | 125 | ||||
-rw-r--r-- | vms/redirect.h | 7 | ||||
-rw-r--r-- | vms/vms_args.c | 43 | ||||
-rw-r--r-- | vms/vms_fwrite.c | 39 | ||||
-rw-r--r-- | vms/vms_gawk.c | 40 | ||||
-rw-r--r-- | vms/vms_misc.c | 51 | ||||
-rw-r--r-- | vms/vms_popen.c | 41 | ||||
-rw-r--r-- | vms/vmsbuild.com | 2 | ||||
-rw-r--r-- | vms/vmstest.com | 163 |
11 files changed, 436 insertions, 184 deletions
diff --git a/vms/ChangeLog b/vms/ChangeLog index d8992bb4..2d19a8d3 100644 --- a/vms/ChangeLog +++ b/vms/ChangeLog @@ -1,3 +1,70 @@ +Thu May 15 12:49:08 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us> + + * Release 3.0.3: Release tar file made. + +Mon May 12 18:39:30 1997 Pat Rankin <rankin@eql.caltech.edu> + + * vmstest.com (delarprm, prdupval): new `basic' tests. + (nondec): new `gawk.extensions' test (commented out for now). + (reint): move from `basic' to `gawk.extensions'. + +Mon May 5 21:40:07 1997 Pat Rankin <rankin@eql.caltech.edu> + + * vmstest.com (clobber): new `basic' test. + (pid): new test, replacing `specfile'. + (pipeio2): new for `unix-tests'; can't execute this one under VMS. + +Mon May 5 21:23:52 1997 Pat Rankin <rankin@eql.caltech.edu> + + * vms_args.c (vms_arg_fixup): for the 2>&1 case, don't set the + output filename to "sys$error" because that results in an extra + empty file being created. + + * vms_misc.c (vms_open): explicitly specify stream_lf format + when creating files rather than letting DECC$SHR make a new file + inherit its record format from any earlier version of that file. + + Suggested by Pete Cascio <pete@rmi.net>: + + * vms_misc.c (vms_open): use full record sharing options when + reading any record-oriented file, regardless of its organization. + +Mon Apr 21 19:22:12 1997 Pat Rankin <rankin@eql.caltech.edu> + + * vmstest.com (funstack): new `basic' test. + (reint): add missing entry to `basic'. + (pipeio1, specfile, strftlng): move from `basic' to `unix-tests'. + (childin): skip due to known failure. + (specfile): skip due to potentially confusing feedback. + +Thu Apr 24 23:18:04 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us> + + * vms_popen.c, vms_misc.c, vms_gawk.c, vms_fwrite.c, + vms_args.c: moved to generic GPL statement at top. + +Fri Apr 18 07:55:47 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us> + + * BETA Release 3.0.34: Release tar file made. + +Wed Apr 2 18:17:30 1997 Pat Rankin <rankin@eql.caltech.edu> + + * descrip.mms, vmsbuild.com (PATCHLVL): update to 3. + + * vmstest.com (nlfldsep, splitvar, intest, nfldstr, nors, + fnarydel, noparms, pipeio1): new tests. + +Wed Jan 15 15:21:01 1997 Pat Rankin <rankin@eql.caltech.edu> + + * redirect.h (stat, fstat): do not declare these functions; + rely on <stat.h> to do so. There are too many DEC C version + variants to handle otherwise. + + From Martin Zinser <zinser@axp602.gsi.de>: + + * descrip.mms (gawk.dvi): update to build in [.doc] directory + using texindex.c retained from an earlier gawk 2.x distribution. + (texindex.exe): don't assume VAX C. + Wed Dec 25 11:25:22 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us> * Release 3.0.2: Release tar file made. diff --git a/vms/descrip.mms b/vms/descrip.mms index f5de76f3..ec00eb9a 100644 --- a/vms/descrip.mms +++ b/vms/descrip.mms @@ -31,6 +31,7 @@ # If you have TeX, you can make the target 'gawk.dvi' to process # _The_GAWK_Manual_ from gawk.texi. You'll need to use a device # specific post-processor on gawk.dvi in order to get printable data. +# The full output is approximately 325 pages. # # location of various source files, relative to the 'main' directory @@ -128,7 +129,7 @@ DOCS= $(DOCDIR)gawk.1,$(DOCDIR)gawk.texi,$(DOCDIR)texinfo.tex # Release of gawk REL=3.0 -PATCHLVL=1 +PATCHLVL=3 # generic target all : gawk @@ -207,37 +208,46 @@ clean : - delete *.obj;*,gawk.opt;* spotless : clean tidy - - delete gawk.dvi;*,gawk.exe;*,[.support]texindex.exe;* + - if f$search("gawk.exe").nes."" then delete gawk.exe;* + - if f$search("gawk.dvi").nes."" then delete gawk.dvi;* + - if f$search("[.doc]texindex.exe").nes."" then delete [.doc]texindex.exe;* # -# note: this is completely out of date +# Note: this only works if you kept a copy of [.support]texindex.c +# from a gawk 2.x distribution and put it into [.doc]texindex.c. +# Also, depending on the fonts available with the version of TeX +# you have, you might need to edit [.doc]texinfo.tex and change +# the reference to "lcircle10" to be "circle10". # -# build gawk.dvi from within the 'support' subdirectory +# build gawk.dvi from within the 'doc' subdirectory # -gawk.dvi : [.support]texindex.exe gawk.texi - @ set default [.support] +gawk.dvi : [.doc]texindex.exe [.doc]gawk.texi + @ set default [.doc] @ write sys$output " Warnings from TeX are expected during the first pass" - TeX [-]gawk.texi + TeX gawk.texi mcr []texindex gawk.cp gawk.fn gawk.ky gawk.pg gawk.tp gawk.vr @ write sys$output " Second pass" - TeX [-]gawk.texi + TeX gawk.texi mcr []texindex gawk.cp gawk.fn gawk.ky gawk.pg gawk.tp gawk.vr @ write sys$output " Third (final) pass" - TeX [-]gawk.texi + TeX gawk.texi -@ purge -@ delete gawk.lis;,.aux;,gawk.%%;,.cps;,.fns;,.kys;,.pgs;,.toc;,.tps;,.vrs; @ rename/new_vers gawk.dvi [-]*.* @ set default [-] +# Note: [.doc]texindex.c is not included with the gawk 3.x distribution. +# Expect lots of "implicitly declared function" diagnostics from DEC C. # -# note: besides being out of date, this assumes VAX C -# - -[.support]texindex.exe : [.support]texindex.c - @ set default [.support] +[.doc]texindex.exe : [.doc]texindex.c + @ set default [.doc] $(CC) /noOpt/noList/Define=("lines=tlines") texindex.c - $(LINK) /noMap texindex.obj,sys$library:vaxcrtl.olb/Lib - -@ delete texindex.obj;* + @ open/Write opt texindex.opt + @ write opt "texindex.obj" + @ write opt "$(LIBS)" + @ close opt + $(LINK) /noMap/Exe=texindex.exe texindex.opt/Options + -@ delete texindex.obj;*,texindex.opt;* @ set default [-] #eof diff --git a/vms/gawk.hlp b/vms/gawk.hlp index 97e0525c..9a3f2269 100644 --- a/vms/gawk.hlp +++ b/vms/gawk.hlp @@ -3,6 +3,7 @@ ! revised, Jun'91 ! revised, Jul'92 ! revised, Jan'95 +! revised, Apr'97 ! Online help for GAWK. ! 1 GAWK @@ -47,8 +48,13 @@ and get the behavior of UN*X awk. -W copyright [or -W copyleft] display an abbreviated version of the GNU copyright information + -W help list command line options (same as -W usage) -W lint warn about suspect or non-portable awk program code + -W lint-old warn about constructs not available in original awk -W posix compatibility mode with additional restrictions + -W re-interval evaluate '{' and '}' as intervals in regular expressions + -W traditional suppress POSIX and GNU regular expression extensions + -W usage list command line options (same as -W help) -W version display program version number -- don't check further arguments for leading dash 3 program_text @@ -111,6 +117,9 @@ are used as wildcards in filenames. '*' and '%' have their usual VMS meanings of multiple character and single character wildcards, respectively, and '?' is also treated as a single character wildcard. + Wildcard expansion only works for filenames specified in native VMS + filename syntax (eg, "[-.sibling]*"), not for ones specified pseudo- + Unix syntax (eg, "../sibling/*"). When a command line argument that should be a filename contains any of the wildcard characters, a directory lookup is attempted for files @@ -223,7 +232,7 @@ Print a brief version of GAWK's copyright notice. /USAGE - /USAGE (no corresponding GNU_syntax option) + /USAGE (comparable to -"W usage" or -"W help" option) Print a compact summary of the command line options. @@ -440,6 +449,15 @@ and/or a through e) digits; if more than two digits follow, the result is undefined; not recognized if POSIX compatibility mode is specified. + + When a regular expression is represented in string form ("regex" + as opposed to /regex/), backslashes need to be paired. The first + one quotes the second during string processing, and the second one + remains to be used to quote whatever follows in regular expression + processing. For example, to match variable `xxx' against a period + character, use (xxx ~ "\\.") or (xxx ~ /\./); if you tried to use + (xxx ~ "\."), after string processing it would operate as (xxx ~ /./) + and end up matching any single character rather than just a period. 3 statements A statement refers to a unit of instruction found in the action part of an awk rule, and also found in the definition of a function. @@ -577,8 +595,9 @@ 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 ([]). Starting with - gawk version 2.15.4, 'delete' may also be used on an entire array. + by index value enclosed in square brackets ([]). 'delete' may + also used on an array name, without any index specified, to delete + all its elements in a single operation. The return statement is used in user-defined functions. The syntax is the keyword 'return' optionally followed by a string or numeric @@ -640,9 +659,7 @@ the -F option (or /field_separator); the value can be a regular expression RS input record separator; default value is a newline ("\n"); - only a single character is allowed [no regular expressions - or multi-character strings; expected to be remedied in a - future release of gawk] + the value can be multiple characters or a regular expression OFS output field separator; value to place between variables in a 'print' statement; default is one space; can be arbitrary string @@ -651,8 +668,10 @@ string OFMT default output format used for printing numbers; default value is "%.6g" - CONVFMT conversion format used for string-to-number conversions; - default value is also "%.6g", like OFMT + CONVFMT conversion format used for number-to-string conversions; + default value is also "%.6g", like OFMT; not used when the + number has a value which may be represented internally as + an exact integer (typically within -2147483648 to 2147483647) SUBSEP subscript separator for array indices; used when an array subscript is specified as a comma separated list of values: the comma is replaced by SUBSEP and the resulting index @@ -662,7 +681,7 @@ (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); + and 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 @@ -676,6 +695,8 @@ input file is processed by the same program) FNR current record number of the current input file; reset to 0 each time an input file is completed + RT record terminator, the input text which matched RS; not + available when the `-W traditional' option is used RSTART starting position of substring matched by last invocation of the 'match' function; set to 0 if a match fails and at the start of each input record @@ -687,7 +708,7 @@ implementation of GAWK provides values for ["USER"] (the username), ["PATH"] (current default directory), ["HOME"] (the user's login directory), and "[TERM]" (terminal type - if available) [all info provided by VAXCRTL's environ] + if available) [all info provided by C RTL'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 @@ -723,8 +744,11 @@ or 0 otherwise. To remove an element from an array, use the 'delete' statement delete Array[Index] - Note: there is no way to delete an ordinary variable or an entire - array; 'delete' only works on a specific array element. + To remove all array elements at once, use + delete Array + Note: the latter is a gawk extension; also, there is no way to + delete an ordinary variable or an entire array; 'delete' only works + on array elements. To process all elements of an array (in succession) when their subscripts might be unknown, use the 'in' variant of the for-loop @@ -800,6 +824,15 @@ gsub(r,t,s) similar to sub(), but gsub() replaces all nonoverlapping substrings instead of just the first, and the return value is the number of substitutions made + gensub(r,t,n,s) search string s ($0 if omitted) for regexp r and + replace the n'th occurrence with substring t; the + result is the new string and s (or $0) remains + unchanged; if n begins with letter "g" or "G" then + all matches are replaced instead of just the n'th; + if r has parenthesized subexpressions in it, t may + contain the special sequences \\0, \\1, through \\9 + which expand into the value of the corresponding + subexpression; this function is a gawk extension substr(s,p,l) extract a substring l characters long starting at offset p in string s; l is optional, if omitted then the remainder of the string (p thru end) is returned @@ -879,6 +912,9 @@ close(s) close a file or pipe specified by the string s; the string used should have the same value as the one used in a getline or print/printf redirection + fflush(s) flush output stream s; if s is omitted, stdout is + flushed; if it is specified but its value is an + empty string, all output streams are flushed system(s) pass string s to executed by the operating system; the command string is executed in a subprocess 5 redirection @@ -955,9 +991,15 @@ g 'fractional' number in either 'e' or 'f' format, whichever produces shorter result - Three optional modifiers can be placed between the initiating + Several optional modifiers can be placed between the initiating percent sign and the format character (doesn't apply to %%). - left justify (only matters when width specifier is present) + (space) for numeric specifiers, prefix nonnegative values with + a space and negative values with a minus sign + + for numeric specifiers, prefix nonnegative values with a plus + sign and negative values with a minus sign + # alternate form applicable to several of the format characters + (o, x, X, e, E, f, g, G) NN width ['NN' represents 1 or more decimal digits]; actually minimum width to use, longer items will not be truncated; a leading 0 will cause right-justified numbers to be padded on @@ -1002,7 +1044,9 @@ first character of the set is '^', then the sense of match is reversed: [^0-9] matches any non-digit; several characters need to be quoted with backslash (\) if they - occur in a set: '\', ']', '-', and '^' + occur in a set: '\', ']', '-', and '^'; within sets, + various special character class designations are recognized, + such as [:digit:] and [:punct:], as per POSIX | alternation (similar to boolean 'or'); match either of two patterns [for example "^start|stop$" matches leading 'start' or trailing 'stop'] @@ -1018,8 +1062,13 @@ ? optional matching; indicates that the pattern can match zero or one times ["[a-z][0-9]?" matches lower case letter alone or followed by a single digit] + { } interval specification; {n} to match n times or {m,n} to match + at least m but not more than n times; only functional when + either the `-W posix' or `-W re-interval' options are used \ quote; prevent the character which follows from having special - meaning + meaning; if the regexp is specified as a string, then the + backslash itself will need to be quoted by preceding it with + another backslash A regular expression which matches a string or line will match against the first (left-most) substring which meets the pattern and include @@ -1030,16 +1079,21 @@ explanation of what an awk program is doing and also who wrote it and when. 3 further_information - For complete documentation on GAWK, see "The_GAWK_Manual" from FSF. - Source text for it is present in the file GAWK.TEXINFO. A postscript + For complete documentation on GAWK, see "Effective AWK Programming" + by Arnold Robbins. The second edition (ISBN 1-57831-000-8) is jointly + published by SSC and the FSF (http://www.ssc.com). + + Source text for it is present in the file GAWK.TEXI. A postscript version is available via anonymous FTP from host prep.ai.mit.edu in - directory pub/gnu/. + directory pub/gnu/, file gawk-{version}-doc.tar.gz where {version} + would be the current version number, such as 3.0.3. + + Another source of documentation is "The AWK Programming Language" + by Aho, Weinberger, and Kernighan (1988), published by Addison-Wesley. + ISBN code is 0-201-07981-X. - For additional documentation on awk--above and beyond that provided in - The_GAWK_Manual--see "The_AWK_Programming_Language" by Aho, Weinberger, - and Kernighan (2nd edition, 1988), published by Addison-Wesley. It is - both a reference on the awk language and a tutorial on awk's use, with - many sample programs. + Each of these works contains both a reference on the awk language + and a tutorial on awk's use, with many sample programs. 3 authors The awk programming language was originally created by Alfred V. Aho, Peter J. Weinberger, and Brian W. Kernighan in 1977. The language @@ -1049,17 +1103,17 @@ and Jay Fenlason, with advice from Richard Stallman, and with contributions from John Woods. In 1988 and 1989, David Trueman and Arnold Robbins revised GAWK for compatibility with the newer awk. + Arnold Robbins is the current maintainer. GAWK version 2.11.1 was ported to VMS by Pat Rankin in November, 1989, with further revisions in the Spring of 1990. The VMS port was 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.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). + GAWK 3.0.3 tested under VAX/VMS V6.2 and Alpha/VMS V6.2, April, 1997; + should be compatible with VMS versions V4.6 and later. Current source + code is compatible with DEC's DEC C v5.x or VAX C v3.2; also compiles + successfully with GNU C (tested with gcc-vms 2.7.1). 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 @@ -1146,6 +1200,19 @@ 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 3.0.3 and 2.15.6 + + General + RS can contain multiple characters or be a regexp + Regular expression interval support added + gensub() and fflush() functions added + memory leak(s) introduced in 3.0.2 or 3.0.1 fixed + the user manual has been substantially revised + + VMS-specific + Switched to build with DEC C by default + +3 prior_changes Changes between version 2.15.6 and 2.14 General @@ -1157,7 +1224,7 @@ `>+ 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 diff --git a/vms/redirect.h b/vms/redirect.h index 18659b5e..294dba7f 100644 --- a/vms/redirect.h +++ b/vms/redirect.h @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 1986, 88, 89, 91-93, 1996 the Free Software Foundation, Inc. + * Copyright (C) 1986, 88, 89, 91-93, 1996, 1997 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -99,11 +99,6 @@ extern int close P((int)); extern int dup P((int)); extern int dup2 P((int, int)); extern int read P((int, void *, int)); -#if defined(__DECC) && !defined(__CAN_USE_EXTERN_PREFIX) -struct stat; -extern int fstat P((int, struct stat *)); -extern int stat P((const char *, struct stat *)); -#endif extern int getpgrp P((void)); #endif /* not VMS_POSIX and not IN_CONFIG_H */ diff --git a/vms/vms_args.c b/vms/vms_args.c index 5371dfb8..fbe50ff6 100644 --- a/vms/vms_args.c +++ b/vms/vms_args.c @@ -1,28 +1,21 @@ -/* - * vms_args.c -- command line parsing, to emulate shell i/o redirection. - * [ Escape sequence parsing now suppressed. ] - */ +/* vms_args.c -- command line parsing, to emulate shell i/o redirection. + [ Escape sequence parsing now suppressed. ] -/* - * Copyright (C) 1991-1996 the Free Software Foundation, Inc. - * - * This file is part of GAWK, the GNU implementation of the - * AWK Programming Language. - * - * GAWK is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * GAWK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ + Copyright (C) 1991-1996, 1997 the Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * [.vms]vms_arg_fixup - emulate shell's command line processing: handle @@ -206,7 +199,7 @@ vms_arg_fixup( int *pargc, char ***pargv ) fatal("conflicting specifications for stdout"); else { out_to_err_redirect = 1; - f_out = "SYS$ERROR:"; + /* f_out = "SYS$ERROR:"; */ } break; case '|': /* pipe */ /* command pipelines are not supported */ diff --git a/vms/vms_fwrite.c b/vms/vms_fwrite.c index 8f0ebcab..496ef3dc 100644 --- a/vms/vms_fwrite.c +++ b/vms/vms_fwrite.c @@ -1,27 +1,20 @@ -/* - * vms_fwrite.c - augmentation for the fwrite() function. - */ +/* vms_fwrite.c - augmentation for the fwrite() function. -/* - * Copyright (C) 1991-1996 the Free Software Foundation, Inc. - * - * This file is part of GAWK, the GNU implementation of the - * AWK Programming Language. - * - * GAWK is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * GAWK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ + Copyright (C) 1991-1996 the Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "awk.h" /* really "../awk.h" */ diff --git a/vms/vms_gawk.c b/vms/vms_gawk.c index d98bb801..e021b375 100644 --- a/vms/vms_gawk.c +++ b/vms/vms_gawk.c @@ -1,27 +1,21 @@ -/* - * vms_gawk.c -- parse GAWK command line using DCL syntax - */ +/* vms_gawk.c -- parse GAWK command line using DCL syntax -/* - * Copyright (C) 1991-1993, 1996 the Free Software Foundation, Inc. - * - * This file is part of GAWK, the GNU implementation of the - * AWK Programming Language. - * - * GAWK is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * GAWK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ + Copyright (C) 1991-1993, 1996 the Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + /* * vms_gawk.c - routines to parse the command line as a native DCL command diff --git a/vms/vms_misc.c b/vms/vms_misc.c index 8e12c154..1b1a2239 100644 --- a/vms/vms_misc.c +++ b/vms/vms_misc.c @@ -1,27 +1,20 @@ -/* - * vms_misc.c -- sustitute code for missing/different run-time library routines. - */ +/* vms_misc.c -- sustitute code for missing/different run-time library routines. -/* - * Copyright (C) 1991-1993, 1996 the Free Software Foundation, Inc. - * - * This file is part of GAWK, the GNU implementation of the - * AWK Programming Language. - * - * GAWK is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * GAWK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ + Copyright (C) 1991-1993, 1996, 1997 the Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define creat creat_dummy /* one of gcc-vms's headers has bad prototype */ #include "awk.h" @@ -118,17 +111,19 @@ vms_open( const char *name, int mode, ... ) { int result; - if (mode == (O_WRONLY|O_CREAT|O_TRUNC)) - result = creat(name, 0, "shr=nil", "mbc=32"); - else { + if (mode == (O_WRONLY|O_CREAT|O_TRUNC)) { + /* explicitly force stream_lf record format to override DECC$SHR's + defaulting of RFM to earlier file version's when one is present */ + result = creat(name, 0, "rfm=stmlf", "shr=nil", "mbc=32"); + } else { struct stat stb; - const char *mbc, *shr = "shr=get"; + const char *mbc, *shr = "shr=get", *ctx = "ctx=stm"; if (stat((char *)name, &stb) < 0) { /* assume DECnet */ mbc = "mbc=8"; } else { /* ordinary file; allow full sharing iff record format */ mbc = "mbc=32"; - if (stb.st_fab_rfm < FAB$C_STM) shr = "shr=get,put,upd"; + if ((stb.st_fab_rfm & 0x0F) < FAB$C_STM) shr = "shr=get,put,upd"; } result = open(name, mode, 0, shr, mbc, "mbf=2"); } diff --git a/vms/vms_popen.c b/vms/vms_popen.c index e5829442..cfc5ecfc 100644 --- a/vms/vms_popen.c +++ b/vms/vms_popen.c @@ -1,27 +1,20 @@ -/* - * [.vms]vms_popen.c -- substitute routines for missing pipe calls. - */ - -/* - * Copyright (C) 1991-1993, 1996 the Free Software Foundation, Inc. - * - * This file is part of GAWK, the GNU implementation of the - * AWK Programming Language. - * - * GAWK is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * GAWK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ +/* [.vms]vms_popen.c -- substitute routines for missing pipe calls. + + Copyright (C) 1991-1993, 1996 the Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef NO_VMS_PIPES diff --git a/vms/vmsbuild.com b/vms/vmsbuild.com index 04a54792..477bf4d2 100644 --- a/vms/vmsbuild.com +++ b/vms/vmsbuild.com @@ -7,7 +7,7 @@ $! gawk 3.0 revised, Dec'95 $! gawk 3.0.1 revised, Nov'96 $! $ REL = "3.0" !release version number -$ PATCHLVL = "1" +$ PATCHLVL = "3" $! $! $ CCFLAGS = "/noList" ! "/noOpt/Debug" diff --git a/vms/vmstest.com b/vms/vmstest.com index 59a3cd67..d6e652d4 100644 --- a/vms/vmstest.com +++ b/vms/vmstest.com @@ -31,7 +31,7 @@ $ if bigtest_test.nes." " then gosub 'bigtest_test' $ if bigtest_list.nes."" then goto bigtest_loop $ return $ -$basic: basic_list = "msg swaplns messages argarray longwrds" - +$basic: basic_lst1 = "msg swaplns messages argarray longwrds" - + " getline fstabplus compare arrayref rs fsrs rand" - + " fsbs negexp asgext anchgsub splitargv awkpath nfset" - + " reparse convfmt arrayparm paramdup nonl defref" - @@ -40,14 +40,21 @@ $basic: basic_list = "msg swaplns messages argarray longwrds" - + " prmreuse math fldchg fldchgnf reindops sprintfc" - + " backgsub tweakfld clsflnam mmap8k fnarray dynlj" - + " substr eofsplit prt1eval splitwht back89 tradanch" +$ basic_lst2 = "nlfldsep splitvar intest nfldstr nors" - + + " fnarydel noparms funstack clobber delarprm prdupval" $ echo "basic" -$basic_loop: basic_test = f$element(0," ",basic_list) -$ basic_list = basic_list - basic_test - " " +$basic_loop1: basic_test = f$element(0," ",basic_lst1) +$ basic_lst1 = basic_lst1 - basic_test - " " $ if basic_test.nes." " then gosub 'basic_test' -$ if basic_list.nes."" then goto basic_loop +$ if basic_lst1.nes."" then goto basic_loop1 +$basic_loop2: basic_test = f$element(0," ",basic_lst2) +$ basic_lst2 = basic_lst2 - basic_test - " " +$ if basic_test.nes." " then gosub 'basic_test' +$ if basic_lst2.nes."" then goto basic_loop2 $ return $ -$unix_tests: unix_tst_list = "poundbang fflush getlnhd" +$unix_tests: unix_tst_list = "poundbang fflush getlnhd pipeio1" - + + " pipeio2 strftlng pid" $ echo "unix_tests" $unix_tst_loop: unix_tst_test = f$element(0," ",unix_tst_list) $ unix_tst_list = unix_tst_list - unix_tst_test - " " @@ -56,7 +63,8 @@ $ if unix_tst_list.nes."" then goto unix_tst_loop $ return $ $gawk_ext: gawk_ext_list = "fieldwdth ignrcase posix manyfiles" - - + " igncfs argtest badargs strftime gensub gnureops" + + " igncfs argtest badargs strftime gensub gnureops reint" - + + " nondec" $ echo "gawk_ext (gawk.extensions)" $gawk_ext_loop: gawk_ext_test = f$element(0," ",gawk_ext_list) $ gawk_ext_list = gawk_ext_list - gawk_ext_test - " " @@ -306,8 +314,12 @@ $ if $status then rm tmp.; $ return $ $nonl: echo "nonl" -$ ! this one might fail, depending on how the distribution was unpacked, -$ ! because the nonl.awk might actually end up with a final newline +$ ! This one might fail, depending on which C run-time library is used. +$ ! If VAXCRTL is used by the program that unpacks the distribution, +$ ! then nonl.awk will actually end with a newline. Even when that's +$ ! not the case, if gawk itself uses VAXCRTL, an absent newline will +$ ! be fabricated by the library when gawk reads the file. DECC$SHR +$ ! doesn't behave this way.... $ AWKPATH_srcdir $ gawk --lint -f nonl.awk _NL: >tmp. 2>&1 $ cmp nonl.ok tmp. @@ -401,7 +413,9 @@ $ cmp intprec.ok tmp. $ if $status then rm tmp.; $ return $ -$! note: this `childin' test currently [gawk 3.0.1] fails for vms +$childin: echo "childin: currently fails for the VMS port, so skipped" +$ return +$! note: this `childin' test currently [gawk 3.0.3] fails for vms $childin: echo "childin" $ echo "note: type ``hi<return><ctrl/Z>'",- "' if testing appears to hang in `childin'" @@ -573,12 +587,143 @@ $ cmp tradanch.ok tmp. $ if $status then rm tmp.; $ return $ +$nlfldsep: echo "nlfldsep" +$ gawk -f nlfldsep.awk nlfldsep.in >tmp. +$ cmp nlfldsep.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$splitvar: echo "splitvar" +$ gawk -f splitvar.awk splitvar.in >tmp. +$ cmp splitvar.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$intest: echo "intest" +$ gawk -f intest.awk >tmp. +$ cmp intest.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$pid: echo "pid" +$ if f$search("pid.ok").eqs."" then create pid.ok +$ open/Write ftmp _pid.in +$ write ftmp f$integer("%x" + f$getjpi("","PID")) +$ write ftmp f$integer("%x" + f$getjpi("","OWNER")) +$ close ftmp +$ gawk -f pid.awk _pid.in >tmp. +$ rm _pid.in; +$ cmp pid.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$strftlng: echo "strftlng" +$ define/User TZ "UTC" !useless +$ gawk -f strftlng.awk >tmp. +$ cmp strftlng.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$nfldstr: echo "nfldstr" +$ if f$search("nfldstr.ok").eqs."" then create nfldstr.ok +$ gawk "$1 == 0 { print ""bug"" }" >tmp. + +$ cmp nfldstr.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$nors: echo "nors" +$!! there's no straightforward way to supply non-terminated input on the fly +$!! @echo A B C D E | tr -d '\12' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ +$!! so just read a line from sys$input instead +$ gawk "{ print $NF }" - nors.in >tmp. +A B C D E +$ cmp nors.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$fnarydel: echo "fnarydel" +$ gawk -f fnarydel.awk >tmp. +$ cmp fnarydel.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$reint: echo "reint" +$ gawk --re-interval -f reint.awk reint.in >tmp. +$ cmp reint.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$noparms: echo "noparms" +$ set noOn +$ AWKPATH_srcdir +$ gawk -f noparms.awk >tmp. 2>&1 +$ set On +$ cmp noparms.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$pipeio1: echo "pipeio1" +$ cat = "TYPE" !close enough, as long as we avoid .LIS default suffix +$ define/User test1 []test1. +$ define/User test2 []test2. +$ gawk -f pipeio1.awk >tmp. +$ rm test1.;,test2.; +$ cmp pipeio1.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$pipeio2: +$ echo "pipeio2: uses Unix-specific command so won't work on VMS" +$ return +$!!pipeio2: echo "pipeio2" +$ cat = "gawk -- {print}" +$ tr = "??" !unfortunately, no trivial substitution available... +$ gawk -v "SRCDIR=." -f pipeio2.awk >tmp. +$ cmp pipeio2.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$funstack: echo "funstack" +$ gawk -f funstack.awk funstack.in >tmp. +$ cmp funstack.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$clobber: echo "clobber" +$ gawk -f clobber.awk >tmp. +$ cmp clobber.ok seq. +$ if $status then rm seq.;* +$ cmp clobber.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$delarprm: echo "delarprm" +$ gawk -f delarprm.awk >tmp. +$ cmp delarprm.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$prdupval: echo "prdupval" +$ gawk -f prdupval.awk prdupval.in >tmp. +$ cmp prdupval.ok tmp. +$ if $status then rm tmp.; +$ return +$ +$nondec: echo "nondec" +$ ! gawk -f nondec.awk >tmp. +$ ! cmp nondec.ok tmp. +$ ! if $status then rm tmp.; +$ return $ $clean: $ if f$search("tmp.") .nes."" then rm tmp.;* $ if f$search("tmp.too") .nes."" then rm tmp.too;* $ if f$search("out%.") .nes."" then rm out%.;* $ if f$search("strftime.ok").nes."" then rm strftime.ok;* +$ if f$search("test%.") .nes."" then rm test%.;* +$ if f$search("seq.") .nes."" then rm seq.;* +$ if f$search("_pid.in") .nes."" then rm _pid.in;* $ if f$search("[.junk]*.*").nes."" then rm [.junk]*.*;* $ if f$parse("[.junk]") .nes."" then rm []junk.dir;1 $ return |