[Info-vax] Access to _all_ VMS system services and library functions from DCL ?
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Sat Jul 8 16:09:00 EDT 2017
On 2017-07-07, Arne Vajhøj <arne at vajhoej.dk> wrote:
> On 4/4/2017 2:21 PM, Simon Clubley wrote:
>> This is why there really should be a marshalling system for the types
>> to convert between the DCL types and the VMS native types so you can
>> mostly eliminate this problem. This is also part of why the VMS
>> development process needs an automatic interface generator if you
>> do this.
>>
>> As mentioned in my original post, some aspects might be challenging
>> in DCL as it stands today. For example, how do you marshall an
>> itemlist as seen by DCL into an itemlist directly usable by VMS ?
>>
>> It would be a lot easier if DCL had a lists within lists data
>> structure or a lists within an array data structure. As it
>> stands, you would probably need a new DCL intrinsic to allow
>> you to manually build a usable itemlist from within DCL.
>
> It requires some tweaking, but it is possible.
>
Interesting.
Now we just need a similar process for DCL (or whatever scripting
language is shipped with VMS in the future).
Suggested enhancements in this new future language over the example
below would be to see the reference to SYS$PUBLIC_VECTORS dropped and
SYS$GETJPIW to be changed from a string to a function/method name so
type checking could be done (if the replacement language supported
type checking to this level). This _may_ also mean the parameter
access method would not have to be declared in the code is it is below.
And yes, I know that change means an interface generator is probably
going to be required but I think it would be worth it for robustness
and readability.
Anyway, quite interesting Arne.
Simon.
> $ type itmlst.js
> importClass(Packages.java.lang.System);
>
> function printf() {
> System.out.printf.apply(System.out, arguments);
> }
>
> importClass(Packages.dk.vajhoej.vms.call.VMS);
> importClass(Packages.dk.vajhoej.vms.call.VMSLibrary);
> importClass(Packages.dk.vajhoej.vms.call.IOSB);
> importClass(Packages.dk.vajhoej.vms.call.lib.VMSCodes);
>
> var pid = new VMS.LongWord(0);
> var usrnamitm = new VMS.Item32CharacterStringOut(VMSCodes.JPI$_USERNAME,
> 256);
> var itmlst = new VMS.ItemList32([usrnamitm]);
> var iosb = new VMS.Block(new IOSB());
>
> var sts = VMS.call("SYS$PUBLIC_VECTORS",
> "SYS$GETJPIW",
> VMSLibrary.MISSING,
> VMS.pass(pid).byReference().readWrite(),
> VMSLibrary.MISSING,
> VMS.pass(itmlst).byReference().readOnly(),
> VMS.pass(iosb).byReference().writeOnly(),
> VMSLibrary.MISSING,
> VMSLibrary.MISSING);
>
> printf("sts=%.0f pid=%d usrnam=%s\n", sts, pid.getValue(),
> VMS.createTrimmedString(usrnamitm.getValue()));
>
> $ jsshell itmlst.js
> sts=1 pid=1084 usrnam=ARNE
>
> Arne
>
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
More information about the Info-vax
mailing list