The following code fragment from example.h shows how the data types are used to declare the variables that contain the output parameters from the XDS API function calls.
int main(void)
{
DS_status error; /* return value from DS functions */
OM_return_code return_code;/* return value from OM functions */
OM_workspace workspace; /* workspace for objects */
OM_private_object session; /* session for directory operations */
OM_private_object result; /* result of read operation */
OM_sint invoke_id; /* Invoke-ID of the read operation */
The code fragment shows the following:
· The ds_initialize( ) call returns a variable of type OM_workspace that contains a handle or pointer to a workspace.
· The ds_bind( ) call returns a pointer to a variable of type OM_private_object. The private object contains the session information required by all subsequent XDS API calls, except ds_shutdown( ).
· The ds_read(~) call returns a pointer to the result of a directory read request in a variable of type OM_private_object.
· The error handing macros CHECK_DS_CALL and CHECK_OM_CALL, defined in the example.h header file, use the data types DS_status and OM_return_code, respectively, as return values from XDS and XOM API function calls.