1
0
forked from 0ad/0ad
0ad/source/lib/res/file/compression.h
janwas e07622b56a Cache: implement meat of landlord algorithm and add remove()
allocators: add freelist capability to Bucket; add provision for
variable XOR fixed size allocs
archive: re-tag file buffers if reading uncompressed from archive;
improve LFH fixup logic
file_cache: add cache line invalidation; lock down pages (readonly) when
IO finished
file_io: cleanup+docs; properly cut off at EOF without breaking
alignment.
file_stats: add seek accounting (WIP)
vfs_optimizer: also record file_buf_free in the trace. initial
implementation of archive builder (WIP)
zip: lfh_fixup now more efficient (does not involve buffer manager -
instead it grabs LFH from temp blocks)
tex: plug FileIOBuf leak. avoid writing to tex.hm because that is a
read-only file_buf.

This was SVN commit r3428.
2006-01-28 22:19:42 +00:00

33 lines
756 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 LibError comp_reset(uintptr_t ctx);
extern void comp_free(uintptr_t ctx);
#endif // #ifndef COMPRESSION_H__