[Info-vax] Access to _all_ VMS system services and library functions from
Bob Koehler
koehler at eisner.nospam.decuserve.org
Tue Jul 11 09:12:45 EDT 2017
In article <ojs1ge$1nel$1 at gioia.aioe.org>, =?UTF-8?Q?Arne_Vajh=c3=b8j?= <arne at vajhoej.dk> writes:
> Original version was primarily to show item lists working:
>
> $ type itmlst.js
> importClass(Packages.java.lang.System);
>
> function printf() {
> System.out.printf.apply(System.out, arguments);
> }
[...]
bupast>
> 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",
> VMS.MISSING,
> VMS.pass(pid).byReference().readWrite(),
> VMS.MISSING,
> VMS.pass(itmlst).byReference().readOnly(),
> VMS.pass(iosb).byReference().writeOnly(),
> VMS.MISSING,
> VMS.MISSING);
>
> printf("sts=%.0f pid=%d usrnam=%s\n", sts, pid.getValue(),
> VMS.createTrimmedString(usrnamitm.getValue()));
>
> $ jsshell itmlst.js
> sts=1 pid=1072 usrnam=ARNE
>
> Getting rid of the string image name and function name is trivial:
>
> $ type itmlst2.js
> importClass(Packages.java.lang.System);
>
> function printf() {
> System.out.printf.apply(System.out, arguments);
> }
[...]
>
> $ jsshell itmlst2.js
> sts=1 pid=1072 usrnam=ARNE
>
Is this hypothetical, or does such a jshell actuall exisit somewhere?
I'm not in favor of JS as a repalcement of DCL, but I am curious.
More information about the Info-vax
mailing list