srv_text_info

Description

Set or get a description of text or image data.

Syntax

CS_RETCODE srv_text_info(spp, cmd, item, iodescp)
SRV_PROC      *spp;
CS_INT              cmd;
CS_INT              item;
CS_IODESC     *iodescp;

Parameters

spp

A pointer to an internal thread control structure.

cmd

The direction of data flow. Table 3-140 summarizes the legal values for cmd:

Table 3-140: Values for cmd (srv_text_info)

Value

Meaning

CS_SET

The Open Server application is setting internal Server-Library structures to describe text or image data. The srv_text_info call will update a text or image column (inside Open Server) with the information in iodescp. (The application must have previously described the column using srv_descfmt.) Typically, this will be followed by a call to srv_send_text, or srv_bind and srv_xferdata.

CS_GET

Open Server is updating the iodescp structure with the total length of the text or image data to be read from a client. Typically, this will be followed by a call to srv_get_text. See the comments section below for limitations regarding the CS_GET direction.

item

The column number of the column being described. The first column in a row is column 1. This parameter is ignored when cmd is CS_GET.

iodescp

A pointer to a structure that describes the object name, text pointer, and timestamp for a text column. See “CS_IODESC structure” for details.

Returns

Table 3-141:  Return values (srv_text_info)

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_text_info PROTOTYPE((
SRV_PROC        *spp,
CS_INT          item
CS_IODESC       *iodp
));

/*
** EX_SRV_TEXT_INFO
**
**     Example routine to set a column’s text or image data
 **     description before transferring a data row, using
 **     srv_text_info. This example routine would be used in a
 **     gateway application, where the Open Client application has
 **     initiated an update of text or image data.
**
** Arguments:
**    spp   A pointer to an internal thread control structure.
**    item  The column number of the column being described.
**    iodp  A pointer to a CS_IODESC structure that describes the 
 **          text or image data (This stucture is passed from the
 **          Open Client application).
**
** Returns:
**    CS_SUCCEED    Text or image data successfully described.
**    CS_FAIL      An error occurred was detected.
*/
CS_RETCODE      ex_srv_text_info(spp, item, iodp)
SRV_PROC        *spp;
CS_INT          item;
CS_IODESC       *iodp;
{
      /*
      ** Describe the text or image data for the column.
      */
      if (srv_text_info(spp, (CS_INT)CS_SET, item, iodp) !=
             CS_SUCCEED)
      {
            return(CS_FAIL);
      }
      return(CS_SUCCEED);
}

Usage

See also

srv_bind, srv_descfmt, srv_get_text, srv_send_text, srv_xferdata, “Text and image”