[Info-vax] Access to _all_ VMS system services and library functions from DCL ?

Arne Vajhøj arne at vajhoej.dk
Fri Jul 7 17:03:49 EDT 2017


On 4/4/2017 2:21 PM, Simon Clubley wrote:
> On 2017-04-03, Arne Vajhøj <arne at vajhoej.dk> wrote:
>> On 4/2/2017 9:02 PM, terry-groups at glaver.org wrote:
>>> On Sunday, April 2, 2017 at 8:25:08 PM UTC-4, Simon Clubley wrote:
>>>> Is there any interest in getting access to _all_ the VMS system
>>>> services and library functions directly from DCL ?
>>>
>>> I seem to recall this being a wishlist / SIR from a very long time
>>> ago. Does anybody remember what DEC's response to it was? [Impossible
>>> for some reason(s) vs. too much work, for example.]
>>
>> I think that the functions could be divided into 3 categories:
>> * those that are perfect fit for DCL
>> * those that could be implemented but the API really should be changed
>>     to make sense in DCL
>> * those that would be impossible or at leasr very cumbersome to
>>     implement in DCL due to DCL being too high level
>>
> 
> 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.

$ 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




More information about the Info-vax mailing list