| Oracle 8i Data Cartridge Developer's Guide Release 2 (8.1.6) Part Number A76937-01  | 
  | 
Reference: Cartridge Services Using C, 3 of 6
| Function/Page | Purpose | 
|---|---|
| 
 Starts a user duration.  | 
|
| 
 Terminates a user duration.  | 
|
| 
 Allocates memory of a given size from a given duration.  | 
|
| 
 Resizes a memory chunk.  | 
|
| 
 Frees a memory chunk.  | 
Start a user duration
sword OCIDurationBegin ( OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, OCIDuration parent, OCIDuration *duration );
The OCI environment handle.
The OCI error handle. If there is an error, it is recorded in <Emphasis>err and this function returns OCI_ERROR. Diagnostic information can be obtained by calling <Emphasis>OCIErrorGet().
The OCI service context handle. This should be passed as NULL for cartridge services.
The duration number of the parent duration. One of these:
An identifier unique to the newly created user duration.
This function starts an user duration. A user can have multiple active user durations simultaneously. The user durations do not have to be nested. The duration parameter is used to return a number which uniquely identifies the duration created by this call.
Note that the environment and service context parameters cannot both be NULL.
Terminates a user duration
sword OCIDurationEnd ( OCIEnv *env, OCIError *err, CONST OCISvcCtx *svc, OCIDuration duration, CONST OCISvcCtx *svc );
The OCI environment handle.
The OCI error handle. If there is an error, it is recorded in <Emphasis>err and this function returns OCI_ERROR. Diagnostic information can be obtained by calling <Emphasis>OCIErrorGet().
A user duration previously created by OCIDurationBegin().
OCI service context (this should be passed as NULL for cartridge services, otherwise non-NULL).
This function terminates an user duration.
Note that the environment and service context parameters cannot both be NULL.
This call allocates memory of a given size from a given duration.
sword OCIMemoryAlloc( dvoid *hndl, OCIError *err, dvoid **mem, OCIDuration dur, ub4 size, ub4 flags);
The OCI environment handle.
The error handle.
Memory allocated.
One of the following (a previously created user duration):
OCI_DURATION_CALLOUT
OCI_DURATION_STATEMENT
OCI_DURATION_SESSION
OCI_DURATION_PROCESS
Size of memory to be allocated.
Set OCI_MEMORY_CLEARED bit to get memory that has been cleared.
To allocate memory for duration of callout of agent, i.e., external procedure duration, use OCIExtProcAllocCallMemory() or OCIMemoryAlloc() with dur as OCI_DURATION_CALLOUT.
Error code.
This call resizes a memory chunk to a new size.
sword OCIMemoryResize( dvoid *hndl, OCIError *err, dvoid **mem, ub4 newsize, ub4 flags);
The OCI environment or user session handle.
The error handle.
Pointer to memory allocated previously using OCIMemoryAlloc().
Size of memory requested.
Set OCI_MEMORY_CLEARED bit to get memory that has been cleared.
Memory must have been allocated before this function can be called to resize.
Error code.
This call frees a memory chunk.
sword OCIMemoryFree( dvoid *hndl, OCIError *err, dvoid *mem);
The OCI environment or user session handle.
The error handle.
Pointer to memory allocated previously using OCIMemoryAlloc().
Error code.
| Keyword/Parameter | Meaning | 
|---|---|
| 
 
  | 
 
the   | 
| 
 
  | 
 the error handle  | 
| 
 
  | 
 pointer to a previously allocated memory  | 
| 
 | 
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved.  | 
 
  |