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

SPI Concepts and Protocol
SPI Programming Manual427506-006
2-20
Segment Lists
Segment Lists
SPI servers use segment lists to build segmented responses. Tokens in a segmented
response are divided into repeating and nonrepeating groups, and each repeating
group is enclosed in a segment list. For more information, see Segmented Responses
on page 2-38. A segment list consists of all tokens between ZSPI-TKN-SEGLIST and
the corresponding ZSPI-TKN-ENDLIST.
Generic Lists
Generic lists are provided for use in customer-developed subsystems. NonStop Kernel
subsystems provided by HP do not use generic lists in commands or responses. An
SPI server can use generic lists whenever necessary to organize response tokens. A
generic list consists of all tokens between ZSPI-TKN-LIST and the corresponding
ZSPI-TKN-ENDLIST.
Pointer Manipulation and Lists
Figure 2-5 on page 2-22 demonstrates how basic procedure calls affect the buffer
pointers when working in and around lists. It shows a sequence of procedure calls and
the resulting pointer changes. Although the figure shows a data list, the demonstrated
behavior applies to all list types:
1. The data portion of the buffer contains eight tokens (T1T6, ZSPI-TKN-
DATALIST, and ZSPI-TKN-ENDLIST) with tokens T3, T4, and T5 in the data list.
The SSPUT special operation ZSPI-TKN-RESET-BUFFER resets both the current-
token and next-token pointers to the beginning of the buffer. The current-list pointer
remains null until a list is selected.
2. The first SSGET call retrieves token T1.
3. The second SSGET call retrieves token T2.
4. The third SSGET call asks for token T3. Because SSGET cannot access tokens
within a list until the corresponding list token is selected, the token is not found.
ZSPI-ERR-MISTKN is returned and the pointers are unchanged.
5. The fourth SSGET call enters the data list by selecting the list token. The current
list pointer is now defined, and the current-token and next-token pointers point to
ZSPI-TKN-DATALIST. SSGET can now retrieve tokens from inside the list.
6. Now that the list has been selected, SSGET can retrieve token T3 from in the list.
The current-token and next-token pointers are updated in the list.
7. The next SSGET call retrieves token T5 from in the list.
8. The seventh SSGET call asks for token T6, which is in the buffer but not in the
current list. SSGET returns ZSPI-ERR-MISTKN, and the pointers are unchanged.
9. The next SSGET call exits from the list by selecting the end list token ZSPI-TKN-
ENDLIST.