Text and image functions

The Server Option provides three new functions: TDINFTXT, TDGETTXT, and TDSNDTXT. These functions can be invoked from within a Server Option application written in COBOL or PL/1. The TDINFTXT, TDGETTXT, and TDSNDTXT functions are described in the following sections using COBOL syntax.


TDINFTXT

Function

Sets or gets a description of text or image data.

Syntax

01 TDPROC          PIC S9(9) USAGE COMP SYNC.
01 RETCODE         PIC S9(9) USAGE COMP SYNC.
01 ACTION          PIC S9(9) USAGE COMP SYNC.
01 ITEM-NUMBER     PIC S9(9) USAGE COMP SYNC.
01 CS-IODESC FROM SYGWCOB


CALL 'TDINFTXT' USING TDPROC, RETCODE, ACTION, ITEM-NUMBER, CS-IODESC.

Arguments

Argument

Description

TDPROC

(I) Handle for the client/server connection. The value here must be the same value specified in the associated TDACCEPT function call. The TDPROC handle corresponds to the connection and command handles in Open Client™ Client-Library.

RETCODE

(O) Variable to which the result of function execution is returned. The value of this variable is one of the codes listed below under “Returns.”

ACTION

(I) Action to be taken by this call. ACTION is an integer variable that indicates the purpose of this call.

Assign ACTION one of the following symbolic values:

  • TDS_GET (1) – the Server Option updates the CS_IODESC structure with the total length of the text or image data to be read from the client. Typically, this is followed by a call to the TDGETTXT function. The Server Option application must set the DATATYPE field in the CS-IODESC structure to TDSTEXT or TDSIMAGE before invoking TDGETTXT.

  • TDS_SET (2) – the Server Option sets internal Server-Library structures to describe a text or image data object. The TDINFTXT call updates a text or image column with the information contained in CS-IODESC. The Server Option application must describe the column using TDESCRIB before TDINFTXT is invoked.

ITEM-NUMBER

(I) The column number of the column being described. The first column in a row is column 1. This parameter is ignored when ACTION is TDS_GET.

CS-IODESC

(I) A pointer to the CS-IODESC for the application.

Comments

Returns

The RETCODE argument can contain any of the following values:

See also

Related functions:


TDSNDTXT

Function

Sends a subsequent part of the text or image data stream to the client.

Syntax

01 TDPROC                 PIC S9(9) USAGE COMP SYNC.
01 RETCODE                PIC S9(9) USAGE COMP SYNC.
01 HOST-VARIABLE-NAME     PIC X(n).
01 BUFLEN                 PIC S9(9) USAGE COMP SYNC.


CALL ‘TDSNDTXT’ USING TDPROC, RETCODE, HOST-VARIABLE-NAME, BUFLEN.

Arguments

Argument

Description

TDPROC

(I) Handle for the client/server connection. The value here must be the same value specified in the associated TDACCEPT function call. The TDPROC handle corresponds to the connection and command handles in Open Client Client-Library.

RETCODE

(O) Variable to which the result of function execution is returned. The value of this variable is one of the codes listed below under “Returns.”

HOST-VARIABLE-NAME

(I) Application program variable that contains data for this column.

BUFLEN

(I) The size in bytes of the buffer containing the data.

Comments

Returns

The RETCODE argument can contain any of the following values:

See also

Related functions:


TDGETTXT

Function

Reads a subsequent part of a text or image datastream from the client.

Syntax

01 TDPROC                 PIC S9(9) USAGE COMP SYNC.
01 RETCODE                PIC S9(9) USAGE COMP SYNC.
01 HOST-VARIABLE-NAME     PIC X(n).
01 BUFLEN                 PIC S9(9) USAGE COMP SYNC.
01 OUTLEN                 PIC S9(9) USAGE COMP SYNC.


CALL ’TDSNDTXT’ USING TDPROC, RETCODE, HOST-VARIABLE NAME, BUFLEN.

Arguments

Argument

Description

TDPROC

(I) Handle for the client/server connection. The value here must be the same value specified in the associated TDACCEPT function call. The TDPROC handle corresponds to the connection and command handles in Open Client Client-Library.

RETCODE

(O) Variable to which the result of function execution is returned. The value of this variable is one of the codes listed below under “Returns.”

HOST-VARIABLE-NAME

(I) Application program variable to receive a subsequent part of the incoming text or image client data.

BUFLEN

(I) The size in bytes of the buffer containing the data.

OUTLEN

(I) The length in bytes of the data received.

Comments

Returns

The RETCODE argument can contain any of the following values:

See also

Related functions: