In C/C++ programming language, a struct is used to pass the parameter
list to EDGXHINT. Sample code for this purpose is shown in
Figure 1. In this sample, the interface structure itself is
defined in t_interface. Additional structs are used to map the command
buffer (t_comm) and the output buffer (t_outp).
Figure 1. C/C++
sample code for an interface structtypedef struct t_comm // to map the output buffer
{
short com_length; // length of the command
char commandBuffer[255]; // storage to hold the command
};
t_comm commandStrct; // variable of type t_comm
t_comm* commPtr; // pointer to t_comm
typedef struct t_outph // to map the command buffer header
{
long out_length; // length of the output buffer
long out_needed; // output buffer length needed
long out_used; // output buffer length used
};
t_outph outputHeaderStrct; // variable of type t_outph
typedef struct t_outp // to map the output buffer
{
t_outph header; // output buffer header
char outputBuffer[80000]; // storage to hold the output
};
t_outp outputStrct; // variable of type t_outp
t_outp* outputPtr; // pointer to t_outp
typedef struct t_interface // to map the interface structure
{
long function; // function code
t_comm* command_ptr; // pointer to command buffer
t_outp* outputBuf_ptr; // pointer to output buffer
char* messageBuf_ptr1; // pointer to first message buffer
char* messageBuf_ptr2; // pointer to second message buffer
long messageCount; // number of messages returned
void* addr_XAPI; // address of module EDGXAPI
void* addr_MTAB; // address of module EDGMTAB
void* addr_CMSG; // address of module EDGCMSG
long token; // token to identify the request
long returncode; // API return code
long reasoncode; // API reason code
};
t_interface interStruct; // variable of type t_interface
t_interface* pI; // pointer to t_interface