srv_rpcdb

Description

Return the database component of the current remote procedure designation.

Syntax

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

Parameters

spp

A pointer to an internal thread control structure.

lenp

A pointer to an int variable that will contain the length of the database name. lenp can be NULL, in which case the length of the database name is not returned.

Returns

Table 3-107:  Return values (srv_rpcdb)

Returns

To indicate

A pointer to a null terminated string containing the database component of the current RPC’s designation.

The location of the database component of the current RPC’s designation.

(CS_CHAR *) NULL

There is no current RPC.

Open Server sets lenp to -1 and raises an informational error.

Examples

Example 1

#include        <ospublic.h>
/*
 ** Local Prototype.
 */
CS_RETCODE      ex_srv_rpcdb PROTOTYPE((
SRV_PROC        *spp,
CS_CHAR         **dbp,
CS_INT          *lenp
));
/*
 ** EX_SRV_RPCDB
 **
**   Example routine to return the database component name of the
 **   current remote procedure call designation, using srv_rpcdb.
**
** Arguments:
**   spp   A pointer to an internal thread control structure.
 **   dbp   A return pointer to the null terminated database name.
 **   lenp  A return pointer to an integer containing the length
 **         of the database name.
**
** Returns:
**   CS_SUCCEED   Database component name returned successfully.
**   CS_FAIL      An error was detected.
 */
CS_RETCODE     ex_srv_rpcdb(spp, dbp, lenp)
SRV_PROC       *spp;
CS_CHAR        **dbp;
CS_INT         *lenp;
{
      /* Initialization.*/
      *lenp = (CS_INT)0;
      /* Retrieve the database component name. */
      if ((*dbp = (CS_CHAR *)srv_rpcdb(spp, lenp)) == (CS_CHAR
            *)NULL)
      {
           return(CS_FAIL);
      }
      return(CS_SUCCEED);
}

Usage

See also

srv_numparams, srv_rpcname, srv_rpcnumber, srv_rpcoptions, srv_rpcowner