2. OpenAPI Function Reference : OpenAPI Functions : IIapi_setEnvParam() Function--Assign an Environment Parameter and Value in Environment Handle : Environment Parameter IIAPI_EP_CAN_PROMPT
 
Share this page                  
Environment Parameter IIAPI_EP_CAN_PROMPT
An application can set IIAPI_EP_CAN_PROMPT in the IIapi_setEnvParam() function by providing the address of an application function to call back. OpenAPI invokes this application function to receive a reply from the application for the prompt message from the server using the following C structure:
typedef struct _IIAPI_PROMPTPARM
{
       II_PTR       pd_envHandle;
       II_PTR       pd_connHandle;
       II_LONG      pd_flags;
       II_LONG      pd_timeout;
       II_UINT2     pd_msg_len;
       II_CHAR      *pd_message;
       II_UINT2     pd_max_reply;
       II_LONG      pd_rep_flags;
       II_UINT2     pd_rep_len;
       II_CHAR      *pd_reply;
} IIAPI_PROMPTPARM;
The syntax of the application function is as follows:
II_VOID promptFunc(IIAPI_PROMPTPARM *parm);
The application must invoke IIapi_setEnvParam() by setting se_paramID to IIAPI_EP_CAN_PROMPT and se_paramValue to the address of an application-supplied function that matches the calling sequence of the promptFunc() template function shown.
The IIAPI_PROMPTPARM parameters are described in the following table:
pd_envHandle
Type: input
Specifies the environment handle associated with the connection. It is NULL if the connection belongs to the default environment associated with IIAPI_VERSION_1 applications.
pd_connHandle
Type: input
Specifies the connection handle identifying the connection.
pd_flags
Type: input
Specifies the prompt flags. Its value is one of the following:
IIAPI_PR_NOECHO
IIAPI_PR_TIMEOUT
IIAPI_PR_NOECHO will be set if user input should not be echoed, generally indicating a request for a password. IIAPI_PR_TIMEOUT will be set if the pd_timeout parameter has a valid value.
pd_timeout
Type: input
Specifies the maximum time, in seconds, to wait for user input. Ignore this parameter if IIAPI_PR_TIMEOUT is not set in pd_flags.
Support for timeouts is platform-dependent.
pd_msg_len
Type: input
Specifies the length of the prompt message in pd_message.
pd_message
Type: input
Specifies the message to be displayed when prompting for user input.
pd_max_reply
Type: input
Specifies the maximum length of user input to be returned in pd_reply.
pd_rep_flags
Type: output
Specifies the response flags. The valid value is IIAPI_REPLY_TIMEOUT. Set this value if timeout occurred waiting for user response. (See IIAPI_PR_TIMEOUT in the pd_flags description.)
pd_rep_len
Type: output
Specifies the length of the user response in pd_reply.
pd_reply
Type: output
Specifies the user response.