eimDestroyHandle()--Destroy an EIM Handle


  Syntax
 #include <eim.h>

 int eimDestroyHandle(EimHandle      * eim,
          EimRC          * eimrc)

 
  Service Program Name: QSYS/QSYEIM

  Default Public Authority: *USE

  Threadsafe: Yes

The eimDestroyHandle() function is used to deallocate an EimHandle structure. This will close any EIM connections for this handle.



Authorities and Locks

None.


Parameters

eim  (Input)
The EIM handle returned by a previous call to eimCreateHandle().

eimrc  (Input/Output)
The structure in which to return error code information. If the return value is not 0, eimrc is set with additional information. This parameter may be NULL. For the format of the structure, see EimRC--EIM Return Code Parameter.

Return Value

The return value from the API. Following each return value is the list of possible values for the messageCatalogMessageID field in the eimrc parameter for that value.

0
Request was successful.

EBADDATA
eimrc is not valid.

EBUSY
Unable to allocate internal system object.

EIMERR_NOLOCK (26) Unable to allocate internal system object.

EINVAL
Input parameter was not valid.

EIMERR_HANDLE_INVAL (17) EimHandle is not valid.
EIMERR_PARM_REQ (34) Missing required parameter. Please check API documentation.
EIMERR_PTR_INVAL (35) Pointer parameter is not valid.

EUNKNOWN
Unexpected exception.

EIMERR_UNKNOWN (44) Unknown error or unknown system state.

Related Information


Example

See Code disclaimer information for information pertaining to code examples.

The following example destroys an EIM handle.

#include <eim.h>

int main(int argc, char *argv[])
{
    int           rc;
    char          eimerr[100];
    EimRC       * err;
    EimHandle   * handle;


    /* Get eim handle from input arg.           */
    handle = (EimHandle *)argv[1];

    /* Set up error structure.                  */
    memset(eimerr,0x00,100);
    err = (EimRC *)eimerr;
    err->memoryProvidedByCaller = 100;

    /* Destroy the handle                       */
    if (0 != (rc = eimDestroyHandle(handle,
                                    err)))
        printf("Destroy handle error = %d", rc);

    return 0;
}


API introduced: V5R2
Top | Security APIs | APIs by category