cwbCO_GetActiveEnvironment

Purpose

Get the name of the environment currently active.

Syntax

 
unsigned int CWB_ENTRY cwbCO_GetActiveEnvironment(
                             char               *environmentName,
                             unsigned long      *bufferSize);

Parameters

char *environmentName - output
Pointer to a buffer into which will be copied the name of the active environment, if the buffer that is passed is large enough to hold it. The buffer should be large enough to hold at least CWBCO_MAX_ENV_NAME + 1 characters, including the terminating NULL character.
unsigned long * bufferSize - input/output
input
Size of the buffer pointed to by *environmentName.
output
Size of buffer needed.

Return Codes

The following list shows common return values:

CWB_OK
Successful Completion.
CWB_INVALID_POINTER
One or more pointer parameters are NULL.
CWB_BUFFER_OVERFLOW
Not enough room in output buffer to hold entire environment name. Use *bufferSize to determine the correct size. No error message is logged to the History Log since the caller is expected to recover from this error and continue.
CWBCO_NO_SUCH_ENVIRONMENT
No environments have been configured, so there is no active environment.
CWB_NOT_ENOUGH_MEMORY
Insufficient memory; may have failed to allocate temporary buffer.
CWB_API_ERROR
General API failure.

Usage

None.