Return the owner component of the current remote procedure call’s designation.
CS_CHAR *srv_rpcowner(spp, lenp)
SRV_PROC *spp; CS_INT *lenp;
A pointer to an internal thread control structure.
A pointer to a buffer that will contain the length of the owner name. lenp can be NULL, in which case the length of the database owner is not returned.
Returns |
To indicate |
---|---|
A pointer to the null terminated owner component of the current RPC’s designation. |
The location of the database component of the current RPC’s designation. |
A null pointer |
There is no current RPC. Open Server sets lenp to -1 and raises an informational error. |
#include <ospublic.h>
/*
** Local Prototype.
*/
extern CS_RETCODE ex_srv_rpcowner PROTOTYPE((
CS_VOID *spp,
CS_CHAR *ownerp
));
/*
** EX_SRV_RPCOWNER
**
** Determine the owner component of an RPC destination.
**
** Arguments:
** spp A pointer to an internal thread control structure.
** ownerp A pointer to the buffer to which Open Server
** returns the owner component.
**
** Returns:
** CS_SUCCEED Owner component returned successfully.
** CS_FAIL An error was detected.
*/
CS_RETCODE ex_srv_rpcowner(spp, ownerp)
SRV_PROC *spp;
CS_CHAR *ownerp;
{
CS_INT len;
ownerp = srv_rpcowner(spp, &len);
if(len == (CS_INT)(-1))
{
return(CS_FAIL);
}
return(CS_SUCCEED);
}
srv_rpcowner returns a CS_CHAR pointer to a null terminated string containing the owner component of the current remote procedure call (“RPC”) designation.
srv_rpcowner returns only the owner component of the RPC’s designation and does not include anything else, such as optional specifiers for database or RPC number. A fully qualified designation for an RPC takes the form database.owner.rpcname;number. To get the other parts of the RPC’s designation, if any, use srv_rpcname, srv_rpcdb, and srv_rpcnumber.
srv_numparams, srv_rpcdb, srv_rpcname, srv_rpcnumber, srv_rpcoptions