forked from 0ad/0ad
janwas
36cbf23c8e
previous zip.* split up into archive, zip and compression. add O(1) lookup via memento. add support for writing Zip archive. simplify IO by having compression module allow queuing input buffers. file: split up into file, file_Io, file_cache. add atom_fn that enables string comparison via pointer compare. (stores all filenames/paths in one place). add statistics gathering. file_cache: landlord algorithm for caching files as well as LRU block cache. file_io: aio code that splits transfers into blocks revamped and made into class. vfs: filelist/trace code moved into new vfs_optimizer. add caching logic to vfs_load. vfs_optimizer: will generate zip archive (to replace current archive builder script). not yet done vfs_tree: major cleanup - now has nice base class rather than union hackery. This was SVN commit r3420.
20 lines
655 B
C
20 lines
655 B
C
extern LibError file_buf_get(FileIOBuf* pbuf, size_t size,
|
|
const char* atom_fn, bool is_write, FileIOCB cb);
|
|
|
|
|
|
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);
|
|
|
|
|
|
typedef u64 BlockId;
|
|
|
|
// create an id for use with the cache that uniquely identifies
|
|
// the block from the file <atom_fn> starting at <ofs> (aligned).
|
|
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);
|