1#ifndef CACHE_H 2#define CACHE_H 3/* cache - emulation for the B+Tree torture test 4** 5** Initial version by Axel D��rfler, axeld@pinc-software.de 6** This file may be used under the terms of the MIT License. 7*/ 8 9 10#include <SupportDefs.h> 11 12class BFile; 13 14 15extern void init_cache(BFile* file, int32 blockSize); 16extern void shutdown_cache(BFile* file, int32 blockSize); 17 18extern status_t cached_write(void* cache, off_t num, const void* _data, 19 off_t numBlocks); 20 21 22// Block Cache API 23 24extern "C" { 25 26extern const void* block_cache_get(void* _cache, off_t blockNumber); 27 28extern status_t block_cache_make_writable(void* _cache, off_t blockNumber, 29 int32 transaction); 30extern void* block_cache_get_writable(void* _cache, off_t blockNumber, 31 int32 transaction); 32 33extern status_t block_cache_set_dirty(void* _cache, off_t blockNumber, 34 bool dirty, int32 transaction); 35extern void block_cache_put(void* _cache, off_t blockNumber); 36 37} // extern "C" 38 39#endif /* CACHE_H */ 40