srv_rpcowner

Description

Return the owner component of the current remote procedure call’s designation.

Syntax

CS_CHAR *srv_rpcowner(spp, lenp)
SRV_PROC      *spp;
CS_INT           *lenp;

Parameters

spp

A pointer to an internal thread control structure.

lenp

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

Table 3-111:  Return values (srv_rpcowner)

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.

Examples

Example 1

#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);
}

Usage

See also

srv_numparams, srv_rpcdb, srv_rpcname, srv_rpcnumber, srv_rpcoptions