2006-01-23 21:05:09 +01:00
|
|
|
|
2006-01-28 23:19:42 +01:00
|
|
|
struct BlockId
|
|
|
|
{
|
|
|
|
const char* atom_fn;
|
|
|
|
u32 block_num;
|
|
|
|
};
|
2006-01-23 21:05:09 +01:00
|
|
|
|
2006-01-28 23:19:42 +01:00
|
|
|
extern bool block_eq(BlockId b1, BlockId b2);
|
2006-01-23 21:05:09 +01:00
|
|
|
|
|
|
|
// create an id for use with the cache that uniquely identifies
|
2006-01-28 23:19:42 +01:00
|
|
|
// the block from the file <atom_fn> starting at <ofs>.
|
2006-01-23 21:05:09 +01:00
|
|
|
extern BlockId block_cache_make_id(const char* atom_fn, const off_t ofs);
|
|
|
|
|
|
|
|
extern void* block_cache_alloc(BlockId id);
|
|
|
|
|
|
|
|
extern void block_cache_mark_completed(BlockId id);
|
|
|
|
|
|
|
|
extern void* block_cache_find(BlockId id);
|
2006-01-28 23:19:42 +01:00
|
|
|
extern void block_cache_release(BlockId id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern LibError file_buf_get(FileIOBuf* pbuf, size_t size,
|
2006-01-31 04:47:52 +01:00
|
|
|
const char* atom_fn, uint flags, FileIOCB cb);
|
2006-01-28 23:19:42 +01:00
|
|
|
|
|
|
|
extern LibError file_buf_set_real_fn(FileIOBuf buf, const char* atom_fn);
|
|
|
|
|
|
|
|
extern FileIOBuf file_cache_find(const char* atom_fn, size_t* size);
|
|
|
|
extern FileIOBuf file_cache_retrieve(const char* atom_fn, size_t* size);
|
|
|
|
extern LibError file_cache_add(FileIOBuf buf, size_t size, const char* atom_fn);
|
2006-01-25 08:21:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
extern void file_cache_init();
|
|
|
|
extern void file_cache_shutdown();
|