Compaq AAPVNFGTE Computer Accessories User Manual


 
Example 2–4 (Cont.) Passing Two Workspaces
struct {
int id_number;
char first_name[15];
char last_name[25];
} employee_record;
ACMSDI_INIT_WORKSPACE_OPT (wksp_array[0], control_wksp, ACMSDI_ACCESS_READ);
ACMSDI_INIT_WORKSPACE_OPT (wksp_array[1], employee_record, ACMSDI_ACCESS_WRITE);
2.4.3 ACMSDI_WORKSPACE_BIND Structure
The ACMSDI_WORKSPACE_BIND structure locates workspace buffers
and specifies the sizes of workspaces during acmsdi_bind_request_wksps
operations. Like the ACMSDI_FORM_RECORD_BIND structure, the
ACMSDI_WORKSPACE_BIND structure contains a field where the length
of the TDMS exchange step workspace is returned. If the length differs from
the buffer length, TP Desktop Connector truncates the resultant workspaces or
buffers are not completely filled.
The following example shows the C language definition of this structure as it
appears in the acmsdi.h file:
typedef struct {
unsigned int buffer_len; /* length of caller’s buffer */
unsigned int wksp_len; /* actual length of the workspace */
void *data;
} ACMSDI_WORKSPACE_BIND;
2.4.4 ACMSDI_FORM_RECORD_BIND Structure
The ACMSDI_FORM_RECORD_BIND structure locates form record buffers
and specifies their sizes during acmsdi_bind_send_recs and acmsdi_bind_
receive_recs operations. ACMSDI_FORM_RECORD_BIND serves the same
purpose as ACMSDI_FORM_RECORD with one additional feature. It contains
an additional field, rec_len, with which the TP Desktop Connector client
services return the actual length of the form record as it is returned from
the back-end application. You can compare this length against the client
application buffer length to see if the buffer is large enough, too large, or
exactly the right size to contain the form record. If the buffer size is too small,
the form record is truncated to fit the buffer. If the buffer size is too large, the
buffer is not completely filled.
TP Desktop Connector Portable API Client Services 2–7