z/OS Open Cryptographic Services Facility Application Programming
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF


Initialization of Memory Structure

z/OS Open Cryptographic Services Facility Application Programming
SC24-5899-01

The memory structure CSSM_MEMORY_FUNCS requires pointers to functions that implement the memory routines. The example is an application supplying the C run-time utilities malloc, realloc and free to the memory structure. The memory structure is then used by the CSSM_Init call.

        /* Allocating the structure */
MemoryFuncs = (CSSM_MEMORY_FUNCS_PTR) malloc (sizeof (CSSM_MEMORY_FUNCS));

/* Initialize the memory function structure */
MemoryFuncs->malloc_func = HeapMalloc;
MemoryFuncs->realloc_func = HeapRealloc;
MemoryFuncs->free_func = HeapFree;
MemoryFuncs->calloc_func = HeapCalloc;
MemoryFuncs->AllocRef = HeapID;

        /* Initialize the CSSM */
CSSM_Init (Version, MemoryFuncs, NULL);

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014