ct_cmd_alloc

Description

Allocate a CS_COMMAND structure.

Syntax

CS_RETCODE ct_cmd_alloc(connection, cmd_pointer)
 
 CS_CONNECTION     *connection;
 CS_COMMAND          **cmd_pointer;

Parameters

connection

A pointer to a CS_CONNECTION structure. A CS_CONNECTION structure contains information about a particular client/server connection.

cmd_pointer

The address of a pointer variable. ct_cmd_alloc sets *cmd_pointer to the address of a newly allocated CS_COMMAND structure.

Returns

ct_cmd_alloc returns the following values:

Return value

Meaning

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

CS_BUSY

An asynchronous operation is already pending for this connection. See “Asynchronous programming”.

The most common reason for a ct_cmd_alloc failure is a lack of memory.

Examples

Example 1

          /* Allocate a command handle to send the text with */
           if ((retcode = ct_cmd_alloc(connection, &cmd)) !=
                CS_SUCCEED)
           {
                ex_error("UpdateTextData: ct_cmd_alloc() failed");
                return retcode;
           }

This code excerpt is from the getsend.c example program.

Usage

See also

ct_command, ct_cmd_drop, ct_cmd_props, ct_con_alloc, ct_cursor, ct_dynamic