IBM Version 4 Universal Remote User Manual


 
Receiver Variables—Examples
As discussed in “Receiver Variables” on page 2-23, receiver variables are generally
used by retrieve APIs to return information to a caller. This topic provides coding
examples of repeating entry types and of the use of offsets to go from one entry to
the next in the receiver variable.
Repeating Entry Type with Fixed-Length Fields—Example
In the following example, the EXTI0100 format is defined in the qusreg.h header
file, which is included by the qusrgfa2.h header file in the QSYSINC library.
This format is of the repeating entry type with all fixed-length fields. The repeating
portion of the format (Qus_EXTI0100_Entry_t) is repeated after the fixed portion.
The fixed portion of the format (Qus_EXTI0100_t) is returned only once. To go
from one entry to the next, you add the offset exit point entry field to the starting
position of the receiver variable to get to the first entry. Add the length exit point
entry field to the current position in the receiver variable to move to the subsequent
entries.
typedef _Packed struct Qus_EXTI1_Entry {
char Exit_Point_Name[2];
char Format_Name[8];
int Max_Exit_Programs;
int Number_Exit_Programs;
char Allow_Deregistration;
char Allow_Change_Control;
char Registered_Exit_Point;
char Prep_Name_Add_Pgm[1];
char Prep_Lib_Add_Pgm[1];
char Prep_Format_Add[8];
char Prep_Name_Rmv_Pgm[1];
char Prep_Lib_Rmv_Pgm[1];
char Prep_Format_Rmv[8];
char Prep_Name_Rtv_Info[1];
char Prep_Lib_Rtv_Info[1];
char Prep_Format_Rtv[8];
char Desc_Indicator;
char Desc_Msg_File[1];
char Desc_Msg_Library[1];
char Desc_Msg_Id[7];
char Text_Description[5];
/ᑍchar Reserved[];ᑍ/
} Qus_EXTI1_Entry_t;
typedef _Packed struct Qus_EXTI1 {
int Bytes_Returned;
int Bytes_Available;
char Continue_Handle[16];
int Offset_Exit_Point_Entry;
int Number_Points_Returned;
int Length_Exit_Point_Entry;
/ᑍchar Reserved[];ᑍ/
/ᑍQus_EXTI1_Entry_t Array[];ᑍ/
} Qus_EXTI1_t;
Chapter 4. Common Information across APIs—Advanced (ILE) Example 4-7