cwbDQ_SetKey

Purpose

Set the key and key length attributes of the data attributes. This is the key that is used for writing data to a keyed data queue. In addition to the search order, this key is used to read data from a keyed data queue. The default is to have no key with zero length; this is the correct value for a non-keyed (LIFO or FIFO) data queue.

Syntax

 
unsigned int CWB_ENTRY cwbDQ_SetKey(
                             cwbDQ_Data          data,
                             unsigned char      *key,
                             unsigned short      keyLength);

Parameters

cwbDQ_Data data - input
Handle of the data object that was returned by a previous call to cwbDQ_CreateData.
unsigned char * key - input
Pointer to the key. The key may contain embedded NULLS, so it is not an ASCIIZ string.
unsigned short keyLength - input
Length of the key in bytes.

Return Codes

The following list shows common return values.

CWB_OK
Successful completion.
CWBDQ_INVALID_DATA_HANDLE
Invalid data handle.
CWBDQ_BAD_KEY_LENGTH
Length of key is not correct.

Usage

None