aboutsummaryrefslogtreecommitdiff
path: root/squashfs-tools/lzma_wrapper.c
diff options
context:
space:
mode:
authorplougher <plougher>2010-11-23 02:36:35 +0000
committerMohamad Ayyash <mkayyash@google.com>2015-02-23 12:34:47 -0800
commit8ecbc6eacf7e8cf344f4c45501955a2cbdca6199 (patch)
treefdabd57b5445a628a2ca272cd40be01f5451707b /squashfs-tools/lzma_wrapper.c
parent23a6f30f9bcef494438dd8f1993fc22dcfb3708e (diff)
downloadsquashfs-tools-8ecbc6eacf7e8cf344f4c45501955a2cbdca6199.tar.gz
Move lzma ops definition to here
Diffstat (limited to 'squashfs-tools/lzma_wrapper.c')
-rw-r--r--squashfs-tools/lzma_wrapper.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/squashfs-tools/lzma_wrapper.c b/squashfs-tools/lzma_wrapper.c
index 83a197b..f45b987 100644
--- a/squashfs-tools/lzma_wrapper.c
+++ b/squashfs-tools/lzma_wrapper.c
@@ -24,9 +24,12 @@
#include <LzmaLib.h>
+#include "squashfs_fs.h"
+#include "compressor.h"
+
#define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8)
-int lzma_compress(void **strm, char *dest, char *src, int size, int block_size,
+static int lzma_compress(void **strm, char *dest, char *src, int size, int block_size,
int *error)
{
unsigned char *d = (unsigned char *) dest, *s = (unsigned char *) src;
@@ -76,7 +79,7 @@ int lzma_compress(void **strm, char *dest, char *src, int size, int block_size,
}
-int lzma_uncompress(char *dest, char *src, int size, int block_size,
+static int lzma_uncompress(char *dest, char *src, int size, int block_size,
int *error)
{
unsigned char *d = (unsigned char *) dest, *s = (unsigned char *) src;
@@ -94,3 +97,14 @@ int lzma_uncompress(char *dest, char *src, int size, int block_size,
*error = res;
return res == SZ_OK ? outlen : -1;
}
+
+
+struct compressor lzma_comp_ops = {
+ .compress = lzma_compress,
+ .uncompress = lzma_uncompress,
+ .options = NULL,
+ .id = LZMA_COMPRESSION,
+ .name = "lzma",
+ .supported = 1
+};
+