summaryrefslogtreecommitdiffstats
path: root/depends/lzma/include/compress.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-09-26 02:58:09 +0200
committerPetr Mrázek <peterix@gmail.com>2013-09-26 02:59:56 +0200
commit2c8dc0b855c38c5204d398ad306fa9cf43be1ada (patch)
tree59429d658012a3df0e548e1a5f08100fb2930fc0 /depends/lzma/include/compress.h
parentaf234f35029de8c46aefecd8b9345b30ae1c51b0 (diff)
downloadMultiMC-2c8dc0b855c38c5204d398ad306fa9cf43be1ada.tar
MultiMC-2c8dc0b855c38c5204d398ad306fa9cf43be1ada.tar.gz
MultiMC-2c8dc0b855c38c5204d398ad306fa9cf43be1ada.tar.lz
MultiMC-2c8dc0b855c38c5204d398ad306fa9cf43be1ada.tar.xz
MultiMC-2c8dc0b855c38c5204d398ad306fa9cf43be1ada.zip
Compression algo dependencies, still need hackery...
Diffstat (limited to 'depends/lzma/include/compress.h')
-rw-r--r--depends/lzma/include/compress.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/depends/lzma/include/compress.h b/depends/lzma/include/compress.h
new file mode 100644
index 00000000..46c81d75
--- /dev/null
+++ b/depends/lzma/include/compress.h
@@ -0,0 +1,77 @@
+/*
+ * Written in 2009 by Lloyd Hilaiel
+ *
+ * License
+ *
+ * All the cruft you find here is public domain. You don't have to credit
+ * anyone to use this code, but my personal request is that you mention
+ * Igor Pavlov for his hard, high quality work.
+ *
+ * compress.h - the API for LZMA compression using easylzma
+ */
+
+#pragma once
+
+#include "common.h"
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** suggested default values */
+#define ELZMA_LC_DEFAULT 3
+#define ELZMA_LP_DEFAULT 0
+#define ELZMA_PB_DEFAULT 2
+#define ELZMA_DICT_SIZE_DEFAULT_MAX (1 << 24)
+
+/** an opaque handle to an lzma compressor */
+typedef struct _elzma_compress_handle *elzma_compress_handle;
+
+/**
+ * Allocate a handle to an LZMA compressor object.
+ */
+elzma_compress_handle EASYLZMA_API elzma_compress_alloc();
+
+/**
+ * set allocation routines (optional, if not called malloc & free will
+ * be used)
+ */
+void EASYLZMA_API
+elzma_compress_set_allocation_callbacks(elzma_compress_handle hand, elzma_malloc mallocFunc,
+ void *mallocFuncContext, elzma_free freeFunc,
+ void *freeFuncContext);
+
+/**
+ * Free all data associated with an LZMA compressor object.
+ */
+void EASYLZMA_API elzma_compress_free(elzma_compress_handle *hand);
+
+/**
+ * Set configuration paramters for a compression run. If not called,
+ * reasonable defaults will be used.
+ */
+int EASYLZMA_API elzma_compress_config(elzma_compress_handle hand, unsigned char lc,
+ unsigned char lp, unsigned char pb, unsigned char level,
+ unsigned int dictionarySize, elzma_file_format format,
+ unsigned long long uncompressedSize);
+
+/**
+ * Run compression
+ */
+int EASYLZMA_API
+elzma_compress_run(elzma_compress_handle hand, elzma_read_callback inputStream,
+ void *inputContext, elzma_write_callback outputStream, void *outputContext,
+ elzma_progress_callback progressCallback, void *progressContext);
+
+/**
+ * a heuristic utility routine to guess a dictionary size that gets near
+ * optimal compression while reducing memory usage.
+ * accepts a size in bytes, returns a proposed dictionary size
+ */
+unsigned int EASYLZMA_API elzma_get_dict_size(unsigned long long size);
+
+#ifdef __cplusplus
+}
+;
+#endif