action, buffer, buflen, and outlen

Many Client-Library routines use some combination of the parameters action, buffer, buflen, and outlen.

Table 2-3 summarizes the interaction between action, buffer, buflen, and outlen:

Table 2-3: Interaction between action, buffer, buflen, and outlen parameters

action

buffer

buflen

outlen

What happens

CS_CLEAR

NULL

CS_UNUSED

NULL

The Client-Library information is cleared by resetting it to its default value.

CS_SET

A pointer to a null-terminated character string

CS_NULLTERM or the length of the string, not including the null terminator

NULL

The Client-Library information is set to the value of the *buffer character string.

CS_SET

A pointer to a character string that is not null-terminated

The length of the string

NULL

The Client-Library information is set to the value of the *buffer character string.

CS_SET

A pointer to a variable-length, noncharacter value (for example, binary data)

The length of the data

NULL

The Client-Library information is set to the value of the *buffer data.

CS_SET

A pointer to a fixed-length or symbolic value

CS_UNUSED

NULL

The Client-Library information is set to the value of the integer or symbolic value.

CS_SET

NULL

0 or CS_UNUSED

NULL

The Client-Library information is set to NULL.

CS_GET

A pointer to space large enough for the return character string plus a null terminator

The length of *buffer

Supplied or NULL

The return value is copied to *buffer.

A null terminator is appended.

If supplied, *outlen is set to the length of the return value, including the null terminator.

CS_GET

A pointer to space that is not large enough for the return character string plus a null terminator

The length of *buffer

Supplied or NULL

No data is copied to *buffer.

If supplied, *outlen is set to the length of the return value, including the null terminator.

The routine returns CS_FAIL.

CS_GET

A pointer to space that is large enough for the return variable-length, noncharacter data

The length of *buffer

Supplied or NULL

The return value is copied to *buffer.

If supplied, *outlen is set to the length of the return value.

CS_GET

A pointer to space that is not large enough for the return variable-length, noncharacter data

The length of *buffer

Supplied or NULL

No data is copied to *buffer.

If supplied, *outlen is set to the length of the return value.

The routine returns CS_FAIL.

CS_GET

A pointer to space that is assumed to be large enough for a fixed-length or symbolic value

CS_UNUSED

Supplied or NULL

The return value is copied to *buffer.

If supplied, *outlen is set to the length of the return value.