aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/comp/lzo.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-05 18:46:50 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-05 18:46:50 +0200
commit320ae4f8e752f6652c7b5c8201d7267cd4de17c1 (patch)
tree4423514c5433dc3b70e32fd5950a139827b94ac9 /lib/sqfs/comp/lzo.c
parentf92cf3b98f51d355c92900f1d316b141b2b9d4fd (diff)
Cleanup naming scheme of compressor
Add sqfs_* prefix to compressor, move implementation prefix up front. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/comp/lzo.c')
-rw-r--r--lib/sqfs/comp/lzo.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/sqfs/comp/lzo.c b/lib/sqfs/comp/lzo.c
index 3293af1..8512dfa 100644
--- a/lib/sqfs/comp/lzo.c
+++ b/lib/sqfs/comp/lzo.c
@@ -48,7 +48,7 @@ static const struct {
};
typedef struct {
- compressor_t base;
+ sqfs_compressor_t base;
int algorithm;
int level;
@@ -60,7 +60,7 @@ typedef struct {
uint32_t level;
} lzo_options_t;
-static int lzo_write_options(compressor_t *base, int fd)
+static int lzo_write_options(sqfs_compressor_t *base, int fd)
{
lzo_compressor_t *lzo = (lzo_compressor_t *)base;
lzo_options_t opt;
@@ -78,15 +78,15 @@ static int lzo_write_options(compressor_t *base, int fd)
opt.level = 0;
}
- return generic_write_options(fd, &opt, sizeof(opt));
+ return sqfs_generic_write_options(fd, &opt, sizeof(opt));
}
-static int lzo_read_options(compressor_t *base, int fd)
+static int lzo_read_options(sqfs_compressor_t *base, int fd)
{
lzo_compressor_t *lzo = (lzo_compressor_t *)base;
lzo_options_t opt;
- if (generic_read_options(fd, &opt, sizeof(opt)))
+ if (sqfs_generic_read_options(fd, &opt, sizeof(opt)))
return -1;
lzo->algorithm = le32toh(opt.algorithm);
@@ -115,7 +115,7 @@ fail_level:
return -1;
}
-static ssize_t lzo_comp_block(compressor_t *base, const uint8_t *in,
+static ssize_t lzo_comp_block(sqfs_compressor_t *base, const uint8_t *in,
size_t size, uint8_t *out, size_t outsize)
{
lzo_compressor_t *lzo = (lzo_compressor_t *)base;
@@ -143,7 +143,7 @@ static ssize_t lzo_comp_block(compressor_t *base, const uint8_t *in,
return 0;
}
-static ssize_t lzo_uncomp_block(compressor_t *base, const uint8_t *in,
+static ssize_t lzo_uncomp_block(sqfs_compressor_t *base, const uint8_t *in,
size_t size, uint8_t *out, size_t outsize)
{
lzo_compressor_t *lzo = (lzo_compressor_t *)base;
@@ -160,7 +160,7 @@ static ssize_t lzo_uncomp_block(compressor_t *base, const uint8_t *in,
return len;
}
-static compressor_t *lzo_create_copy(compressor_t *cmp)
+static sqfs_compressor_t *lzo_create_copy(sqfs_compressor_t *cmp)
{
lzo_compressor_t *other = (lzo_compressor_t *)cmp;
lzo_compressor_t *lzo;
@@ -173,18 +173,18 @@ static compressor_t *lzo_create_copy(compressor_t *cmp)
}
memcpy(lzo, other, sizeof(*lzo));
- return (compressor_t *)lzo;
+ return (sqfs_compressor_t *)lzo;
}
-static void lzo_destroy(compressor_t *base)
+static void lzo_destroy(sqfs_compressor_t *base)
{
free(base);
}
-compressor_t *create_lzo_compressor(const compressor_config_t *cfg)
+sqfs_compressor_t *lzo_compressor_create(const sqfs_compressor_config_t *cfg)
{
+ sqfs_compressor_t *base;
lzo_compressor_t *lzo;
- compressor_t *base;
if (cfg->flags & ~SQFS_COMP_FLAG_GENERIC_ALL) {
fputs("creating lzo compressor: unknown compressor flags\n",
@@ -213,7 +213,7 @@ compressor_t *create_lzo_compressor(const compressor_config_t *cfg)
lzo = alloc_flex(sizeof(*lzo), 1,
lzo_algs[cfg->opt.lzo.algorithm].bufsize);
- base = (compressor_t *)lzo;
+ base = (sqfs_compressor_t *)lzo;
if (lzo == NULL) {
perror("creating lzo compressor");