2. OpenAPI Function Reference : Generic Parameters
Share this page                  
Generic Parameters
Each OpenAPI function parameter block has a common substructure. This substructure contains generic parameters for handling asynchronous processing and for communicating the return status of the OpenAPI function.
The substructure is the first element in most parameter blocks:
typedef struct _IIAPI_GENPARM
      II_VOID      (II_FAR II_CALLBACK *gp_callback)
                   (II_PTR closure, II_PTR parmBlock);
      II_PTR        gp_closure;
      II_BOOL       gp_completed;
      IIAPI_STATUS  gp_status;
      PTR           gp_errorHandle;
The generic parameters common to each OpenAPI function are as follows:
Type: input
The address of the application function to be invoked when the OpenAPI function completes its tasks, or NULL. If this parameter is NULL, the application can poll for completion by examining gp_completed; otherwise, it must be an address to the callback with the following syntax:
II_EXTERN II_VOID II_FAR II_CALLBACK callback (II_PTR closure, II_PTR parmBlock);
Type: input
The value of the input argument to the function addressed by gp_callback. OpenAPI does not interpret the value of this parameter, but simply passes it to the callback function unchanged. The application uses this parameter to pass any information it wishes to the callback.
Type: immediate and delayed output
The indication that the task has been completed and the callback function has been invoked. If so, this parameter is TRUE; otherwise, it is FALSE.
Type: delayed output
The status of the OpenAPI function upon its completion.
The following value is returned if the function completes without an error:
The following values indicate that a message (including which type of message) was returned by the server; the message information is available through gp_errorHandle:
The following value is returned when a function that normally returns information has nothing to return:
The following value is returned for general failures, which may have additional information available through gp_errorHandle:
The following values are returned when the OpenAPI is unable to provide additional information because of the error:
Type: delayed output
Additional information associated with the completion of the OpenAPI function. If non-NULL, this parameter will be a handle that can be passed to IIapi_getErrorInfo(). If NULL, no additional information is available.