aboutsummaryrefslogtreecommitdiffstats
path: root/vms
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:09:56 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:09:56 +0300
commitbc70de7b3302d5a81515b901cae376b8b51d2004 (patch)
treed36d6743e65697f6923b79d0ea8f9f9bf4ef7398 /vms
parentb9e4a1fd4c8c8753ab8a9887bab55f03efe1e3e2 (diff)
downloadegawk-bc70de7b3302d5a81515b901cae376b8b51d2004.tar.gz
egawk-bc70de7b3302d5a81515b901cae376b8b51d2004.tar.bz2
egawk-bc70de7b3302d5a81515b901cae376b8b51d2004.zip
Move to gawk-3.1.0.
Diffstat (limited to 'vms')
-rw-r--r--vms/ChangeLog53
-rw-r--r--vms/descrip.mms74
-rw-r--r--vms/gawkmisc.vms50
-rw-r--r--vms/redirect.h15
-rw-r--r--vms/vms-conf.h311
-rw-r--r--vms/vms_fwrite.c4
-rw-r--r--vms/vms_misc.c167
-rw-r--r--vms/vmsbuild.com42
-rw-r--r--vms/vmstest.com321
9 files changed, 917 insertions, 120 deletions
diff --git a/vms/ChangeLog b/vms/ChangeLog
index 63db18a1..d7745d3c 100644
--- a/vms/ChangeLog
+++ b/vms/ChangeLog
@@ -1,3 +1,54 @@
+Sun Jun 3 13:04:44 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.0: Release tar file made. And there was
+ rejoicing.
+
+Thu Apr 12 18:29:50 2001 Pat Rankin <rankin@eql.caltech.edu>
+
+ * vms_misc.c (open): Add handling for /dev/null and /dev/tty.
+ (vms_devopen): Remove handling for /dev/null and /dev/tty.
+
+ * vms_misc.c (VMS_stat, VMS_fstat): New functions to work
+ around old VAXCRTL bugs.
+ * redirect.h (fstat): Define as VMS_fstat for VAX C or GNU C.
+
+ * vms-conf.h (HAVE_UNISTD_H): Avoid <unistd.h> for GNU C.
+
+ * descrip.mms: Synchronize with 3.1.0 sources.
+
+ * vmstest.com: Add many new tests.
+ (fixup_LRL): New subroutine.
+
+Thu Apr 5 20:31:22 2001 Pat Rankin <rankin@eql.caltech.edu>
+
+ * vms-conf.h: synchronize with current configh.in.
+ [NO_ALLOCA]: define instead of C_ALLOCA.
+ * redirect.h (strcoll): substitute strcmp for VAXCRTL config.
+ (struct timeval): define.
+ (gettimeofday): substitute vms_gettimeofday; declare.
+
+ * vms_misc.c (vms_gettimeofday): new function.
+ * vms_fwrite.c [#if NO_ALLOCA]: fix fake alloca's use of free().
+
+ * vmsbuild.com: synchronize with current sources.
+
+Sun Jan 28 15:50:02 2001 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gawkmisc.vms (os_restore_mode): New function
+
+Sun Dec 3 16:53:37 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.vms (os_setbinmode): new function.
+
+Tue Nov 7 14:09:14 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.vms (os_is_setuid): new function.
+
+Wed Jul 30 19:53:52 1997 Arnold D. Robbins <arnold@gnu.ai.mit.edu>
+
+ * Close-on-exec changes:
+ gawkmisc.vms: (os_close_on_exec, os_isdir): new functions.
+
Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.6: Release tar file made.
@@ -15,7 +66,7 @@ Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.5: Release tar file made.
Wed Jun 30 16:14:36 1999 Arnold D. Robbins <arnold@gnu.org>
-
+
* Release 3.0.4: Release tar file made. This time for sure.
Fri May 7 20:29:04 1999 Pat Rankin <rankin@eql.caltech.edu>
diff --git a/vms/descrip.mms b/vms/descrip.mms
index 31ddb0c3..98024abb 100644
--- a/vms/descrip.mms
+++ b/vms/descrip.mms
@@ -2,22 +2,22 @@
#
# usage:
# $ MMS /Description=[.vms]Descrip.MMS gawk
-# possibly add `/Macro=(GNUC)' to compile with GNU C,
-# or add `/Macro=(GNUC,DO_GNUC_SETUP)' to compile with GNU C on
-# a system where GCC is not installed as a defined command,
-# or add `/Macro=(VAXC)' to compile with VAX C,
-# or add `/Macro=(VAXC,"CC=cc/VAXC")' to compile with VAX C on
+# possibly add `/Macro=("GNUC=1")' to compile with GNU C,
+# or add `/Macro=("GNUC=1","DO_GNUC_SETUP=1")' to compile with GNU C
+# on a system where GCC is not installed as a defined command,
+# or add `/Macro=("VAXC=1")' to compile with VAX C,
+# or add `/Macro=("VAXC=1","CC=cc/VAXC")' to compile with VAX C on
# a system which has DEC C installed as the default compiler.
#
# gawk.exe :
# This is the default target. DEC C has become the default compiler.
#
-# awktab.c :
+# awkgram.c :
# If you don't have bison but do have VMS POSIX or DEC/Shell,
# change the PARSER and PASERINIT macros to use yacc. If you don't
# have either yacc or bison, you'll have to make sure that the
-# distributed version of "awktab.c" has its modification date later
-# than the date of "awk.y", so that MMS won't try to build that
+# distributed version of "awkgram.c" has its modification date later
+# than the date of "awkgram.y", so that MMS won't try to build that
# target. If you use bison and it is already defined system-wide,
# comment out the PARSERINIT definition.
#
@@ -57,7 +57,7 @@ LIBS = gnu_cc:[000000]gcclib.olb/Library,sys$library:vaxcrtl.olb/Library
.endif !DO_GNUC_SETUP
.else !!GNUC
.ifdef VAXC
-# always VAX; version V3.x of VAX C assumed (for V2.x, remove /Opt=noInline)
+# always VAX; versions of VAX C older than V3.2 won't work
CC = cc
CFLAGS = /Incl=[]/Obj=[]/Opt=noInline/Def=($(CDEFS)) $(CCFLAGS)
LIBS = sys$share:vaxcrtl.exe/Shareable
@@ -87,18 +87,11 @@ HELPLIB = sys$help:helplib.hlb
ECHO = write sys$output
NOOP = continue
-# ALLOCA
-ALLOCA = alloca.obj
-
# object files
-AWKOBJS = array.obj,builtin.obj,eval.obj,field.obj,gawkmisc.obj,\
- io.obj,main.obj,missing.obj,msg.obj,node.obj,re.obj,version.obj
-
-ALLOBJS = $(AWKOBJS),awktab.obj
-
-# LIBOBJS
-# GNU and other stuff that gawk uses as library routines.
-LIBOBJS = getopt.obj,getopt1.obj,regex.obj,dfa.obj,random.obj,$(ALLOCA)
+AWKOBJS = array.obj,awkgram.obj,builtin.obj,dfa.obj,ext.obj,\
+ field.obj,gawkmisc.obj,getopt.obj,getopt1.obj,io.obj,main.obj,\
+ msg.obj,node.obj,random.obj,re.obj,regex.obj,replace.obj,\
+ version.obj,eval.obj,profile.obj
# VMSOBJS
# VMS specific stuff
@@ -108,28 +101,26 @@ VMSCMD = gawk_cmd.obj # built from .cld file
VMSOBJS = $(VMSCODE),$(VMSCMD)
# source and documentation files
-SRC = array.c,builtin.c,eval.c,field.c,gawkmisc.c,io.c,main.c,\
- missing.c,msg.c,node.c,re.c,version.c
+AWKSRC = array.c,builtin.c,dfa.c,ext.c,eval.c,field.c,gawkmisc.c,\
+ getopt.c,getopt1.c,io.c,main.c,msg.c,node.c,random.c,re.c,\
+ random.c,regex.c,replace.c,version.c,eval.c,profile.c
-ALLSRC= $(SRC),awktab.c
+ALLSRC = $(AWKSRC),awkgram.y,awk.h,custom.h,dfa.h,getopt.h,\
+ patchlev.h,protos.h,random.h
-AWKSRC= awk.h,awk.y,$(ALLSRC),patchlevel.h,protos.h,random.h
-
-LIBSRC = alloca.c,dfa.c,dfa.h,regex.c,regex.h,getopt.h,getopt.c,getopt1.c,random.c
-
-VMSSRCS = $(VMSDIR)gawkmisc.vms,$(VMSDIR)vms_misc.c,$(VMSDIR)vms_popen.c,\
+VMSSRC = $(VMSDIR)gawkmisc.vms,$(VMSDIR)vms_misc.c,$(VMSDIR)vms_popen.c,\
$(VMSDIR)vms_fwrite.c,$(VMSDIR)vms_args.c,$(VMSDIR)vms_gawk.c,\
$(VMSDIR)vms_cli.c
VMSHDRS = $(VMSDIR)redirect.h,$(VMSDIR)vms.h,$(VMSDIR)fcntl.h,\
$(VMSDIR)varargs.h,$(VMSDIR)unixlib.h
-VMSOTHR = $(VMSDIR)Descrip.MMS,$(VMSDIR)vmsbuild.com,$(VMSDIR)version.com,\
+VMSOTHR = $(VMSDIR)descrip.mms,$(VMSDIR)vmsbuild.com,$(VMSDIR)version.com,\
$(VMSDIR)gawk.hlp
DOCS= $(DOCDIR)gawk.1,$(DOCDIR)gawk.texi,$(DOCDIR)texinfo.tex
# Release of gawk
-REL=3.0
-PATCHLVL=6
+REL=3.1
+PATCHLVL=0
# generic target
all : gawk
@@ -140,14 +131,13 @@ gawk : gawk.exe
$(ECHO) " GAWK "
# rules to build gawk
-gawk.exe : $(ALLOBJS) $(LIBOBJS) $(VMSOBJS) gawk.opt
+gawk.exe : $(AWKOBJS) $(VMSOBJS) gawk.opt
$(LINK) $(LINKFLAGS) gawk.opt/options
gawk.opt : $(MAKEFILE) # create linker options file
open/write opt gawk.opt ! ~ 'cat <<close >gawk.opt'
write opt "! GAWK -- GNU awk"
- @ write opt "$(ALLOBJS)"
- @ write opt "$(LIBOBJS)"
+ @ write opt "$(AWKOBJS)"
@ write opt "$(VMSOBJS)"
@ write opt "psect_attr=environ,noshr !extern [noshare] char **"
@ write opt "stack=48 !preallocate more pages (default is 20)"
@@ -162,20 +152,18 @@ vms_fwrite.obj : $(VMSDIR)vms_fwrite.c
vms_args.obj : $(VMSDIR)vms_args.c
vms_gawk.obj : $(VMSDIR)vms_gawk.c
vms_cli.obj : $(VMSDIR)vms_cli.c
-$(VMSCODE) : awk.h config.h $(VMSDIR)vms.h
+$(VMSCODE) : awk.h config.h $(VMSDIR)redirect.h $(VMSDIR)vms.h
gawkmisc.obj : gawkmisc.c $(VMSDIR)gawkmisc.vms
-$(ALLOBJS) : awk.h dfa.h regex.h config.h $(VMSDIR)redirect.h
-getopt.obj : getopt.h config.h $(VMSDIR)redirect.h
-getopt1.obj : getopt.h config.h $(VMSDIR)redirect.h
+$(AWKOBJS) : awk.h dfa.h regex.h config.h $(VMSDIR)redirect.h
random.obj : random.h
builtin.obj : random.h
-main.obj : patchlevel.h
-awktab.obj : awk.h awktab.c
+main.obj : patchlev.h
+awkgram.obj : awkgram.c awk.h
# bison or yacc required
-awktab.c : awk.y # foo.y :: yacc => y[_]tab.c, bison => foo_tab.c
+awkgram.c : awkgram.y # foo.y :: yacc => y[_]tab.c, bison => foo_tab.c
@- if f$search("ytab.c") .nes."" then delete ytab.c;* !POSIX yacc
@- if f$search("y_tab.c") .nes."" then delete y_tab.c;* !DEC/Shell yacc
@- if f$search("awk_tab.c").nes."" then delete awk_tab.c;* !bison
@@ -188,10 +176,6 @@ awktab.c : awk.y # foo.y :: yacc => y[_]tab.c, bison => foo_tab.c
config.h : $(VMSDIR)vms-conf.h
copy $< $@
-# Alloca - C simulation
-alloca.obj : alloca.c config.h $(VMSDIR)redirect.h
- $(CC) $(CFLAGS) /define=($(CDEFS),"STACK_DIRECTION=(-1)","exit=vms_exit") $<
-
$(VMSCMD) : $(VMSDIR)gawk.cld
set command $(CLDFLAGS)/object=$@ $<
diff --git a/vms/gawkmisc.vms b/vms/gawkmisc.vms
index 95983351..4d47369c 100644
--- a/vms/gawkmisc.vms
+++ b/vms/gawkmisc.vms
@@ -118,4 +118,54 @@ int c;
return (strchr(":]>/", c) != NULL);
}
+/* os_close_on_exec --- set close on exec flag, print warning if fails */
+void
+os_close_on_exec(fd, name, what, dir)
+int fd;
+const char *name, *what, *dir;
+{
+ /* no-op */
+}
+
+/* os_isdir --- is this an fd on a directory? */
+
+#if ! defined(S_ISDIR) && defined(S_IFDIR)
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+
+int
+os_isdir(fd)
+int fd;
+{
+ struct stat sbuf;
+
+ return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode));
+}
+
+/* os_is_setuid --- true if running setuid root */
+
+int
+os_is_setuid()
+{
+ return 0;
+}
+
+/* os_setbinmode --- set binary mode on file */
+
+int
+os_setbinmode (fd, mode)
+int fd, mode;
+{
+ return 0;
+}
+
+/* os_restore_mode --- restore the original mode of the console device */
+
+void
+os_restore_mode (fd)
+int fd;
+{
+ /* no-op */
+ return;
+}
diff --git a/vms/redirect.h b/vms/redirect.h
index 294dba7f..1ef3f061 100644
--- a/vms/redirect.h
+++ b/vms/redirect.h
@@ -51,6 +51,9 @@
#define timezone fake_timezone
#define altzone fake_altzone
#endif
+#if !defined(__DECC) && !defined(VAXC2DECC) && !defined(__alpha)
+#define strcoll(s,t) strcmp((s),(t)) /* VAXCRTL lacks locale support */
+#endif
#endif
#ifdef STDC_HEADERS
@@ -59,6 +62,15 @@
#include <stdlib.h>
#include <string.h>
#endif
+#ifndef VMS_POSIX
+/* This if for random.c. */
+#define gettimeofday vms_gettimeofday
+#ifndef __TIMEVAL
+#define __TIMEVAL 1
+struct timeval { long tv_sec, tv_usec; };
+#endif
+extern int gettimeofday(struct timeval *,void *);
+#endif
#else /* awk.h, not POSIX */
@@ -73,6 +85,9 @@
#define strerror vms_strerror
#define strdup vms_strdup
#define unlink vms_unlink
+#if defined(VAXC) || (defined(__GNUC__) && !defined(__alpha))
+#define fstat(fd,sb) VMS_fstat(fd,sb)
+#endif
extern void exit P((int));
extern int open P((const char *,int,...));
extern char *strerror P((int));
diff --git a/vms/vms-conf.h b/vms/vms-conf.h
index e655ef24..555178d3 100644
--- a/vms/vms-conf.h
+++ b/vms/vms-conf.h
@@ -1,3 +1,5 @@
+#ifndef CONFIG_H
+#define CONFIG_H
/*
* config.h -- configuration definitions for gawk.
*
@@ -5,7 +7,7 @@
*/
/*
- * Copyright (C) 1991, 1992, 1995, 1996, 1999 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1992, 1995-1996, 1999, 2001 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -25,52 +27,312 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+#if 0
/* Define if using alloca.c. */
#define C_ALLOCA
-#define STACK_DIRECTION (-1)
-#define REGEX_MALLOC /* use malloc instead of alloca in regex.c */
+#else
+#define NO_ALLOCA /* vms/vms_fwrite.c needs this */
+#endif
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
+/* Define if type char is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+/* #undef __CHAR_UNSIGNED__ */
+#endif
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+/* #undef CRAY_STACKSEG_END */
-#define SPRINTF_RET int
+/* Define to the type of elements in the array set by `getgroups'.
+ Usually this is either `int' or `gid_t'. */
+#define GETGROUPS_T int
/* Define if the `getpgrp' function takes no argument. */
#define GETPGRP_VOID 1
-#define HAVE_STRING_H 1 /* the <string.h> header file */
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef gid_t */
+
+/* Define if you have alloca, as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#undef HAVE_ALLOCA_H
+
+/* Define if you don't have vprintf but do have _doprnt. */
+/* #undef HAVE_DOPRNT */
+
+/* Define if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define if your struct stat has st_blksize. */
+#undef HAVE_ST_BLKSIZE
+
+/* Define if you have the ANSI # stringizing operator in cpp. */
+#ifdef VAXC
+#undef HAVE_STRINGIZE
+#else
+#define HAVE_STRINGIZE 1
+#endif
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if your struct tm has tm_zone. */
+#undef HAVE_TM_ZONE
+
+/* Define if you don't have tm_zone but do have the external array
+ tzname. */
+#define HAVE_TZNAME 1 /* (faked in vms/vms_misc.c) */
+
+/* Define if you have the vprintf function. */
+#define HAVE_VPRINTF 1
+
+/* Define as __inline if that's what the C compiler calls it. */
+/* #undef inline */
+
+/* Define if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+/* #undef off_t */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef pid_t */
+
+/* Define if the system does not provide POSIX.1 features except
+ with this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define if you need to in order for stat and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define as the return type of signal handlers (int or void). */
+#define RETSIGTYPE void
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+/* #undef size_t */
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#define STACK_DIRECTION (-1)
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if your <sys/time.h> declares struct tm. */
+/* #undef TM_IN_SYS_TIME */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef uid_t */
+
+#define REGEX_MALLOC 1 /* use malloc instead of alloca in regex.c */
+#define SPRINTF_RET int /* return type of sprintf */
+#define HAVE_MKTIME 1 /* have the mktime function */
+#undef HAVE_SOCKETS /* don't have sockets on this system by default */
+#undef HAVE_PORTALS /* don't have portals on /p on this system */
+#undef DYNAMIC /* don't allow dynamic addition of builtins */
+#define STRTOD_NOT_C89 1 /* strtod doesn't have C89 semantics */
+/* #undef ssize_t */ /* signed version of size_t */
+
+/* Define if you have the __argz_count function. */
+#undef HAVE___ARGZ_COUNT
+
+/* Define if you have the __argz_next function. */
+#undef HAVE___ARGZ_NEXT
+
+/* Define if you have the __argz_stringify function. */
+#undef HAVE___ARGZ_STRINGIFY
+
+/* Define if you have the alarm function. */
+#define HAVE_ALARM 1
+
+/* Define if you have the dcgettext function. */
+#undef HAVE_DCGETTEXT
+
+/* Define if you have the fmod function. */
+#define HAVE_FMOD 1
+
+/* Define if you have the getcwd function. */
+#define HAVE_GETCWD 1
+
+/* Define if you have the getpagesize function. */
+#undef HAVE_GETPAGESIZE
/* Define if you have the memcmp function. */
-#define HAVE_MEMCMP 1
+#define HAVE_MEMCMP 1
+
/* Define if you have the memcpy function. */
-#define HAVE_MEMCPY 1
+#define HAVE_MEMCPY 1
+
/* Define if you have the memset function. */
-#define HAVE_MEMSET 1
+#define HAVE_MEMSET 1
+
+/* Define if you have the munmap function. */
+#undef HAVE_MUNMAP
+
+/* Define if you have the putenv function. */
+#undef HAVE_PUTENV
+
+/* Define if you have the setenv function. */
+#undef HAVE_SETENV
+
+/* Define if you have the setlocale function. */
+#undef HAVE_SETLOCALE
+
+/* Define if you have the stpcpy function. */
+#undef HAVE_STPCPY
+
+/* Define if you have the strcasecmp function. */
+#undef HAVE_STRCASECMP
/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
+#define HAVE_STRCHR 1
+
+/* Define if you have the strdup function. */
+#undef HAVE_STRDUP
/* Define if you have the strerror function. */
-#define HAVE_STRERROR 1
+#define HAVE_STRERROR 1
+
+/* Define if you have the strftime function. */
+#undef HAVE_STRFTIME /* use the missing_d/strfime.c version */
+
+/* Define if you have the strncasecmp function. */
+#undef HAVE_STRNCASECMP
/* Define if you have the strtod function. */
-#define HAVE_STRTOD 1
+#define HAVE_STRTOD 1
/* Define if you have the system function. */
-#define HAVE_SYSTEM 1
-
-/* Define if you have the fmod function. */
-#define HAVE_FMOD 1
+#define HAVE_SYSTEM 1
/* Define if you have the tzset function. */
-/* [Fake it in vms/vms_misc.c since missing/tzset.c won't compile.] */
-#define HAVE_TZSET 1
-#define HAVE_TZNAME 1
+#define HAVE_TZSET 1 /* (faked in vms/vms_misc.c) */
-#define STDC_HEADERS 1
+/* Define if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
-#define HAVE_VPRINTF 1
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
+
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <mcheck.h> header file. */
+#undef HAVE_MCHECK_H
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
+/* Define if you have the <signum.h> header file. */
+#undef HAVE_SIGNUM_H
+
+/* Define if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
+/* Define if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+/* Define if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define if you have the <unistd.h> header file. */
+#ifdef __DECC
+#define HAVE_UNISTD_H 1
+#else
+#undef HAVE_UNISTD_H
+#endif
+
+/* Define if you have the i library (-li). */
+#undef HAVE_LIBI
+
+/* Define if you have the intl library (-lintl). */
+#undef HAVE_LIBINTL
+
+/* Define if you have the m library (-lm). */
+#undef HAVE_LIBM
+
+/* Name of package */
+#define PACKAGE "gawk"
+
+/* Version number of package */
+#define VERSION "3.0.93"
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define to make ftello visible on some hosts (e.g. HP-UX 10.20). */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to make ftello visible on some hosts (e.g. glibc 2.1.3). */
+#undef _XOPEN_SOURCE
+
+/* Define if compiler has function prototypes */
+#define PROTOTYPES 1
+
+/* Define to 1 if you have the stpcpy function. */
+#undef HAVE_STPCPY
+
+/* Define if your locale.h file contains LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
+/* Define to 1 if NLS is requested. */
+#undef ENABLE_NLS
+
+/* Define to 1 if you have gettext and don't want to use GNU gettext. */
+#undef HAVE_GETTEXT
+
+/* Define as 1 if you have catgets and don't want to use GNU gettext. */
+#undef HAVE_CATGETS
+
+#if 0
+#include <custom.h> /* overrides for stuff autoconf can't deal with */
+#else
/*******************************/
/* Gawk configuration options. */
@@ -108,7 +370,6 @@
*
* As of V3.2, VAX C is not yet ANSI-compliant. But it's close enough
* for GAWK's purposes. Comment this out for VAX C V2.4 and earlier.
- * Value of 0 should mean "not ANSI-C", but GAWK uses def/not-def tests.
* YYDEBUG definition is needed for combination of VAX C V2.x and Bison.
*/
#if defined(VAXC) && !defined(__STDC__)
@@ -168,3 +429,7 @@
#define IN_CONFIG_H
#include "vms/redirect.h"
#undef IN_CONFIG_H
+
+#endif /*<custom.h>*/
+
+#endif /*CONFIG_H*/
diff --git a/vms/vms_fwrite.c b/vms/vms_fwrite.c
index 496ef3dc..2e9153f0 100644
--- a/vms/vms_fwrite.c
+++ b/vms/vms_fwrite.c
@@ -153,8 +153,8 @@ tty_fwrite( const void *buf, size_t size, size_t number, FILE *file )
} else {
#ifdef NO_ALLOCA
# define alloca(n) ((n) <= abuf_siz ? abuf : \
- (abuf_siz > 0 ? (void *)free(abuf) : (void *)0), \
- (abuf = malloc(abuf_siz = (n)+20)))
+ ((abuf_siz > 0 ? (free(abuf),0) : 0), \
+ (abuf = malloc(abuf_siz = (n)+20))))
static void *abuf = 0;
static size_t abuf_siz = 0;
#endif /*NO_ALLOCA*/
diff --git a/vms/vms_misc.c b/vms/vms_misc.c
index 1b1a2239..439790d5 100644
--- a/vms/vms_misc.c
+++ b/vms/vms_misc.c
@@ -1,6 +1,6 @@
/* vms_misc.c -- sustitute code for missing/different run-time library routines.
- Copyright (C) 1991-1993, 1996, 1997 the Free Software Foundation, Inc.
+ Copyright (C) 1991-1993, 1996-1997, 2001 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
@@ -18,6 +18,7 @@
#define creat creat_dummy /* one of gcc-vms's headers has bad prototype */
#include "awk.h"
+#include "vms.h"
#undef creat
#include <fab.h>
#ifndef O_RDONLY
@@ -111,6 +112,15 @@ vms_open( const char *name, int mode, ... )
{
int result;
+ if (STREQN(name, "/dev/", 5)) {
+ /* (this used to be handled in vms_devopen(), but that is only
+ called when opening files for output; we want it for input too) */
+ if (strcmp(name + 5, "null") == 0) /* /dev/null -> NL: */
+ name = "NL:";
+ else if (strcmp(name + 5, "tty") == 0) /* /dev/tty -> TT: */
+ name = "TT:";
+ }
+
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 */
@@ -146,11 +156,7 @@ vms_devopen( const char *name, int mode )
{
FILE *file = NULL;
- if (STREQ(name, "/dev/null"))
- return open("NL:", mode, 0); /* "/dev/null" => "NL:" */
- else if (STREQ(name, "/dev/tty"))
- return open("TT:", mode, 0); /* "/dev/tty" => "TT:" */
- else if (strncasecmp(name, "SYS$", 4) == 0) {
+ if (strncasecmp(name, "SYS$", 4) == 0) {
name += 4; /* skip "SYS$" */
if (strncasecmp(name, "INPUT", 5) == 0 && (mode & O_WRONLY) == 0)
file = stdin, name += 5;
@@ -165,6 +171,41 @@ vms_devopen( const char *name, int mode )
}
+#define VMS_UNITS_PER_SECOND 10000000L /* hundreds of nanoseconds, 1e-7 */
+#define UNIX_EPOCH "01-JAN-1970 00:00:00.00"
+
+extern U_Long sys$bintim(), sys$gettim();
+extern U_Long lib$subx(), lib$ediv();
+
+ /*
+ * Get current time in microsecond precision.
+ */
+/* vms_gettimeofday() - get current time in `struct timeval' format */
+int
+vms_gettimeofday(struct timeval *tv, void *timezone__not_used)
+{
+ /*
+ Emulate unix's gettimeofday call; timezone argument is ignored.
+ */
+ static const Dsc epoch_dsc = { sizeof UNIX_EPOCH - sizeof "", UNIX_EPOCH };
+ static long epoch[2] = {0L,0L}; /* needs one time initialization */
+ const long thunk = VMS_UNITS_PER_SECOND;
+ long now[2], quad[2];
+
+ if (!epoch[0]) sys$bintim(&epoch_dsc, epoch); /* 1 Jan 0:0:0 1970 */
+ /* get current time, as VMS quadword time */
+ sys$gettim(now);
+ /* convert the quadword time so that it's relative to Unix epoch */
+ lib$subx(now, epoch, quad); /* quad = now - epoch; */
+ /* convert 1e-7 units into seconds and fraction of seconds */
+ lib$ediv(&thunk, quad, &tv->tv_sec, &tv->tv_usec);
+ /* convert fraction of seconds into microseconds */
+ tv->tv_usec /= (VMS_UNITS_PER_SECOND / 1000000);
+
+ return 0; /* success */
+}
+
+
#ifndef VMS_V7
/*
* VMS prior to V7.x has no timezone support unless DECnet/OSI is used.
@@ -196,6 +237,7 @@ void vms_bcopy( const char *src, char *dst, int len )
}
#endif /*!__GNUC__*/
+
/*----------------------------------------------------------------------*/
#ifdef NO_VMS_ARGS /* real code is in "vms/vms_args.c" */
void vms_arg_fixup( int *argc, char ***argv ) { return; } /* dummy */
@@ -215,3 +257,116 @@ int fork( void ) {
return -1;
}
#endif /*NO_VMS_PIPES*/
+/*----------------------------------------------------------------------*/
+
+
+/*
+ * The following code is taken from the GNU C preprocessor (cccp.c,
+ * 2.8.1 vintage) where it was used #if VMS. It is only needed for
+ * VAX C and GNU C on VAX configurations; DEC C's run-time library
+ * doesn't have the problem described.
+ *
+ * VMS_fstat() and VMS_stat() were static in cccp.c but need to be
+ * accessible to the whole program here. Also, the special handling
+ * for the null device has been introduced for gawk's benefit, to
+ * prevent --lint mode from giving spurious warnings about /dev/null
+ * being empty if it's used as an input file.
+ */
+
+#if defined(VAXC) || (defined(__GNUC__) && !defined(__alpha))
+
+/* more VMS hackery */
+#include <fab.h>
+#include <nam.h>
+
+extern unsigned long sys$parse(), sys$search();
+
+/* Work around a VAXCRTL bug. If a file is located via a searchlist,
+ and if the device it's on is not the same device as the one specified
+ in the first element of that searchlist, then both stat() and fstat()
+ will fail to return info about it. `errno' will be set to EVMSERR, and
+ `vaxc$errno' will be set to SS$_NORMAL due yet another bug in stat()!
+ We can get around this by fully parsing the filename and then passing
+ that absolute name to stat().
+
+ Without this fix, we can end up failing to find header files, which is
+ bad enough, but then compounding the problem by reporting the reason for
+ failure as "normal successful completion." */
+
+#undef fstat /* Get back to the library version. */
+
+int
+VMS_fstat (fd, statbuf)
+ int fd;
+ struct stat *statbuf;
+{
+ int result = fstat (fd, statbuf);
+
+ if (result < 0)
+ {
+ FILE *fp;
+ char nambuf[NAM$C_MAXRSS+1];
+
+ if ((fp = fdopen (fd, "r")) != 0 && fgetname (fp, nambuf) != 0)
+ result = VMS_stat (nambuf, statbuf);
+ /* No fclose(fp) here; that would close(fd) as well. */
+ }
+
+ if (result == 0 /* GAWK addition; fixup /dev/null flags */
+ && (statbuf->st_mode & S_IFREG)
+ && STREQ(statbuf->st_dev, "_NLA0:"))
+ {
+ statbuf->st_mode &= ~S_IFREG;
+ statbuf->st_mode |= S_IFCHR;
+ }
+
+ return result;
+}
+
+int
+VMS_stat (name, statbuf)
+ const char *name;
+ struct stat *statbuf;
+{
+ int result = stat (name, statbuf);
+
+ if (result < 0)
+ {
+ struct FAB fab;
+ struct NAM nam;
+ char exp_nam[NAM$C_MAXRSS+1], /* expanded name buffer for sys$parse */
+ res_nam[NAM$C_MAXRSS+1]; /* resultant name buffer for sys$search */
+
+ fab = cc$rms_fab;
+ fab.fab$l_fna = (char *) name;
+ fab.fab$b_fns = (unsigned char) strlen (name);
+ fab.fab$l_nam = (void *) &nam;
+ nam = cc$rms_nam;
+ nam.nam$l_esa = exp_nam, nam.nam$b_ess = sizeof exp_nam - 1;
+ nam.nam$l_rsa = res_nam, nam.nam$b_rss = sizeof res_nam - 1;
+ nam.nam$b_nop = NAM$M_PWD | NAM$M_NOCONCEAL;
+ if (sys$parse (&fab) & 1)
+ {
+ if (sys$search (&fab) & 1)
+ {
+ res_nam[nam.nam$b_rsl] = '\0';
+ result = stat (res_nam, statbuf);
+ }
+ /* Clean up searchlist context cached by the system. */
+ nam.nam$b_nop = NAM$M_SYNCHK;
+ fab.fab$l_fna = 0, fab.fab$b_fns = 0;
+ (void) sys$parse (&fab);
+ }
+ }
+
+ if (result == 0 /* GAWK addition; fixup /dev/null flags */
+ && (statbuf->st_mode & S_IFREG)
+ && STREQ(statbuf->st_dev, "_NLA0:"))
+ {
+ statbuf->st_mode &= ~S_IFREG;
+ statbuf->st_mode |= S_IFCHR;
+ }
+
+ return result;
+}
+#endif /* VAXC || (__GNUC__ && !__alpha) */
diff --git a/vms/vmsbuild.com b/vms/vmsbuild.com
index fcd514b0..1501c85a 100644
--- a/vms/vmsbuild.com
+++ b/vms/vmsbuild.com
@@ -5,9 +5,10 @@ $! gawk 2.14 revised, Sep'92
$! gawk 2.15 revised, Oct'93
$! gawk 3.0 revised, Dec'95
$! gawk 3.0.1 revised, Nov'96
+$! gawk 3.1.0 revised, Mar'01
$!
-$ REL = "3.0" !release version number
-$ PATCHLVL = "6"
+$ REL = "3.1" !release version number
+$ PATCHLVL = "0"
$!
$!
$ CCFLAGS = "/noList" ! "/noOpt/Debug"
@@ -48,34 +49,35 @@ $ v = f$verify(1)
$ copy [.vms]vms-conf.h []config.h
$! 'f$verify(v)'
$config_ok:
-$ if f$search("awktab.c").nes."" then goto awktab_ok
-$ write sys$output " You must process `awk.y' with ""yacc"" or ""bison"""
-$ if f$search("awk_tab.c").nes."" then - !bison was run manually
- write sys$output " or else rename `awk_tab.c' to `awktab.c'."
+$ if f$search("awkgram.c").nes."" then goto awkgram_ok
+$ write sys$output " You must process `awkgram.y' with ""yacc"" or ""bison"""
+$ if f$search("awkgram_tab.c").nes."" then - !bison was run manually
+ write sys$output " or else rename `awkgram_tab.c' to `awkgramtab.c'."
$ if f$search("ytab.c").nes."" .or. f$search("y_tab.c").nes."" then - !yacc
- write sys$output " or else rename `ytab.c' or `y_tab.c' to `awktab.c'."
+ write sys$output " or else rename `ytab.c' or `y_tab.c' to `awkgramtab.c'."
$ exit
-$awktab_ok:
+$awkgram_ok:
$ v = f$verify(1)
$ cc array.c
+$ cc awkgram.c
$ cc builtin.c
-$ cc eval.c
+$ cc dfa.c
+$ cc ext.c
$ cc field.c
$ cc gawkmisc.c
+$ cc getopt.c
+$ cc getopt1.c
$ cc io.c
$ cc main.c
-$ cc missing.c
$ cc msg.c
$ cc node.c
+$ cc random.c
$ cc re.c
-$ cc version.c
-$ cc awktab.c
-$ cc getopt.c
-$ cc getopt1.c
$ cc regex.c
-$ cc dfa.c
-$ cc random.c
-$ cc/Define=('CDEFS',"STACK_DIRECTION=(-1)","exit=vms_exit") alloca.c
+$ cc replace.c
+$ cc version.c
+$ cc eval.c
+$ cc profile.c
$ cc [.vms]vms_misc.c
$ cc [.vms]vms_popen.c
$ cc [.vms]vms_fwrite.c
@@ -88,9 +90,9 @@ $!
$ close/noLog Fopt
$ create gawk.opt
! GAWK -- GNU awk
-array.obj,builtin.obj,eval.obj,field.obj,gawkmisc.obj
-io.obj,main.obj,missing.obj,msg.obj,node.obj,re.obj,version.obj,awktab.obj
-getopt.obj,getopt1.obj,regex.obj,dfa.obj,random.obj,alloca.obj
+array.obj,awkgram.obj,builtin.obj,dfa.obj,ext.obj,field.obj,gawkmisc.obj
+getopt.obj,getopt1.obj,io.obj,main.obj,msg.obj,node.obj,random.obj
+re.obj,regex.obj,replace.obj,version.obj,eval.obj,profile.obj
[]vms_misc.obj,vms_popen.obj,vms_fwrite.obj,vms_args.obj
[]vms_gawk.obj,vms_cli.obj,gawk_cmd.obj
psect_attr=environ,noshr !extern [noshare] char **
diff --git a/vms/vmstest.com b/vms/vmstest.com
index 85c4fa9d..af38e162 100644
--- a/vms/vmstest.com
+++ b/vms/vmstest.com
@@ -42,9 +42,13 @@ $basic: basic_lst1 = "msg swaplns messages argarray longwrds" -
+ " substr eofsplit prt1eval splitwht back89 tradanch"
$ basic_lst2 = "nlfldsep splitvar intest nfldstr nors" -
+ " fnarydel noparms funstack clobber delarprm prdupval" -
- + " nasty zeroflag getnr2tm getnr2tb printf1" -
+ + " nasty nasty2 zeroflag getnr2tm getnr2tb printf1" -
+ " funsmnam fnamedat numindex subslash opasnslf" -
- + " opasnidx arynocls getlnbuf arysubnm fnparydl"
+ + " opasnidx arynocls getlnbuf arysubnm fnparydl" -
+ + " nlstrina octsub nlinstr ofmt hsprint ofmts parseme" -
+ + " splitdef fnaryscl fnasgnm ofmtbig paramtyp rsnul1nl" -
+ + " datanonl regeq redfilnm strtod leaddig arynasty" -
+ + " psx96sub addcomma"
$ echo "basic"
$basic_loop1: basic_test = f$element(0," ",basic_lst1)
$ basic_lst1 = basic_lst1 - basic_test - " "
@@ -56,8 +60,8 @@ $ 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 pipeio1" -
- + " pipeio2 strftlng pid"
+$unix_tests: unix_tst_list = "fflush getlnhd pid pipeio1" -
+ + " pipeio2 poundbang strftlng"
$ echo "unix_tests"
$unix_tst_loop: unix_tst_test = f$element(0," ",unix_tst_list)
$ unix_tst_list = unix_tst_list - unix_tst_test - " "
@@ -65,9 +69,10 @@ $ if unix_tst_test.nes." " then gosub 'unix_tst_test'
$ 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 reint" -
- + " igncdym" ! + " nondec"
+$gawk_ext: gawk_ext_list = "argtest badargs clos1way fieldwdth" -
+ + " fsfwfs gensub gnuops2 gnureops igncdym igncfs" -
+ + " ignrcase lint manyfiles nondec posix procinfs" -
+ + " regx8bit reint shadow sort1 strftime"
$ 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 - " "
@@ -83,10 +88,24 @@ $ if vms_tst_test.nes." " then gosub 'vms_tst_test'
$ if vms_tst_list.nes."" then goto vms_tst_loop
$ return
$
-$extra: extra_list = "regtest inftest"
+$extra: extra_list = "regtest inftest inet"
$ echo "extra"
-$ gosub "regtest"
-$ gosub "inftest"
+$extra_loop: extra_test = f$element(0," ",extra_list)
+$ extra_list = extra_list - extra_test - " "
+$ if extra_test.nes." " then gosub 'extra_test'
+$ if extra_list.nes."" then goto extra_loop
+$ return
+$
+$inet: inet_list = "inetechu inetecht inetdayu inetdayt"
+$ echo "inet"
+$ type sys$input:
+ The inet tests only work if gawk has been built with tcp/ip socket
+ support and your system supports the services "discard" at port 9
+ and "daytimed" at port 13.
+$inet_loop: inet_test = f$element(0," ",inet_list)
+$ inet_list = inet_list - inet_test - " "
+$ if inet_test.nes." " then gosub 'inet_test'
+$ if inet_list.nes."" then goto inet_loop
$ return
$
$poundbang:
@@ -225,9 +244,11 @@ $ return
$
$inftest: echo "inftest"
$ !! echo "This test is very machine specific..."
+$ set noOn
$ gawk -f inftest.awk >tmp.
$ !! cmp inftest.ok tmp. !just care that gawk doesn't crash...
$ if $status then rm tmp.;
+$ set On
$ return
$
$getline: echo "getline"
@@ -325,12 +346,8 @@ $ if $status then rm tmp.;
$ return
$
$nonl: echo "nonl"
-$ ! 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....
+$ ! This one might fail, depending on the tool used to unpack the
+$ ! distribution. Some will add a final newline if the file lacks one.
$ AWKPATH_srcdir
$ gawk --lint -f nonl.awk _NL: >tmp. 2>&1
$ cmp nonl.ok tmp.
@@ -535,7 +552,7 @@ $ return
$
$clsflnam: echo "clsflnam"
$ if f$search("clsflnam.ok").eqs."" then create clsflnam.ok
-$ gawk -f clsflnam.awk clsflnam.in >tmp.
+$ gawk -f clsflnam.awk clsflnam.in >tmp. 2>&1
$ cmp clsflnam.ok tmp.
$ if $status then rm tmp.;
$ return
@@ -623,7 +640,7 @@ $ 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.
+$ gawk -f pid.awk _pid.in >tmp. >& _NL:
$ rm _pid.in;
$ cmp pid.ok tmp.
$ if $status then rm tmp.;
@@ -723,11 +740,23 @@ $ if $status then rm tmp.;
$ return
$
$nasty: echo "nasty"
+$ set noOn
$ gawk -f nasty.awk >tmp.
-$ if f$file_attrib("nasty.ok","LRL").eq.0 then convert nasty.ok *.*
-$ if f$file_attrib("tmp.", "LRL").eq.0 then convert tmp. *.*
+$ call fixup_LRL nasty.ok
+$ call fixup_LRL tmp. "purge"
$ cmp nasty.ok tmp.
$ if $status then rm tmp.;
+$ set On
+$ return
+$
+$nasty2: echo "nasty2"
+$ set noOn
+$ gawk -f nasty2.awk >tmp.
+$ call fixup_LRL nasty2.ok
+$ call fixup_LRL tmp. "purge"
+$ cmp nasty2.ok tmp.
+$ if $status then rm tmp.;
+$ set On
$ return
$
$zeroflag: echo "zeroflag"
@@ -836,9 +865,235 @@ $ if $status then rm tmp.;
$ return
$
$nondec: echo "nondec"
-$ ! gawk -f nondec.awk >tmp.
-$ ! cmp nondec.ok tmp.
-$ ! if $status then rm tmp.;
+$ gawk -f nondec.awk >tmp.
+$ cmp nondec.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$nlstrina: echo "nlstrina"
+$ AWKPATH_srcdir
+$ gawk -f nlstrina.awk >tmp.
+$ cmp nlstrina.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$octsub: echo "octsub"
+$ AWKPATH_srcdir
+$ gawk -f octsub.awk >tmp.
+$ cmp octsub.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$nlinstr: echo "nlinstr"
+$ gawk -f nlinstr.awk nlinstr.in >tmp.
+$ cmp nlinstr.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$ofmt: echo "ofmt"
+$ gawk -f ofmt.awk ofmt.in >tmp.
+$ cmp ofmt.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$hsprint: echo "hsprint"
+$ gawk -f hsprint.awk >tmp.
+$ cmp hsprint.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$fsfwfs: echo "fsfwfs"
+$ gawk -f fsfwfs.awk fsfwfs.in >tmp.
+$ cmp fsfwfs.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$ofmts: echo "ofmts"
+$ gawk -f ofmts.awk ofmts.in >tmp.
+$ cmp ofmts.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$parseme: echo "parseme"
+$ set noOn
+$ AWKPATH_srcdir
+$ gawk -f parseme.awk >tmp. 2>&1
+$ set On
+$ cmp parseme.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$splitdef: echo "splitdef"
+$ gawk -f splitdef.awk >tmp.
+$ cmp splitdef.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$fnaryscl: echo "fnaryscl"
+$ set noOn
+$ AWKPATH_srcdir
+$ gawk -f fnaryscl.awk >tmp. 2>&1
+$ set On
+$ cmp fnaryscl.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$fnasgnm: echo "fnasgnm"
+$ set noOn
+$ AWKPATH_srcdir
+$ gawk -f fnasgnm.awk < fnasgnm.in >tmp. 2>&1
+$ set On
+$ cmp fnasgnm.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$lint: echo "lint"
+$ AWKPATH_srcdir
+$ gawk -f lint.awk >tmp. 2>&1
+$ cmp lint.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$procinfs: echo "procinfs"
+$ gawk -f procinfs.awk >tmp.
+$ cmp procinfs.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$sort1: echo "sort1"
+$ gawk -f sort1.awk >tmp.
+$ cmp sort1.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$ofmtbig: echo "ofmtbig"
+$ set noOn
+$ gawk -f ofmtbig.awk ofmtbig.in >tmp. 2>&1
+$ set On
+$ cmp ofmtbig.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$inetechu: echo "inetechu"
+$ echo "this test is for establishing UDP connections"
+$ set noOn
+$ gawk -- "BEGIN {print """" |& ""/inet/udp/0/127.0.0.1/9""}"
+$ set On
+$ return
+$
+$inetecht: echo "inetecht"
+$ echo "this test is for establishing TCP connections"
+$ set noOn
+$ gawk -- "BEGIN {print """" |& ""/inet/tcp/0/127.0.0.1/9""}"
+$ set On
+$ return
+$
+$inetdayu: echo "inetdayu"
+$ echo "this test is for bidirectional UDP transmission"
+$ set noOn
+$ gawk -f - nl:
+BEGIN { print "" |& "/inet/udp/0/127.0.0.1/13";
+ "/inet/udp/0/127.0.0.1/13" |& getline; print $0}
+$ set On
+$ return
+$
+$inetdayt: echo "netdayt"
+$ echo "this test is for bidirectional TCP transmission"
+$ set noOn
+$ gawk -f - nl:
+BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13";
+ "/inet/tcp/0/127.0.0.1/13" |& getline; print $0}
+$ set On
+$ return
+$
+$paramtyp: echo "paramtyp"
+$ gawk -f paramtyp.awk >tmp.
+$ cmp paramtyp.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$rsnul1nl: echo "rsnul1nl"
+$ gawk -f rsnul1nl.awk rsnul1nl.in >tmp.
+$ cmp rsnul1nl.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$datanonl: echo "datanonl"
+$ gawk -f datanonl.awk datanonl.in >tmp.
+$ cmp datanonl.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$regeq: echo "regeq"
+$ gawk -f regeq.awk regeq.in >tmp.
+$ cmp regeq.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$redfilnm: echo "redfilnm"
+$ gawk -f redfilnm.awk srcdir="." redfilnm.in >tmp.
+$ cmp redfilnm.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$strtod: echo "strtod"
+$ gawk -f strtod.awk strtod.in >tmp.
+$ cmp strtod.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$leaddig: echo "leaddig"
+$ gawk -v "x=2E" -f leaddig.awk >tmp.
+$ cmp leaddig.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$clos1way:
+$ echo "clos1way: uses unsupported `|&' redirection, so skipped"
+$ return
+$!!clos1way: echo "clos1way"
+$ gawk -f clos1way.awk >tmp.
+$ cmp clos1way.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$arynasty: echo "arynasty"
+$ gawk -f arynasty.awk >tmp.
+$ cmp arynasty.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$shadow: echo "shadow"
+$ set noOn
+$ AWKPATH_srcdir
+$ gawk --lint -f shadow.awk >tmp. 2>&1
+$ set On
+$ cmp shadow.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$regx8bit: echo "regx8bit"
+$ gawk -f regx8bit.awk >tmp.
+$ cmp regx8bit.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$psx96sub: echo "psx96sub"
+$ gawk -f psx96sub.awk >tmp.
+$ cmp psx96sub.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$addcomma: echo "addcomma"
+$ gawk -f addcomma.awk addcomma.in >tmp.
+$ cmp addcomma.ok tmp.
+$ if $status then rm tmp.;
+$ return
+$
+$gnuops2: echo "gnuops2"
+$ gawk -f gnuops2.awk >tmp.
+$ cmp gnuops2.ok tmp.
+$ if $status then rm tmp.;
$ return
$
$vms_io1: echo "vms_io1"
@@ -866,5 +1121,25 @@ $ if f$search("[.junk]*.*").nes."" then rm [.junk]*.*;*
$ if f$parse("[.junk]") .nes."" then rm []junk.dir;1
$ return
$
+$! make sure that the specified file's longest-record-length field is set;
+$! otherwise DIFF will choke if any record is longer than 512 bytes
+$fixup_LRL: subroutine
+$ lrl = 0 !VMS V5.5-2 didn't support the LRL argument yet
+$ define/user sys$error nl:
+$ define/user sys$output nl:
+$ lrl = f$file_attribute(p1,"LRL")
+$ if lrl.eq.0 then lrl = f$file_attribute(p1,"MRS")
+$ if lrl.eq.0
+$ then convert/fdl=sys$input: 'p1' *.*
+file
+ organization sequential
+record
+ format stream_lf
+ size 32767
+$ if $status .and. p2.eqs."purge" then rm 'p1';-1
+$ else cmp nl: nl: !deassign/user sys${error,output}
+$ endif
+$ endsubroutine !fixup_LRL
+$
$!NOTREACHED
$ exit