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


3.1.7 diskheap_update -- Update a stored buffer with new data.

Function:
int diskheap_update(diskheap_t * diskheap_p, const void *new_buffer, const unsigned int new_size, const unsigned int new_type, const unsigned int old_block_num, const unsigned int old_offset, const int safer_b, unsigned int * block_num_p, unsigned int * offset_p, unsigned int * old_size_p, unsigned int * old_type_p);

Usage: ret = diskheap_update(diskheap_p, "new string", 10 /* size of string */, 0 /* no type specified */, block_num, offset, 1 /* safer flag */, &new_block_num, &new_offset, &old_size, &old_type);

This function replaces a stored item with a new item. You specify the new item's size and type and the block-number and offset location of the old item. It will return the new location of the new item and the size and type of the old item. This basically does a diskheap_delete and a diskheap_store is that order but if you specify 1 for the safer flag, then it will do the store first and then the delete. 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