Set or get a description of text or image data.
CS_RETCODE srv_text_info(spp, cmd, item, iodescp)
SRV_PROC *spp; CS_INT cmd; CS_INT item; CS_IODESC *iodescp;
A pointer to an internal thread control structure.
The direction of data flow. Table 3-143 summarizes the legal values for cmd:
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. |
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.
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 |
To indicate |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
#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);
}
srv_text_info is used to describe text or image columns for sending a result row or retrieving a parameter.
If cmd is CS_GET, srv_text_info must be called from the SRV_BULK event handler.
If cmd is CS_GET, srv_text_info must be called prior to a call to srv_get_text.
If cmd is CS_SET, srv_text_info must be called for each text or image datatype column in a row before srv_xferdata or srv_send_text is called.
Text and image data is transferred to a client using either srv_bind followed by srv_xferdata, or srv_send_text.
srv_bind, srv_descfmt, srv_get_text, srv_send_text, srv_xferdata, “Text and image”