Update VMS-specific code in pcre2test, on the advice of a VMS user.

This commit is contained in:
Philip.Hazel 2018-11-09 18:10:25 +00:00
parent 66cd7df514
commit 900f457222
2 changed files with 31 additions and 2 deletions

View File

@ -57,6 +57,8 @@ units clear.
14. Add a call to pcre2_jit_free_unused_memory() in pcre2grep, for tidiness. 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 Version 10.32 10-September-2018
------------------------------- -------------------------------

View File

@ -157,9 +157,16 @@ patterns. */
#endif #endif
#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 #ifdef __VMS
#include <ssdef.h> #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 #endif
/* VC and older compilers don't support %td or %zu. */ /* VC and older compilers don't support %td or %zu. */
@ -8082,9 +8089,13 @@ if (arg != NULL && arg[0] != CHAR_MINUS)
break; 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 #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) if (copytlist[i].type == CONF_FIX || coptlist[i].type == CONF_INT)
{ {
char ucname[16]; char ucname[16];
@ -8094,6 +8105,22 @@ if (arg != NULL && arg[0] != CHAR_MINUS)
} }
#endif #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; return yield;
} }