Buffers

Description

A number of arguments used in Client-Library functions affect the contents of buffers: action, buffer, buf_len, outlen.

These arguments are described individually below. For a summary of argument values and their interaction, see Table 2-1.

Arguments

Summary of buffer entries

Table 2-1 summarizes the interaction among action, buffer, buf_len, and outlen.

Table 2-1: Interactions among action, buffer, buf_len, and outlen

For this action

When buffer

buf_len is

outlen is

Result

CS_CLEAR

N/A

CS_UNUSED

Ignored

The property reverts to its default value.

CS_SET

Contains a variable-length character string.

The length of the string

Ignored

The data in buffer is read by the function.

CS_SET

Contains a variable-length character string for which the terminating character is the last non-blank character.

The maximum length of the string

Ignored

The data in buffer is read by the function.

CS_SET

Contains a fixed-length character string or symbolic value.

CS_UNUSED

Ignored

The data in buffer is read by the function.

CS_GET

Is large enough for the return character string.

The length of the buffer

Set by Client-Library

The retrieved value is copied to the buffer.

outlen returns the length of the retrieved value.

CS_GET

Is not large enough for the return character string.

The length of the buffer

Set by Client-Library

No data is copied to the buffer.

outlen returns the length of the value being retrieved.

The function returns CS_FAIL, indicating that you should assign the value returned here to the length argument and execute the program again.

CS_GET

Is assumed to be large enough for a fixed-length or symbolic value.

CS_UNUSED

Set by Client-Library

The retrieved value is copied to the buffer.

outlen returns the length of the value being retrieved.