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:
EIM_HANDLE_CCSID (0) This is the CCSID of character data passed by the caller of EIM APIs using the specified EimHandle. This field is a 4 byte integer. When a handle is created, this is set to the job default CCSID.
- 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.
EIMERR_NOLOCK (26) Unable to allocate internal system object.
- EINVAL
- Input parameter was not valid.
EIMERR_ATTR_INVAL (5) Attribute name is not valid. EIMERR_CCSID_INVAL (8) CCSID is outside of valid range or CCSID is not supported. 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.
- ENOTSUP
- Attribute type is not supported.
EIMERR_ATTR_NOTSUPP (6) Attribute not supported.
- EUNKNOWN
- Unexpected exception.
EIMERR_UNKNOWN (44) Unknown error or unknown system state.
Related Information
- eimCreateHandle()--Create an EIM
Handle
- eimDestroyHandle()--Destroy an EIM
Handle
- eimGetAttribute()--Get EIM Attributes
- eimConnectToMaster()--Connect to EIM
Master Domain
- eimConnect()--Connect to EIM Domain
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 ]