0ad/source/lib/res/file/compression.h
janwas 36cbf23c8e v2 of file/res code for thesis:
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.
2006-01-23 20:05:09 +00:00

32 lines
712 B
C

#ifndef COMPRESSION_H__
#define COMPRESSION_H__
enum ContextType
{
CT_COMPRESSION,
CT_DECOMPRESSION
};
enum CompressionMethod
{
CM_NONE,
// zlib "deflate" - see RFC 1750, 1751.
CM_DEFLATE
};
extern uintptr_t comp_alloc(ContextType type, CompressionMethod method);
extern void comp_set_output(uintptr_t ctx, void* out, size_t out_size);
extern LibError comp_alloc_output(uintptr_t c_, size_t in_size);
extern void* comp_get_output(uintptr_t ctx_);
extern ssize_t comp_feed(uintptr_t ctx, const void* in, size_t in_size);
extern LibError comp_finish(uintptr_t ctx, void** out, size_t* out_size);
extern void comp_free(uintptr_t ctx);
#endif // #ifndef COMPRESSION_H__