ttUtilAllocEnv
Description
Allocates memory for a TimesTen utility library environment handle and initializes the TimesTen utility library interface for use by an application. An application must call ttUtilAllocEnv
before calling any other TimesTen utility library function. In addition, an application should call ttUtilFreeEnv
when it is done using the TimesTen utility library interface.
Required Privilege
None
Syntax
ttUtilAllocEnv (ttUtilHandle* handle_ptr, char* errBuff,
unsigned int buffLen, unsigned int* errLen)
Parameters
Parameter | Type | Description |
---|---|---|
|
|
Specifies a pointer to storage where the TimesTen utility library environment handle is returned. |
|
|
This is a user allocated buffer where error messages (if any) are returned. The returned error message is a null-terminated string. If the length of the error message exceeds |
|
|
Specifies the size of the buffer |
|
|
This is a pointer to an unsigned integer where the actual length of the error message is returned. If it is |
Return Codes
This utility returns the following code as defined in ttutillib.h
.
Code | Description |
---|---|
|
Returned upon success. |
Otherwise, it returns a TimesTen-specific error message as defined in tt_errCode.h
and a corresponding error message in the buffer provided by the caller.
Example
This example allocates and initializes a TimesTen utility library environment handle with the name utilHandle
.
char errBuff [256]; int rc; ttUtilHandle utilHandle; rc = ttUtilAllocEnv (&utilHandle, errBuff, sizeof(errBuff), NULL);