Go to the first, previous, next, last section, table of contents.


3.1.5 diskheap_retrieve -- Retrieve a previously stored buffer

Function:
void *diskheap_retrieve(diskheap_t *diskheap_p, const unsigned int block_num, const unsigned int offset, unsigned int *size_p, unsigned int *type_p, int *error_p);

Usage: buf_p = diskheap_retrieve(diskheap_p, block_num, offset, &size, &type_code, &ret);

This function looks up a block-number and offset location and allocates and returns a dynamic memory buffer with its contents. It passes back the size of the buffer in a size argument and the type that was passed to diskheap_store in a type argument. It will return 0L on an error and set the error code argument.

NOTE: you must deallocate the returned buffer with a call to free() at a later time. To use a static buffer instead, see diskheap_retrieve_to_buf.


Go to the first, previous, next, last section, table of contents.

Diskheap Home Page. Copyright 2002 by Gray Watson