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

SPI Programming Manual427506-006
6-1
6 SPI Programming in C
This section provides language-specific information for the programmer who is using C
to write an SPI requester or server:
Definition Names in C
Symbolic names in this section are in the C form, using underscore (_) symbols rather
than hyphens. For example, the DDL token code ZSPI-TKN-RETCODE is expressed
as ZSPI_TKN_RETCODE in C.
C Definition Files
Each C module of your application that uses the SPI must begin with #include
preprocessor directives to include the C versions of the SPI standard definitions and
the definitions for all subsystems with which your program communicates. The C
version of the SPI standard definitions is in the file named ZSPIDEF.ZSPIC on the disk
volume chosen by your site. For NonStop Kernel subsystems, the C versions of the
subsystem definitions have file names of the form ZSPIDEF.
subsysC, where subsys
is the 4-character subsystem abbreviation given in Appendix D, NonStop Kernel
Subsystem Numbers and Abbreviations.
You must write
#include directives to read these definition files:
ZSPIDEF.ZSPIC SPI standard definitions
ZSPIDEF.ZEMSC EMS standard definitions
ZSPIDEF.ZCOMC Extended SPI standard definitions
ZSPIDEF.ZCMKC
ZSPIDEF.ZCDGC
ZSPIDEF.subsysC Standard definitions for each subsystem
. your program communicates with
.
.
ZSPIDEF.subsysC
Topic Page
Definition Names in C
6-1
C Definition Files 6-1
Declarations Needed in C Programs 6-2
Interprocess Communication 6-3
Writing a Server in C 6-3
SPI Procedure Syntax in C 6-4