srv_symbol

Description

Convert an Open Server token value to a readable string.

Syntax

CS_CHAR *srv_symbol(type, symbol, lenp)
CS_INT           type;
CS_INT           symbol;
CS_INT          *lenp;

Parameters

type

The type of token. Table 3-134 describes the legal token types:

Table 3-134: Token types corresponding to type (srv_symbol)

Token Type

Description

SRV_DATATYPE

A datatype

SRV_EVENT

An event type

SRV_DONE

A DONE status type

SRV_ERROR

An error severity token

symbol

The actual token value.

lenp

A pointer to a CS_INT variable that will contain the length of the returned string.

Returns

Table 3-135:  Return values (srv_symbol)

Returns

To indicate

A pointer to a null terminated character string that is a readable translation of an Open Server token value.

The token value.

A null pointer

Open Server does not recognize the type or symbol.

Open Server sets lenp to -1.

Examples

Example 1

#include    <ospublic.h>
/*
 ** Local Prototype
 */
extern CS_RETCODE       ex_srv_symbol PROTOTYPE((
CS_INT type,
CS_INT symbol,
CS_CHAR *namep
));
/* 
 ** EX_SRV_SYMBOL
**
**   Retrieve a printable string representation of an Open Server 
 **   symbol
**
** Arguments:
**     type         Symbol type
**     symbol       Symbol for which to retrieve string
**     namep        Return symbol string here
** Returns:
 **     CS_SUCCEED       Symbol string was retrieved successfully
 **     CS_FAIL          An error was detected
 */
CS_RETCODE           ex_srv_symbol(type, symbol, namep)
CS_INT               type;
CS_INT               symbol;
CS_CHAR           *namep;
{
     CS_INT          len;
     namep = srv_symbol(type, symbol, &len);
     if(namep == (CS_CHAR *)NULL)
     {
          return(CS_FAIL);
     }
     return(CS_SUCCEED);
 }

Usage

See also

srv_descfmt