ct_config

Description

Set or retrieve context properties.

Syntax

CS_RETCODE ct_config(context, action, property,
                buffer, buflen, outlen)
 
 CS_CONTEXT     *context;
 CS_INT                action;
 CS_INT                property;
 CS_VOID             *buffer;
 CS_INT                buflen;
 CS_INT                 *outlen;

Parameters

context

A pointer to a CS_CONTEXT structure.

action

One of the following symbolic values:

Value of action

Result

CS_SET

Sets the value of the property.

CS_GET

Retrieves the value of the property.

CS_CLEAR

Clears the value of the property by resetting it to its Client-Library default value.

CS_SUPPORTED

Checks whether a distributed-service driver supports the property. Use only with properties that affect the behavior of a security or directory driver. See “Checking whether a property is supported”.

property

The symbolic name of the property whose value is being set or retrieved. Table 3-13 lists the Client-Library context properties. “Properties” lists all Client-Library properties.

buffer

If a property value is being set, buffer points to the value to use in setting the property.

If a property value is being retrieved, buffer points to the space in which ct_config will place the requested information.

buflen

Generally, buflen is the length, in bytes, of *buffer.

If a property value is being set and the value in *buffer is null-terminated, pass buflen as CS_NULLTERM.

If *buffer is a fixed-length value, symbolic value, or function, pass buflen as CS_UNUSED.

outlen

A pointer to an integer variable.

If a property value is being set, outlen is not used and should be passed as NULL.

If a property value is being retrieved and outlen is supplied, ct_config sets *outlen to the length, in bytes, of the requested information.

If the information is larger than buflen bytes, an application can use the value of *outlen to determine how many bytes are needed to hold the information.

Returns

ct_config returns the following values:

Return value

Meaning

CS_SUCCEED

The routine completed successfully

CS_FAIL

The routine failed

Examples

Example 1

        /* Set the input/output type to asynchronous */
         CS_INT        propvalue;
         if (retcode == CS_SUCCEED)
         {
             propvalue = CS_ASYNC_IO;
             retcode = ct_config(*context, CS_SET, CS_NETIO,
                 (CS_VOID *)&propvalue, CS_UNUSED, NULL);
             if (retcode != CS_SUCCEED)
             {
                 ex_error("ex_init: ct_config(netio) failed");
             }
         }

This code excerpt is based on code in the exutils.c example program.

Usage

For information about action, buffer, buflen, and outlen, see Chapter 2, “Understanding Structures, Constants, and Conventions,” in the Open Client Client-Library/C Programmer’s Guide.

See also

cs_config, ct_cmd_props, ct_capability, ct_con_props, ct_connect, ct_init, “Properties”