srv_alt_header

Description

Describe a compute row’s row identifier and bylist.

Syntax

CS_RETCODE srv_alt_header(spp, altid, numbylist,
                  bylistarrayp)
 
 SRV_PROC         *spp;
 CS_INT                altid;
 CS_INT                numbylist;
 CS_SMALLINT     *bylistarrayp;

Parameters

spp

A pointer to an internal thread control structure.

altid

A unique identifier for this compute row.

numbylist

The number of columns in the bylist of a compute row.

bylistarrayp

A pointer to an array of column numbers that make up the bylist for a compute row. There are as many elements as specified in numbylist. If numbylist is 0, bylistarrayp is ignored.

Returns

Table 3-8: Return values (srv_alt_header)

Returns

To indicate

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

Examples

Example 1

#include            <ospublic.h>
/*
 ** Local Prototype
 */
 CS_RETCODE           ex_srv_alt_header PROTOTYPE((
 SRV_PROC             *spp
 ));
/* 
 ** EX_SRV_ALT_HEADER
 **
 **     Example routine to illustrate the use of srv_alt_header
 **     to describe a compute row’s row identifier and bylist.
 **
 ** Arguments:
 **     spp - A pointer to an internal thread control structure.
 **
 ** Returns:
 **
 **   CS_SUCCEED     A compute row was successfully described.
 **   CS_FAIL        An error was detected.
 */
 CS_RETCODE     ex_srv_alt_header(spp)
 SRV_PROC     *spp;
{
      CS_INT          altid;
      CS_SMALLINT     bylist[2];
    /* 
      ** Let us describe a fictitious compute row with altid =1, 
      ** and bylist = [2,4].
      */
      altid = (CS_INT)1;
      bylist[0] = (CS_SMALLINT)2;
      bylist[1] = (CS_SMALLINT)4;
     if (srv_alt_header(spp, altid,
           sizeof(bylist)/sizeof(CS_SMALLINT),
                bylist) == CS_FAIL)
           return (CS_FAIL);
     return (CS_SUCCEED);
 }

Usage

See also

srv_alt_bind, srv_alt_descfmt, srv_alt_xferdata