Provide the name of the table or tables associated with a set of browse mode results.
CS_RETCODE srv_tabname(spp, tablenum, tablenamep, namelen)
SRV_PROC *spp; CS_INT tablenum; CS_CHAR *tablenamep; CS_INT namelen;
A pointer to an internal thread control structure.
The number used to identify the table in subsequent calls to srv_tabcolname.
A pointer to the name of the table. It cannot be null, as tables always have names.
The length, in bytes, of the table name. If namelen is CS_NULLTERM, then Server Library expects the table name to be null terminated.
Returns |
To indicate |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
#include <ospublic.h>
/*
** Local Prototype.
*/
CS_RETCODE ex_srv_tabname PROTOTYPE((
SRV_PROC *sproc,
CS_INT tablenum,
CS_CHAR *tablename
));
/*
** EX_SRV_TABNAME
** An example routine to provide the name of the table
** associated with a set of browse mode results.
**
** Arguments:
** sproc A pointer to an internal thread control
** structure.
** tablenum The number that will be used to identify
** the table in subsequent calls to
** srv_tabcolname.
** tablename A null terminated string specifying the
** table name.
**
** Returns:
** CS_SUCCEED If the table is successfully described.
** CS_FAIL If an error was detected.
*/
CS_RETCODE ex_srv_tabname(sproc, tablenum, tablename)
SRV_PROC *sproc;
CS_INT tablenum;
CS_CHAR *tablename;
{
return( srv_tabname(sproc, tablenum, tablename,
CS_NULLTERM) );
}
srv_tabname is used to send to a client the name of the table or tables associated with browse mode results.
An Open Server application must call srv_tabname once for each table involved in the browse mode results.
The tablenum must be unique for all the tables described. Tables can be described in any order.
An application links browse mode result columns to particular result tables using the srv_tabcolname routine. A call to srv_tabname must always precede a call to srv_tabcolname.