SPI Programming Manual (G06.24+, H06.03+, J06.03+)

SPI Programming in TAL
SPI Programming Manual427506-006
9-3
Interprocess Communication
Your TAL module must include this source directive and declaration:
?SOURCE subsysTAL
.
.
INT .user^chosen [0:subsys^MAP^name^WLN-1] := subsys^MAP^name ;
This code declares user^chosen and initializes it with the proper value for the token
map. Then you can refer to
user^chosen as the token code in SPI calls such as
SSPUT and SSGET to operate on
subsys-MAP-name tokens.
Interprocess Communication
An application requester written in TAL should use the file-system procedure
WRITEREAD, rather than WRITE, to send the command. The program should specify
a read count that is the length of the buffer as initialized with SSINIT.
If the subsystem to which you are sending commands honors assign and param
messages, and you want to allow the user of your application to provide these to the
server, your application must explicitly save these messages and pass them on.
Subsystems written in TAL should open $RECEIVE to receive SPI messages, and
then use READUPDATE to read the messages and REPLY to send the replies.
SPI Procedure Syntax in TAL
These pages give the syntax and semantics of the SPI procedures SSGET and
SSGETTKN, SSINIT, SSMOVE and SSMOVETKN, SSNULL, and SSPUT and
SSPUTTKN. For descriptions of the SPI procedures and their parameters, see
Section 3, The SPI Procedures
.
Passing Token Parameters by Value or by Reference
The way your TAL applications pass tokens as parameters to the SPI procedures
depends on the token and on personal preference: You must pass token maps, which
refer to extensible structured tokens, by reference. Pass token codes by value or by
reference. (Passing a token code by reference usually requires storing it in a temporary
variable.)
Use the SSGET, SSMOVE, and SSPUT procedures to pass the
token-id parameter
by reference; use the SSGETTKN, SSMOVETKN, and SSPUTTKN procedures to pass
it by value.
If you bind into the system library any routines that use SSGETTKN, SSPUTTKN, or
SSMOVETKN, the Binder issues parameter mismatch warnings in SYSGEN. You can
ignore these warnings. To eliminate them, use SSGET, SSPUT, and SSMOVE.