Compaq AAPVNFGTE Computer Accessories User Manual


 
2.4.2 ACMSDI_WORKSPACE_OPT Structure
The ACMSDI.H file contains the definition of the ACMSDI_WORKSPACE_OPT
type you use to declare workspaces passed to tasks using the ACMSDI_CALL_
TASK service. You can use ACMSDI_WORKSPACE_OPT instead of ACMSDI_
WORKSPACE. Only task calls that use the ACMSDI_TASK_OPTIONS flag to
indicate unidirectional workspaces can use this structure. Example 2–3 shows
the ACMSDI_WORKSPACE_OPT type definition and the definition of a macro
to initialize the workspace structure.
Example 2–3 ACMSDI_WORKSPACE_OPT Type Definition
#define ACMSDI_ACCESS_READ ’1’ /* read-only access */
#define ACMSDI_ACCESS_WRITE ’2’ /* write-only access */
#define ACMSDI_ACCESS_MODIFY ’3’ /* modify (read and write) */
.
.
.
typedef char ACMSDI_ACCESS_TYPE;
typedef struct {
unsigned int length;
ACMSDI_ACCESS_TYPE access;
void *data;
} ACMSDI_WORKSPACE_OPT;
.
.
.
#define ACMSDI_INIT_WORKSPACE_OPT(_wksp, _rec, _access)\
{\
_wksp.length = sizeof(_rec);\
_wksp.access = _access;\
_wksp.data = &(_rec);\
}
To pass more than one workspace to a procedure, use an array of the type
ACMSDI_WORKSPACE_OPT. Example 2–4 passes two workspaces.
Example 2–4 Passing Two Workspaces
ACMSDI_WORKSPACE_OPT wksp_array[2];
struct {
char ctrl_key[5];
char error_message[80];
} control_wksp;
(continued on next page)
2–6 TP Desktop Connector Portable API Client Services