eimSetAttribute()--Set EIM Attributes


  Syntax
 #include <eim.h>

 int eimSetAttribute(EimHandle          * eim,
                     enum EimHandleAttr   attrName,
                     void               * attrValue,
                     EimRC              * eimrc)
  Service Program Name: QSYS/QSYEIM

  Default Public Authority: *USE

  Threadsafe: Yes

The eimSetAttribute() function is used to set attributes in the EIM handle structure.



Authorities and Locks

None.


Parameters

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

attrName  (Input)
The name of the attribute to set. This parameter is passed by value. Following are valid values:


attrValue  (Input)
A pointer to the attribute value.

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.


EINVAL
Input parameter was not valid.


ENOTSUP
Attribute type is not supported.


EUNKNOWN
Unexpected exception.


Related Information


Example

The following example will set the CCSID attribute in the EIM handle.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

#include <eim.h>
#include <stdio.h>

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

    /* Get eim handle from input arg.           */
    /* This handle is already connected to EIM. */
    handle = (EimHandle *)argv[1];

    /* Set up error structure.                  */
    memset(eimerr,0x00,100);
    err = (EimRC *)eimerr;
    err->memoryProvidedByCaller = 100;
    
    /* Change the CCSID for this handle.        */
    if (0 != (rc = eimSetAttribute(handle,
                                   EIM_HANDLE_CCSID,
                                   (void *)&ccsid,
                                   err)))
        printf("Set Attribute error = %d", rc);

    return 0;
}


API introduced: V5R2

[ Back to top | Security APIs | APIs by category ]