Revision: 1038
http://www.exim.org/viewvc/pcre2?view=rev&revision=1038
Author: ph10
Date: 2018-11-09 18:10:25 +0000 (Fri, 09 Nov 2018)
Log Message:
-----------
Update VMS-specific code in pcre2test, on the advice of a VMS user.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/src/pcre2test.c
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2018-10-28 17:27:48 UTC (rev 1037)
+++ code/trunk/ChangeLog 2018-11-09 18:10:25 UTC (rev 1038)
@@ -57,7 +57,9 @@
14. Add a call to pcre2_jit_free_unused_memory() in pcre2grep, for tidiness.
+15. Updated the VMS-specific code in pcre2test on the advice of a VMS user.
+
Version 10.32 10-September-2018
-------------------------------
Modified: code/trunk/src/pcre2test.c
===================================================================
--- code/trunk/src/pcre2test.c 2018-10-28 17:27:48 UTC (rev 1037)
+++ code/trunk/src/pcre2test.c 2018-11-09 18:10:25 UTC (rev 1038)
@@ -157,9 +157,16 @@
#endif
#endif
+/* VMS-specific code was included as suggested by a VMS user [1]. Another VMS
+user [2] provided alternative code which worked better for him. I have
+commented out the original, but kept it around just in case. */
+
#ifdef __VMS
#include <ssdef.h>
-void vms_setsymbol( char *, char *, int );
+/* These two includes came from [2]. */
+#include descrip
+#include lib$routines
+/* void vms_setsymbol( char *, char *, int ); Original code from [1]. */
#endif
/* VC and older compilers don't support %td or %zu. */
@@ -8082,9 +8089,13 @@
break;
}
-/* For VMS, return the value by setting a symbol, for certain values only. */
+/* For VMS, return the value by setting a symbol, for certain values only. This
+is contributed code which the PCRE2 developers have no means of testing. */
#ifdef __VMS
+
+/* This is the original code provided by the first VMS contributor. */
+#ifdef NEVER
if (copytlist[i].type == CONF_FIX || coptlist[i].type == CONF_INT)
{
char ucname[16];
@@ -8094,6 +8105,22 @@
}
#endif
+/* This is the new code, provided by a second VMS contributor. */
+
+ if (coptlist[i].type == CONF_FIX || coptlist[i].type == CONF_INT)
+ {
+ char nam_buf[22], val_buf[4];
+ $DESCRIPTOR(nam, nam_buf);
+ $DESCRIPTOR(val, val_buf);
+
+ strcpy(nam_buf, coptlist[i].name);
+ nam.dsc$w_length = strlen(nam_buf);
+ sprintf(val_buf, "%d", yield);
+ val.dsc$w_length = strlen(val_buf);
+ lib$set_symbol(&nam, &val);
+ }
+#endif /* __VMS */
+
return yield;
}