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


3.1.6 diskheap_retrieve_to_buf -- Retrieve into a fixed buffer.

Function:
int diskheap_retrieve_to_buf(diskheap_t * diskheap_p, const unsigned int block_num, const unsigned int offset, void *buffer, const unsigned int max_read_size, unsigned int * size_p, unsigned int * type_p);

Usage: ret = diskheap_retrieve_to_buf(diskheap_p, block_num, buffer, 1024 /* buffer size */, offset, &size, &type_code, &ret);

This is the same as the diskheap_retrieve function but instead of allocating a buffer, it will use the buffer that it is passed. You can use fixed sized buffers that do not have to be allocated or freed with this function. Also, if you limit the size of the buffer, you can read in the first couple of bytes from it without reading in the entire stored entity. It will return DISKHEAP_ERROR_NONE if it succeeds otherwise an error code.


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

Diskheap Home Page. Copyright 2002 by Gray Watson