summaryrefslogtreecommitdiff
path: root/lzx.h
diff options
context:
space:
mode:
Diffstat (limited to 'lzx.h')
-rw-r--r--lzx.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/lzx.h b/lzx.h
new file mode 100644
index 0000000..ff78f5d
--- /dev/null
+++ b/lzx.h
@@ -0,0 +1,24 @@
+/*
+ * lzx.h: LZX encoder for Windows CHM files.
+ */
+
+struct LZXEncodedFile {
+ unsigned char *data;
+ size_t data_len;
+
+ size_t *reset_byte_offsets;
+ size_t n_resets;
+};
+
+/*
+ * Produce an LZX-compressed encoding of an input data block. Return
+ * it, along with a list of byte offsets where the data stream is
+ * realigned to a 16-bit boundary because one of realign_interval and
+ * reset_interval has run out.
+ *
+ * The output structure and its fields 'data' and 'reset_byte_offsets'
+ * are all dynamically allocated, and need freeing by the receiver
+ * when finished with.
+ */
+struct LZXEncodedFile *lzx(const void *data, int len,
+ int realign_interval, int reset_interval);