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

General SPI Programming Guidelines
SPI Programming Manual427506-006
5-24
Using the SPI Standard DDL Definitions
Possible values for any enumerated-type tokens or fields
Structure definitions for all extensible structured tokens
Token codes for all simple tokens
Token maps for all extensible structured tokens
You can also include any other definitions that might be of use to requester programs
sending commands to your subsystem.
Using the SPI Standard DDL Definitions
When beginning to code your definition files, print a copy of the ZSPIDEF.ZSPIDDL file
from the disk volume chosen by your site. The DDL definitions in this file provide a
starting point for your subsystem-specific definitions. Use these definitions or build on
them whenever possible. Assume that these definitions are known; do not repeat them
in your own definition files.
This file is also a useful guide in coding the DDL for your own definitions. For further
guidance, print the DDL definition files for one or more NonStop Kernel subsystems
(which have names of the form
ZSPIDEF.subsysDDL). The SPI definition file includes
some types of declarations, such as token data types, that subsystems do not need to
provide. In addition, the subsystem definition files contain some other declarations
such as command numbers, object-type numbers, and token maps not included in
the SPI definition file.
The ZSPIDEF.ZSPIDDL file begins with structure declarations for some simple tokens.
For sample definitions for extensible structured tokens, see the DDL definition file for
one of the NonStop Kernel subsystems.
Token codes are declared using TOKEN-CODE statements. Token maps are declared
with TOKEN-MAP statements. The subsystem ID, the buffer, and structure definitions
are declared using DEF statements. All other items are simple constants, suited to
CONSTANT declarations. For the syntax of these DDL statements, see the
Data
Definition Language (DDL) Reference Manual
.
Suggestions on Data Representation
Each of the four programming languages that support SPI (TAL, C, COBOL, and
TACL) lacks support for certain data types. These guidelines minimize the problems
that might arise when applications written in these languages send commands to your
subsystem. These guidelines apply both to the data types of fields in structures and to
the data types of individual tokens:
Signed 16-bit and 32-bit integers are valid in all four languages. However, signed
64-bit integers are valid only in TAL, COBOL, and TACL. C for NonStop systems
does not support signed 64-bit integers.
Unless there is a good reason to do otherwise, pass unsigned 16-bit integers in 32-
bit signed integer fields, and pass 8-bit integers in signed 16-bit integer fields. This