IBM Version 4 Universal Remote User Manual


 
The number of variable-length records field 3 is the first 4 bytes, and this field
tells the API how many variable-length records have been specified. The fields
defined in 4 are repeated (contiguously) immediately following the number of
variable-length records for each record that is sent to the API. The API gets to
each variable-length record by using the length of variable-length record field to get
to the next record, up to and including the number of records specified.
The variable-length record structures are defined in the qus.h header file (this
C-language header file is included by the qusrgfa1.h header file). The 4-field
variable-length record is defined as:
typedef _Packed struct Qus_Vlen_Rec_4 {
int Length_Vlen_Record;
int Control_Key;
int Length_Data;
/ᑍchar Data[];ᑍ/ /ᑍ Varying length field ᑍ/
} Qus_Vlen_Rec_4_t;
Because the data field is a varying-length field, it needs to be defined in a new
structure.
Type Field
BINARY(4) Length of variable-length record
BINARY(4) Exit program attribute key
BINARY(4) Length of data
CHAR(*) Data
Exit Program Attribute Keys
The Add Exit Program API has several exit program attributes that can be set. The
following table shows the valid exit program attribute keys for the key field area of
the variable-length record.
This example specifies only two attribute keys (replace_rec and CCSID_rec fields)
and lets the remaining attribute keys be set by the API to the default value. When
working with variable-length structures, each variable-length record must start on a
4-byte boundary alignment. (The 4-byte boundary alignment requirement is only
true for the registration facility APIs, not all keyed APIs.) The following new struc-
ture becomes the exit program attributes parameter on the call to the Add Exit
Program API:
typedef struct {
int num_rec;
Qus_Vlen_Rec_4_t replace_rec;
char replace;
char Reserved[3];
Key Type Field
1 CHAR(27) Qualified message file name and message identifier for exit
program description
2 CHAR(50) Exit program text description
3 BINARY(4) Exit program data CCSID
4 CHAR(1) Replace
4-4 System API Programming V4R1