summaryrefslogtreecommitdiff
path: root/lib/sqfshelper
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/sqfshelper
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/sqfshelper')
-rw-r--r--lib/sqfshelper/comp_opt.c9
-rw-r--r--lib/sqfshelper/compress.c10
-rw-r--r--lib/sqfshelper/data_reader.c4
-rw-r--r--lib/sqfshelper/data_writer.c4
-rw-r--r--lib/sqfshelper/deserialize_fstree.c4
-rw-r--r--lib/sqfshelper/serialize_fstree.c2
-rw-r--r--lib/sqfshelper/sqfs_reader.c12
-rw-r--r--lib/sqfshelper/write_export_table.c2
-rw-r--r--lib/sqfshelper/write_xattr.c2
9 files changed, 25 insertions, 24 deletions
diff --git a/lib/sqfshelper/comp_opt.c b/lib/sqfshelper/comp_opt.c
index 1f3fabf..c942d23 100644
--- a/lib/sqfshelper/comp_opt.c
+++ b/lib/sqfshelper/comp_opt.c
@@ -47,7 +47,7 @@ static const char *lzo_algs[] = {
[SQFS_LZO1X_999] = "lzo1x_999",
};
-static int set_flag(compressor_config_t *cfg, const char *name,
+static int set_flag(sqfs_compressor_config_t *cfg, const char *name,
const flag_t *flags, size_t num_flags)
{
size_t i;
@@ -62,7 +62,7 @@ static int set_flag(compressor_config_t *cfg, const char *name,
return -1;
}
-static int find_lzo_alg(compressor_config_t *cfg, const char *name)
+static int find_lzo_alg(sqfs_compressor_config_t *cfg, const char *name)
{
size_t i;
@@ -123,7 +123,8 @@ static char *const token[] = {
NULL
};
-int compressor_cfg_init_options(compressor_config_t *cfg, E_SQFS_COMPRESSOR id,
+int compressor_cfg_init_options(sqfs_compressor_config_t *cfg,
+ E_SQFS_COMPRESSOR id,
size_t block_size, char *options)
{
size_t num_flags = 0, min_level = 0, max_level = 0, level;
@@ -131,7 +132,7 @@ int compressor_cfg_init_options(compressor_config_t *cfg, E_SQFS_COMPRESSOR id,
char *subopts, *value;
int i, opt;
- if (compressor_config_init(cfg, id, block_size, 0))
+ if (sqfs_compressor_config_init(cfg, id, block_size, 0))
return -1;
if (options == NULL)
diff --git a/lib/sqfshelper/compress.c b/lib/sqfshelper/compress.c
index 3d53e9e..9f89e45 100644
--- a/lib/sqfshelper/compress.c
+++ b/lib/sqfshelper/compress.c
@@ -8,10 +8,10 @@
E_SQFS_COMPRESSOR compressor_get_default(void)
{
- if (compressor_exists(SQFS_COMP_XZ))
+ if (sqfs_compressor_exists(SQFS_COMP_XZ))
return SQFS_COMP_XZ;
- if (compressor_exists(SQFS_COMP_ZSTD))
+ if (sqfs_compressor_exists(SQFS_COMP_ZSTD))
return SQFS_COMP_ZSTD;
return SQFS_COMP_GZIP;
@@ -24,10 +24,10 @@ void compressor_print_available(void)
fputs("Available compressors:\n", stdout);
for (i = SQFS_COMP_MIN; i <= SQFS_COMP_MAX; ++i) {
- if (compressor_exists(i))
- printf("\t%s\n", compressor_name_from_id(i));
+ if (sqfs_compressor_exists(i))
+ printf("\t%s\n", sqfs_compressor_name_from_id(i));
}
printf("\nDefault compressor: %s\n",
- compressor_name_from_id(compressor_get_default()));
+ sqfs_compressor_name_from_id(compressor_get_default()));
}
diff --git a/lib/sqfshelper/data_reader.c b/lib/sqfshelper/data_reader.c
index 4ad6266..f7984b8 100644
--- a/lib/sqfshelper/data_reader.c
+++ b/lib/sqfshelper/data_reader.c
@@ -23,7 +23,7 @@ struct data_reader_t {
off_t current_block;
- compressor_t *cmp;
+ sqfs_compressor_t *cmp;
size_t block_size;
int sqfsfd;
@@ -105,7 +105,7 @@ static int precache_fragment_block(data_reader_t *data, size_t idx)
}
data_reader_t *data_reader_create(int fd, sqfs_super_t *super,
- compressor_t *cmp)
+ sqfs_compressor_t *cmp)
{
data_reader_t *data = alloc_flex(sizeof(*data), super->block_size, 3);
size_t i, size;
diff --git a/lib/sqfshelper/data_writer.c b/lib/sqfshelper/data_writer.c
index c41088a..62e3e2a 100644
--- a/lib/sqfshelper/data_writer.c
+++ b/lib/sqfshelper/data_writer.c
@@ -29,7 +29,7 @@ struct data_writer_t {
off_t start;
sqfs_block_processor_t *proc;
- compressor_t *cmp;
+ sqfs_compressor_t *cmp;
file_info_t *list;
sqfs_super_t *super;
int outfd;
@@ -488,7 +488,7 @@ int write_data_from_fd_condensed(data_writer_t *data, file_info_t *fi,
return 0;
}
-data_writer_t *data_writer_create(sqfs_super_t *super, compressor_t *cmp,
+data_writer_t *data_writer_create(sqfs_super_t *super, sqfs_compressor_t *cmp,
int outfd, size_t devblksize,
unsigned int num_jobs)
{
diff --git a/lib/sqfshelper/deserialize_fstree.c b/lib/sqfshelper/deserialize_fstree.c
index 8d3c916..a3cf44d 100644
--- a/lib/sqfshelper/deserialize_fstree.c
+++ b/lib/sqfshelper/deserialize_fstree.c
@@ -202,8 +202,8 @@ static int fill_dir(sqfs_meta_reader_t *ir, sqfs_meta_reader_t *dr,
return 0;
}
-int deserialize_fstree(fstree_t *out, sqfs_super_t *super, compressor_t *cmp,
- int fd, int flags)
+int deserialize_fstree(fstree_t *out, sqfs_super_t *super,
+ sqfs_compressor_t *cmp, int fd, int flags)
{
uint64_t block_start, limit;
sqfs_meta_reader_t *ir, *dr;
diff --git a/lib/sqfshelper/serialize_fstree.c b/lib/sqfshelper/serialize_fstree.c
index f400a53..dfadedd 100644
--- a/lib/sqfshelper/serialize_fstree.c
+++ b/lib/sqfshelper/serialize_fstree.c
@@ -42,7 +42,7 @@ static int write_dir_entries(sqfs_dir_writer_t *dirw, tree_node_t *node)
}
int sqfs_serialize_fstree(int outfd, sqfs_super_t *super, fstree_t *fs,
- compressor_t *cmp, sqfs_id_table_t *idtbl)
+ sqfs_compressor_t *cmp, sqfs_id_table_t *idtbl)
{
sqfs_inode_generic_t *inode;
sqfs_meta_writer_t *im, *dm;
diff --git a/lib/sqfshelper/sqfs_reader.c b/lib/sqfshelper/sqfs_reader.c
index 49e91f5..598b3c4 100644
--- a/lib/sqfshelper/sqfs_reader.c
+++ b/lib/sqfshelper/sqfs_reader.c
@@ -14,7 +14,7 @@
int sqfs_reader_open(sqfs_reader_t *rd, const char *filename, int rdtree_flags)
{
- compressor_config_t cfg;
+ sqfs_compressor_config_t cfg;
memset(rd, 0, sizeof(*rd));
@@ -27,16 +27,16 @@ int sqfs_reader_open(sqfs_reader_t *rd, const char *filename, int rdtree_flags)
if (sqfs_super_read(&rd->super, rd->sqfsfd))
goto fail_fd;
- if (!compressor_exists(rd->super.compression_id)) {
+ if (!sqfs_compressor_exists(rd->super.compression_id)) {
fprintf(stderr, "%s: unknown compressor used.\n", filename);
goto fail_fd;
}
- compressor_config_init(&cfg, rd->super.compression_id,
- rd->super.block_size,
- SQFS_COMP_FLAG_UNCOMPRESS);
+ sqfs_compressor_config_init(&cfg, rd->super.compression_id,
+ rd->super.block_size,
+ SQFS_COMP_FLAG_UNCOMPRESS);
- rd->cmp = compressor_create(&cfg);
+ rd->cmp = sqfs_compressor_create(&cfg);
if (rd->cmp == NULL)
goto fail_fd;
diff --git a/lib/sqfshelper/write_export_table.c b/lib/sqfshelper/write_export_table.c
index e42df15..b0ad4ce 100644
--- a/lib/sqfshelper/write_export_table.c
+++ b/lib/sqfshelper/write_export_table.c
@@ -13,7 +13,7 @@
#include <stdio.h>
int write_export_table(int outfd, fstree_t *fs, sqfs_super_t *super,
- compressor_t *cmp)
+ sqfs_compressor_t *cmp)
{
uint64_t *table, start;
size_t i, size;
diff --git a/lib/sqfshelper/write_xattr.c b/lib/sqfshelper/write_xattr.c
index 349b41d..6f71eeb 100644
--- a/lib/sqfshelper/write_xattr.c
+++ b/lib/sqfshelper/write_xattr.c
@@ -168,7 +168,7 @@ static uint64_t *create_ool_locations_table(fstree_t *fs)
}
int write_xattr(int outfd, fstree_t *fs, sqfs_super_t *super,
- compressor_t *cmp)
+ sqfs_compressor_t *cmp)
{
uint64_t kv_start, id_start, block, *tbl, *ool_locations;
size_t i = 0, count = 0, blocks;