SCSI Pass-Through Programmer's Guide

Appendix B
A simple modcal program to invoke HPLDEVTOIOPATH
{
File: xldevtoiop
This program accepts an LDEV number and returns its I/O path. The path is returned
in an array of 32 characters. The I/O path returned is followed by spaces and hence
may need trimming before use.
Steps to link and add capabilities:
1. PASXL xld2iop, yld2iop
2. link yld2iop, eld2iop; cap=ba,ia,pm,ph
}
$standard_level 'ext_modcal'$
program testldevtoiopath(input,output);
type
pac32_t = packed array[1..32] of char;
ldev_type = bit16;
hpe_status = record
case boolean of
true : (all : integer);
false: (status : shortint;
subsys : shortint);
end;
var
path : pac32_t;
ldev : ldev_type;
status : hpe_status;
procedure hpldevtoiopath (
ldev : ldev_type;
var iopath : pac32_t;
var status : hpe_status);external;
begin
try
path := '';
status.all := 0;
writeln('Enter LDEV number: ');
read(ldev);
hpldevtoiopath(ldev,path,status);
if (status.all = 0) then
writeln('The I/O path is: ',path)
else
writeln('Error status - Info: ',status.status,
' ,Subsys: ',status.subsys);
recover
begin
status.all := escapecode;
writeln('Error status- Info: ',status.status,
' ,Subsys: ',status.subsys);
end;
end.
- 23 -