Using SPI
Using Programmatic Interfaces
107365 Tandem Computers Incorporated
7–9
If the data type of a token is any other than those already listed, the token value is
represented by a space-separated list m/n items, where m is the actual length of the
token and n is the basic length of the token data type. If the actual token length is not
evenly divisible by the basic data-type length, the last bytes cannot be set or seen.
TACL shows each item in its usual external representation.
All elements pertaining to the Subsystem Programmatic Interface are described in
detail in the Distributed Systems Management (DSM) Programming Manual.
Using SPI Functions
The following definition, when used with #EXTRACT(V), allows you to extract fields
from a subsystem ID:
?SECTION template STRUCT
BEGIN
SSID
ss;
STRUCT
z_ssid REDEFINES ss;
BEGIN
CHAR
z_owner (1:8);
INT
z_number;
UINT
z_version;
END;
END;
#DEF ss1 STRUCT LIKE template;
Use the code in Figure 7-1,
same_ssid
, to compare two subsystem IDs returned by
#SSGETV with ZSPI^TKN^NEXTCODE or ZSPI^TKN^NEXTTOKEN. The code uses
the
template
STRUCT defined under “Defining an SPI Buffer,” earlier in this section,
and ignores the version field. To invoke this routine, load the file and type:
SAME_SSID
ssid1 ssid2
Figure 7-1. Comparing Two Subsystem IDs
?SECTION same_ssid ROUTINE
#FRAME
#PUSH sstext
#DEF ss1 STRUCT LIKE template;
#DEF ss2 STRUCT LIKE template;
#IF {SINK} [#ARGUMENT / VALUE sstext/ SUBSYSTEM]
#SET ss1 [sstext]
#IF {SINK} [#ARGUMENT / VALUE sstext/ SUBSYSTEM]
#SET ss2 [sstext]
#RESULT [#COMPUTE
[#COMPAREV
ss1:z_ssid:z_owner(1:8)
ss2:z_ssid:z_owner(1:8)]
AND
[#COMPAREV ss1:z_ssid:z_number
ss2:z_ssid:z_number] ]
#UNFRAME