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

SPI Concepts and Protocol
SPI Programming Manual427506-006
2-9
Zero-Length Tokens
map and placed in the fields of the structure by the SSNULL and SSGET procedures.
A null value is required for every field of an extensible structured token.
The null value specified in the DDL is a single-byte value, defined either as a character
or as an integer in the range 0 to 255. The SPI procedures form the null value for the
corresponding field by concatenating this single-byte value with itself as many times as
necessary to fill the field. So, the null value in the field is seldom equal to the null value
specified in the DDL. (They are equal only when the field is also 1 byte long.) For
example, a DDL null value of 1 for a 16-bit field results in a structure field null value of
257 (1 << 8 + 1).
Because the null values are generated by repetition of a single-byte value, only some
possible values of the field can be null values. For example, a 16-bit integer field
cannot have 1 as its null value because the value 1 cannot be formed by repeating any
single byte.
The fundamental data structures defined by SPI, and therefore also the data types that
are based on them, all have defined null values. You can override these values when
defining structures based on these data types.
Zero-Length Tokens
A zero-length token has no value and consist of a token code only. Some zero-length
tokens are used as markers or delimiters within a message (ZSPI-TKN-LIST, ZSPI-
TKN-SEGLIST, and ZSPI-TKN-ENDLIST, for example). Other zero-length tokens
function as special operation codes in SPI procedure calls (ZSPI-TKN-DATA-FLUSH
and ZSPI-TKN-CLEARERR, for example).
Header Tokens
SPI messages include a header containing a standard set of information. Some header
token values are set by SSINIT when it initializes the buffer. Some header values can
be set or retrieved using the SSGET and SSPUT procedures.
Header tokens differ from tokens in the body of the message in several ways:
Header tokens are always present in the buffer after it has been initialized.
Header tokens cannot be deleted or flushed from the buffer.
Each header token occurs only once in the buffer.
Header tokens cannot be copied using SSMOVE.
Header tokens cannot be enclosed in a list.
Neither the token codes nor the values of header tokens can be retrieved by
scanning the buffer using the SSGET ZSPI-TKN-NEXTCODE and ZSPI-TKN-
NEXTTOKEN operations.
A program cannot set the current-token pointer to a header token.