TS/MP 2.5 Management Programming Manual

NOTE: When changing the definition of an associative server, make sure you make the
changes everywhere the associative server is defined. Otherwise, you cannot be sure that the
new definition is implemented or permanent.
Writing C Programs
This subsection contains special considerations for writing C programs.
Building the DDL Dictionary
The DDL command ?CFIELDALIGN_MATCHED2 allows the DDL compiler to generate C data
structures starting on byte boundaries. Always issue this command before you start building the
DDL dictionary from the ZSPIDDL, ZEMSDDL, and ZPWYDDL files.
Generating the ZPWYC Include File
Under certain conditions, the DDL compiler introduces an extra level in the structure definitions in
the ZPWYC file. If any C compiler errors indicate a problem with the structure fields, make sure
the structure definition in the ZPWYC file matches the structure used in the program.
Issuing Commands to PATHMON
Use the WRITEREADX procedure (not the WRITEREAD procedure) to send commands and receive
responses; it provides a 32-bit value for the address of the command buffer (which you allocate
using the MALLOC function).
Receiving String Values in Responses
Always terminate all string values with a null character before using them. All string manipulating
functions in C require that strings are terminated by a null character. However, string values retrieved
from a response buffer might not always be terminated as expected. Failure to add a null character
to the end of a string value results in problems that are difficult to detect.
CAUTION: Data is often structured. When putting a null character at the end of a string field,
be careful not to corrupt subsequent data.
Command Presentation
In these sections, information on each command and the associated object type includes:
A description of the command and the effect
Information on continuation
A syntax box listing:
The command token (the symbolic name for the command number)
The object-type token (the symbolic name for the object type accepted by the command)
Tokens in the command buffer that are specific to the command. For token descriptions,
see “SPI and EMS Standard Definitions” (page 50) through “ZPWY-MAP- Definitions”
(page 75).
Tokens in the response buffer that are specific to the command. For token descriptions,
see “SPI and EMS Standard Definitions” (page 50) through “ZPWY-MAP- Definitions”
(page 75)ns.
A description of each command and response token listed in the syntax box in the same order
in which it appears (tokens used in more than one command are described in “SPI and EMS
Standard Definitions” (page 50)).
48 SPI Programming Considerations