aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-05 17:37:19 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-05 17:37:19 +0200
commitf85394c5887350a9728e108e72d908e08fc4cb78 (patch)
tree76ee4e50a5ece365d1c429271bd735dca40f01ad /lib/sqfs
parenta4b4c27bb01e64ff0072be78f7ddc0fa64193bfa (diff)
Cleanup: add sqfs_* prefix to id table
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs')
-rw-r--r--lib/sqfs/id_table.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/sqfs/id_table.c b/lib/sqfs/id_table.c
index 75d5db4..2b8044c 100644
--- a/lib/sqfs/id_table.c
+++ b/lib/sqfs/id_table.c
@@ -13,15 +13,15 @@
#include <string.h>
#include <stdio.h>
-struct id_table_t {
+struct sqfs_id_table_t {
uint32_t *ids;
size_t num_ids;
size_t max_ids;
};
-id_table_t *id_table_create(void)
+sqfs_id_table_t *sqfs_id_table_create(void)
{
- id_table_t *tbl = calloc(1, sizeof(*tbl));
+ sqfs_id_table_t *tbl = calloc(1, sizeof(*tbl));
if (tbl == NULL)
perror("Creating ID table");
@@ -29,13 +29,13 @@ id_table_t *id_table_create(void)
return tbl;
}
-void id_table_destroy(id_table_t *tbl)
+void sqfs_id_table_destroy(sqfs_id_table_t *tbl)
{
free(tbl->ids);
free(tbl);
}
-int id_table_id_to_index(id_table_t *tbl, uint32_t id, uint16_t *out)
+int sqfs_id_table_id_to_index(sqfs_id_table_t *tbl, uint32_t id, uint16_t *out)
{
size_t i, sz;
void *ptr;
@@ -70,7 +70,8 @@ int id_table_id_to_index(id_table_t *tbl, uint32_t id, uint16_t *out)
return 0;
}
-int id_table_index_to_id(const id_table_t *tbl, uint16_t index, uint32_t *out)
+int sqfs_id_table_index_to_id(const sqfs_id_table_t *tbl, uint16_t index,
+ uint32_t *out)
{
if (index >= tbl->num_ids) {
fputs("attempted out of bounds ID table access\n", stderr);
@@ -81,8 +82,8 @@ int id_table_index_to_id(const id_table_t *tbl, uint16_t index, uint32_t *out)
return 0;
}
-int id_table_read(id_table_t *tbl, int fd, sqfs_super_t *super,
- compressor_t *cmp)
+int sqfs_id_table_read(sqfs_id_table_t *tbl, int fd, sqfs_super_t *super,
+ compressor_t *cmp)
{
uint64_t upper_limit, lower_limit;
size_t i;
@@ -126,8 +127,8 @@ int id_table_read(id_table_t *tbl, int fd, sqfs_super_t *super,
return 0;
}
-int id_table_write(id_table_t *tbl, int outfd, sqfs_super_t *super,
- compressor_t *cmp)
+int sqfs_id_table_write(sqfs_id_table_t *tbl, int outfd, sqfs_super_t *super,
+ compressor_t *cmp)
{
uint64_t start;
size_t i;