diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2018-11-09 18:10:25 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2018-11-09 18:10:25 +0000 |
commit | f1dd223469f0ba82f9070a8c6e70c8acabbb1c60 (patch) | |
tree | 25905a52891ccae6ccc44f8b7784b5018bff892f /src/pcre2test.c | |
parent | e518cd7cb8e57bbf87f7f8f6909cfed8a2d6079a (diff) | |
download | pcre2-f1dd223469f0ba82f9070a8c6e70c8acabbb1c60.tar.gz |
Update VMS-specific code in pcre2test, on the advice of a VMS user.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1038 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'src/pcre2test.c')
-rw-r--r-- | src/pcre2test.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/pcre2test.c b/src/pcre2test.c index 1944e32..448ad4b 100644 --- a/src/pcre2test.c +++ b/src/pcre2test.c @@ -157,9 +157,16 @@ patterns. */ #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 @@ if (arg != NULL && arg[0] != CHAR_MINUS) 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 @@ if (arg != NULL && arg[0] != CHAR_MINUS) } #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; } |