Execute a registered procedure.
CS_RETCODE srv_regexec(spp, infop)
SRV_PROC *spp; CS_INT *infop;
A pointer to an internal thread control structure.
A pointer to a CS_INT. Table 3-97 describes the possible values returned in *infop if srv_regexec returns CS_FAIL:
Value |
Description |
---|---|
SRV_I_PNOTKNOWN |
The procedure is not registered. |
SRV_I_PPARAMERR |
There is a parameter error. |
SRV_I_PNOTIFYERR |
An error occurred while sending notifications. |
Returns |
To indicate |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
#include <ospublic.h>
/*
** Local Prototype
*/
CS_RETCODE ex_srv_regexec PROTOTYPE((
SRV_PROC *spp,
CS_INT &infop
));
/*
** EX_SRV_REGEXEC
**
** Example routine to complete the execution of a registered
** procedure using srv_regexec. This routine should be called
** after srv_reginit and srv_regparam.
**
** Arguments:
** spp A pointer to an internal thread control structure.
** infop A return pointer to an integer containing more
** descriptive error information if this routine
** returns CS_FAIL.
**
** Returns:
** CS_SUCCEED Registered procedure executed successfully.
** CS_FAIL Registered procedure not executed, or
** notifications not completed successfully.
*/
CS_RETCODE ex_srv_regexec(spp, infop)
SRV_PROC *spp;
CS_INT &infop;
{
/* Initialization. */
&infop = (CS_INT)0;
/* Execute the procedure. */
if (srv_regexec(spp, infop) != CS_SUCCEED)
{
/*
** Open Server has set the argument to a specific
** error.
*/
return(CS_FAIL);
}
return(CS_SUCCEED);
}
srv_regexec executes a registered procedure.
The procedure name and its parameters must be specified with srv_reginit and srv_regparam before calling srv_regexec.
WARNING! Open Server system registered procedures send a final DONE. If an application executes a system registered procedure from an event handler using srv_regexec, the application must not send a final DONE from the event handler code. Doing so will cause Open Server to raise a state error.