aboutsummaryrefslogtreecommitdiffstats
path: root/vms
diff options
context:
space:
mode:
Diffstat (limited to 'vms')
-rw-r--r--vms/ChangeLog15
-rw-r--r--vms/gawk.hlp12
-rw-r--r--vms/gawkmisc.vms11
-rw-r--r--vms/vms_cli.c8
-rw-r--r--vms/vmstest.com7
5 files changed, 33 insertions, 20 deletions
diff --git a/vms/ChangeLog b/vms/ChangeLog
index 6cc5afb7..504967fd 100644
--- a/vms/ChangeLog
+++ b/vms/ChangeLog
@@ -1,4 +1,11 @@
-2013-12-20 John E. Malmberg <wb8tyw@qsl.net>
+2013-12-23 John E. Malmberg <wb8tyw@qsl.net>
+
+ * gawkmisc.vms: Fix program name calculation on VAX.
+ * vms_cli.c: Fix case of public symbol.
+ * vms.hlp: Fix typo, add cautions on rounding and timezones.
+ * vmstest.com: Dcl symbol tz causing conflict with test.
+
+2013-12-20 John E. Malmberg <wb8tyw@qsl.net>
* descrip.mms: Set CC exact symbol names, cleanup repository.
* generate_config_vms_h_gawk.com: Use correct VMS exit codes.
@@ -8,14 +15,14 @@
vms_misc.c, vms_popen.c: Correct case of function names.
* vms.hlp: Updated with new information about exit codes.
-2013-12-10 John E. Malmberg <wb8tyw@qsl.net>
+2013-12-10 John E. Malmberg <wb8tyw@qsl.net>
* gawkmisc.vms: Add lots of includes.
(sys_trnlnm): New function.
(gawk_name): Improved.
(os_arg_fixup): Fix up time zone.
-2013-12-08 John E. Malmberg <wb8tyw@qsl.net>
+2013-12-08 John E. Malmberg <wb8tyw@qsl.net>
* descrip.mms: Add IEEE float for non-vax.
Add vms_crtl_init.c.
@@ -30,7 +37,7 @@
* vms_misc.c (vms_open): VMS CRTL for 8.3 Alpha is setting
errno to ENOENT instead of EISDIR for ".".
-2013-12-05 John E. Malmberg <wb8tyw@qsl.net>
+2013-12-05 John E. Malmberg <wb8tyw@qsl.net>
* New config_h.com to generate config.h
* New gawk_ident.com generates ident line for link option file.
diff --git a/vms/gawk.hlp b/vms/gawk.hlp
index 177ef91c..a14ad72b 100644
--- a/vms/gawk.hlp
+++ b/vms/gawk.hlp
@@ -1183,6 +1183,10 @@
the default is systime(); if u is present and non-zero
then t is treated as a UTC value, otherwise it is
considered to be local time
+
+5 time_logical_names
+ Gawk needs the SYS$TIMEZONE_RULE or TZ logical names defined or it will
+ output the time in the GMT timezone.
5 time_formats
Formatting directives similar to the 'printf' & 'sprintf' functions
(each is introduced in the format string by preceding it with a
@@ -1559,7 +1563,7 @@
operating system. GAWK expects a UN*X-style value instead of a
VMS status value, so 0 indicates success. A failure is indicated
by 1 and VMS will set the ERROR status. A fatal error is indicated
- by 2 and VMS seet the FATAL status. All other values will will have
+ by 2 and VMS will set the FATAL status. All other values will will have
the SUCCESS status. The exit value is encoded to comply with VMS
coding standards and will have the C_FACILITY_NO of 0x350000 with
the constant 0xA000 added to the number shifted over by 3 bits to
@@ -1573,7 +1577,11 @@
Older versions of Gawk treated Unix exit code 0 as 1, A failure as
2, and a fatal error as 4, and passed all the other numbers through.
- This violate the VMS exit status coding requirements.
+ This violated the VMS exit status coding requirements.
+
+4 rounding
+ VAX/VMS floating point uses unbiased rounding. This is different than
+ what portable gawk programs expect.
3 changes
Changes between version 4.0.0 and earlier versions
diff --git a/vms/gawkmisc.vms b/vms/gawkmisc.vms
index 046c5167..749c6036 100644
--- a/vms/gawkmisc.vms
+++ b/vms/gawkmisc.vms
@@ -82,7 +82,7 @@ char quote = '\'';
char *defpath = DEFPATH;
char *deflibpath = DEFLIBPATH;
char envsep = ',';
-#define VMS_NAME_LEN 1
+#define VMS_NAME_LEN 255
static char vms_name[VMS_NAME_LEN+1];
/* Take all the fun out of simply looking up a logical name */
@@ -149,6 +149,7 @@ const char *filespec;
* be fixed.
*/
+ result = 0;
if (filespec[0] == '/') {
char * nextslash;
int length;
@@ -333,6 +334,7 @@ const char *filespec;
strncpy(vms_name, name, name_len);
vms_name[name_len] = 0;
+ result = 1;
/* We only keep the extension if it is not ".exe" */
keep_ext = 0;
@@ -427,13 +429,6 @@ const char *filespec;
}
}
}
-
- } else {
- /* There is no way that the code should ever get here
- * As we already verified that the '/' was present
- */
- fprintf(stderr,
- "Sanity failure somewhere we lost a '/'\n");
}
} else {
/* No changes needed */
diff --git a/vms/vms_cli.c b/vms/vms_cli.c
index 0cfe96fc..aa093441 100644
--- a/vms/vms_cli.c
+++ b/vms/vms_cli.c
@@ -34,7 +34,7 @@ extern U_Long CLI$GET_VALUE(const Dsc *, Dsc *, short *);
extern U_Long CLI$DCL_PARSE(const Dsc *, const void *, ...);
extern U_Long SYS$CLI(void *, ...);
extern U_Long SYS$FILESCAN(const Dsc *, void *, long *);
-extern void *lib$establish(U_Long (*handler)(void *, void *));
+extern void *LIB$ESTABLISH(U_Long (*handler)(void *, void *));
extern U_Long LIB$SIG_TO_RET(void *, void *); /* condition handler */
/* Cli_Present() - call CLI$PRESENT to determine whether a parameter or */
@@ -43,7 +43,7 @@ U_Long
Cli_Present( const char *item )
{
Dsc item_dsc;
- (void)lib$establish(LIB$SIG_TO_RET);
+ (void)LIB$ESTABLISH(LIB$SIG_TO_RET);
item_dsc.len = strlen(item_dsc.adr = (char *)item);
return CLI$PRESENT(&item_dsc);
@@ -57,7 +57,7 @@ Cli_Get_Value( const char *item, char *result, int size )
Dsc item_dsc, res_dsc;
U_Long sts;
short len = 0;
- (void)lib$establish(LIB$SIG_TO_RET);
+ (void)LIB$ESTABLISH(LIB$SIG_TO_RET);
item_dsc.len = strlen(item_dsc.adr = (char *)item);
res_dsc.len = size, res_dsc.adr = result;
@@ -79,7 +79,7 @@ Cli_Parse_Command( const void *cmd_tables, const char *cmd_verb )
U_Long sts;
int ltmp;
char longbuf[8200];
- (void)lib$establish(LIB$SIG_TO_RET);
+ (void)LIB$ESTABLISH(LIB$SIG_TO_RET);
memset(&cmd, 0, sizeof cmd);
cmd.rqtype = CLI$K_GETCMD; /* command line minus the verb */
diff --git a/vms/vmstest.com b/vms/vmstest.com
index 1b5b7ed9..75a6b460 100644
--- a/vms/vmstest.com
+++ b/vms/vmstest.com
@@ -594,6 +594,8 @@ $
$strftime: echo "strftime"
$ ! this test could fail on slow machines or on a second boundary,
$ ! so if it does, double check the actual results
+$ ! This test needs SYS$TIMEZONE_NAME and SYS$TIMEZONE_RULE
+$ ! to be properly defined.
$!! date | gawk -v "OUTPUT"=_strftime.tmp -f strftime.awk
$ now = f$time()
$ wkd = f$extract(0,3,f$cvtime(now,,"WEEKDAY"))
@@ -601,11 +603,12 @@ $ mon = f$cvtime(now,"ABSOLUTE","MONTH")
$ mon = f$extract(0,1,mon) + f$edit(f$extract(1,2,mon),"LOWERCASE")
$ day = f$cvtime(now,,"DAY")
$ tim = f$extract(0,8,f$cvtime(now,,"TIME"))
-$ tz = f$trnlnm("SYS$TIMEZONE_NAME")
+$! Can not use tz as it shows up in the C environment.
+$ timezone = f$trnlnm("SYS$TIMEZONE_NAME")
$ yr = f$cvtime(now,,"YEAR")
$ if f$trnlnm("FTMP").nes."" then close/noLog ftmp
$ open/Write ftmp strftime.in
-$ write ftmp wkd," ",mon," ",day," ",tim," ",tz," ",yr
+$ write ftmp wkd," ",mon," ",day," ",tim," ",timezone," ",yr
$ close ftmp
$ gawk -v "OUTPUT"=_strftime.tmp -f strftime.awk strftime.in
$ set noOn