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

SPI Programming in C
SPI Programming Manual427506-006
6-3
Passing Tokens by Value
Performing the initialization this way causes compiler Warning 74: initializer data
truncated. You can ignore the warning; the initialization is performed correctly.
The second way to initialize the structure:
#include stringh
strcpy ( zosi_val_ssid.z_owner, ZSPI_VAL_TANDEM );
strcpy ( zosi_val_ssid.z_number, ZSPI_SSN_ZOSI );
strcpy ( zosi_val_ssid.z_version, ZOSI_VAL_VERSION );
The compiler does not issue a warning if you use this initialization method.
You must enter the names of the values you place in the structure in uppercase
characters.
Passing Tokens by Value
C applications can pass tokens as parameters to the SPI procedures by value only;
passing parameters by reference is not allowed. To allow access to a token map,
which represents an extensible structured token, declare and pass a pointer to the
structure.
Use SSGET, SSMOVE, and SSPUT to pass pointers to token maps. Use SSGETTKN,
SSMOVETKN, and SSPUTTKN to pass token codes.
C Types
The C compiler does not support 64-bit integer values. For information about how to
handle these values in C programs, see the
C/C++ Programmers Guide
.
Interprocess Communication
Requesters written in C can use the tal interface declaration to call the WRITEREAD
file-system procedure. C programs can also use the alternate-model I/O routines that
are described in the
C/C++ Programmers Guide
.
Writing a Server in C
If you are writing a server, you must include #include preprocessor directives for all
the definition files you use, as you would when writing a requester. You must also
declare the SPI buffer and initialize the subsystem ID.
Your subsystem must open $RECEIVE for I/O to receive SPI messages. Use the file-
system procedures READUPDATE and REPLY to read and answer the messages.