janwas
06412a7751
archive: afile_read bugfix (wasn't returning byte count) byte_order: add to_leXX, implement read_leXX in terms of that, add write_leXX (and also big-endian versions) compression: support 0 length buffers + minor fixes file: no longer support passing fn_len (that didn't work anyway due to DynHashTbl find(const char*) interface); add FILE_DONT_SET_FN optimization that prevents cluttering name cache. file_cache: add logic to verify load/free/load/free sequence; add FILE_LONG_LIVED flag to specify exceptions (e.g. XMB files that don't free their buffer immediately) vfs_mount/vfs_tree: bugfix (was mixing up portable and VFS paths) vfs_optimizer: small fixes; creating Zip files now works vfs_tree: add PathName that stores pointer to path and name component for efficiency + convenience zip: bugfixes (wasn't endian safe; incorrect handling of cmethod; forgot to initialize ZipArchive members) config: add -buildarchive flag Xeromyces.cpp, FileUnpacker.cpp: add FILE_LONG_LIVED mapreader: bump time estimate for ReadXML This was SVN commit r3446.
36 lines
1001 B
C
36 lines
1001 B
C
|
|
struct BlockId
|
|
{
|
|
const char* atom_fn;
|
|
u32 block_num;
|
|
};
|
|
|
|
extern bool block_eq(BlockId b1, BlockId b2);
|
|
|
|
// create an id for use with the cache that uniquely identifies
|
|
// the block from the file <atom_fn> starting at <ofs>.
|
|
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);
|
|
extern void block_cache_release(BlockId id);
|
|
|
|
|
|
|
|
|
|
extern LibError file_buf_get(FileIOBuf* pbuf, size_t size,
|
|
const char* atom_fn, uint flags, FileIOCB cb);
|
|
|
|
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);
|
|
|
|
|
|
extern void file_cache_init();
|
|
extern void file_cache_shutdown();
|