aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-07-02 19:31:51 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-07-03 09:31:51 +0200
commitec593e0b94656a5481f82ee0f33728ced297ac48 (patch)
treec4172c686b628ff3d0c198dc05aa0db83239d6bd
parent181815fb432007f5e8b8cbd15c3f66beea04e601 (diff)
Refactor: rename dir_entry_t to sqfs_dir_entry_t
Exact operation performed: git ls-files -z | \ xargs -0 sed -i -e 's/dir_entry_t/sqfs_dir_entry_t/g Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--bin/gensquashfs/src/fstree_from_dir.c2
-rw-r--r--bin/gensquashfs/src/fstree_from_file.c10
-rw-r--r--bin/gensquashfs/src/glob.c2
-rw-r--r--bin/gensquashfs/src/mkfs.h2
-rw-r--r--bin/tar2sqfs/src/process_tarball.c8
-rw-r--r--include/fstree.h2
-rw-r--r--include/io/dir_entry.h6
-rw-r--r--include/io/dir_iterator.h2
-rw-r--r--lib/fstree/src/fstree.c6
-rw-r--r--lib/fstree/test/add_by_path.c6
-rw-r--r--lib/fstree/test/fstree_sort.c2
-rw-r--r--lib/fstree/test/gen_inode_numbers.c2
-rw-r--r--lib/fstree/test/get_path.c6
-rw-r--r--lib/fstree/test/mknode_dir.c6
-rw-r--r--lib/fstree/test/mknode_simple.c6
-rw-r--r--lib/io/src/dir_entry.c4
-rw-r--r--lib/io/src/dir_tree_iterator.c10
-rw-r--r--lib/io/src/unix/dir_iterator.c2
-rw-r--r--lib/io/src/win32/dir_iterator.c4
-rw-r--r--lib/io/test/dir_iterator.c6
-rw-r--r--lib/io/test/dir_tree_iterator.c6
-rw-r--r--lib/io/test/dir_tree_iterator2.c6
-rw-r--r--lib/io/test/dir_tree_iterator3.c6
-rw-r--r--lib/sqfs/src/dir_writer.c24
-rw-r--r--lib/tar/src/iterator.c2
-rw-r--r--lib/tar/test/tar_iterator.c2
-rw-r--r--lib/tar/test/tar_iterator2.c2
-rw-r--r--lib/tar/test/tar_iterator3.c2
28 files changed, 72 insertions, 72 deletions
diff --git a/bin/gensquashfs/src/fstree_from_dir.c b/bin/gensquashfs/src/fstree_from_dir.c
index 6af4637..fe0a022 100644
--- a/bin/gensquashfs/src/fstree_from_dir.c
+++ b/bin/gensquashfs/src/fstree_from_dir.c
@@ -9,7 +9,7 @@
int fstree_from_dir(fstree_t *fs, dir_iterator_t *dir)
{
for (;;) {
- dir_entry_t *ent = NULL;
+ sqfs_dir_entry_t *ent = NULL;
tree_node_t *n = NULL;
char *extra = NULL;
diff --git a/bin/gensquashfs/src/fstree_from_file.c b/bin/gensquashfs/src/fstree_from_file.c
index d06fcfd..16fa516 100644
--- a/bin/gensquashfs/src/fstree_from_file.c
+++ b/bin/gensquashfs/src/fstree_from_file.c
@@ -29,7 +29,7 @@ static int read_u32(const char *str, sqfs_u32 *out, sqfs_u32 base)
}
static int add_generic(fstree_t *fs, const char *filename, size_t line_num,
- dir_entry_t *ent, split_line_t *line)
+ sqfs_dir_entry_t *ent, split_line_t *line)
{
const char *msg = NULL, *arg = line->count > 0 ? line->args[0] : NULL;
@@ -51,7 +51,7 @@ fail:
}
static int add_device(fstree_t *fs, const char *filename, size_t line_num,
- dir_entry_t *ent, split_line_t *line)
+ sqfs_dir_entry_t *ent, split_line_t *line)
{
sqfs_u32 maj, min;
@@ -93,7 +93,7 @@ fail_generic:
}
static int add_file(fstree_t *fs, const char *filename, size_t line_num,
- dir_entry_t *ent, split_line_t *line)
+ sqfs_dir_entry_t *ent, split_line_t *line)
{
if (line->count == 0)
line->args[line->count++] = ent->name;
@@ -108,7 +108,7 @@ static const struct callback_t {
bool need_extra;
bool allow_root;
int (*callback)(fstree_t *fs, const char *filename, size_t line_num,
- dir_entry_t *ent, split_line_t *line);
+ sqfs_dir_entry_t *ent, split_line_t *line);
} file_list_hooks[] = {
{ "dir", S_IFDIR, 0, false, true, add_generic },
{ "slink", S_IFLNK, 0, true, false, add_generic },
@@ -127,7 +127,7 @@ static int handle_line(fstree_t *fs, const char *filename, size_t line_num,
const struct callback_t *cb = NULL;
unsigned int glob_flags = 0;
sqfs_u32 uid, gid, mode;
- dir_entry_t *ent = NULL;
+ sqfs_dir_entry_t *ent = NULL;
const char *msg = NULL;
bool is_glob = false;
char *path;
diff --git a/bin/gensquashfs/src/glob.c b/bin/gensquashfs/src/glob.c
index 656baee..3e2eabc 100644
--- a/bin/gensquashfs/src/glob.c
+++ b/bin/gensquashfs/src/glob.c
@@ -64,7 +64,7 @@ static bool set_scan_flag(const char *arg, dir_tree_cfg_t *cfg)
}
int glob_files(fstree_t *fs, const char *filename, size_t line_num,
- const dir_entry_t *ent,
+ const sqfs_dir_entry_t *ent,
const char *basepath, unsigned int glob_flags,
split_line_t *sep)
{
diff --git a/bin/gensquashfs/src/mkfs.h b/bin/gensquashfs/src/mkfs.h
index ed5246d..3378c05 100644
--- a/bin/gensquashfs/src/mkfs.h
+++ b/bin/gensquashfs/src/mkfs.h
@@ -117,7 +117,7 @@ int fstree_from_dir(fstree_t *fs, dir_iterator_t *dir);
int fstree_sort_files(fstree_t *fs, sqfs_istream_t *sortfile);
int glob_files(fstree_t *fs, const char *filename, size_t line_num,
- const dir_entry_t *ent,
+ const sqfs_dir_entry_t *ent,
const char *basepath, unsigned int glob_flags,
split_line_t *extra);
diff --git a/bin/tar2sqfs/src/process_tarball.c b/bin/tar2sqfs/src/process_tarball.c
index a2a4360..ecb9095 100644
--- a/bin/tar2sqfs/src/process_tarball.c
+++ b/bin/tar2sqfs/src/process_tarball.c
@@ -7,7 +7,7 @@
#include "tar2sqfs.h"
static int write_file(sqfs_writer_t *sqfs, dir_iterator_t *it,
- const dir_entry_t *ent, tree_node_t *n)
+ const sqfs_dir_entry_t *ent, tree_node_t *n)
{
int flags = 0, ret = 0;
sqfs_ostream_t *out;
@@ -92,7 +92,7 @@ fail:
}
static int create_node_and_repack_data(sqfs_writer_t *sqfs, dir_iterator_t *it,
- const dir_entry_t *ent, const char *link)
+ const sqfs_dir_entry_t *ent, const char *link)
{
tree_node_t *node;
@@ -128,7 +128,7 @@ fail_errno:
}
static int set_root_attribs(sqfs_writer_t *sqfs, dir_iterator_t *it,
- const dir_entry_t *ent)
+ const sqfs_dir_entry_t *ent)
{
if ((ent->flags & DIR_ENTRY_FLAG_HARD_LINK) || !S_ISDIR(ent->mode)) {
fprintf(stderr, "'%s' is not a directory!\n", ent->name);
@@ -156,7 +156,7 @@ int process_tarball(dir_iterator_t *it, sqfs_writer_t *sqfs)
for (;;) {
bool skip = false, is_root = false, is_prefixed = true;
- dir_entry_t *ent = NULL;
+ sqfs_dir_entry_t *ent = NULL;
char *link = NULL;
int ret;
diff --git a/include/fstree.h b/include/fstree.h
index 3c3782e..0d60616 100644
--- a/include/fstree.h
+++ b/include/fstree.h
@@ -141,7 +141,7 @@ void fstree_cleanup(fstree_t *fs);
This function does not print anything to stderr, instead it sets an
appropriate errno value. Internally it uses fstree_mknode to create the node.
*/
-tree_node_t *fstree_add_generic(fstree_t *fs, const dir_entry_t *ent,
+tree_node_t *fstree_add_generic(fstree_t *fs, const sqfs_dir_entry_t *ent,
const char *extra);
/*
diff --git a/include/io/dir_entry.h b/include/io/dir_entry.h
index be5c400..8ff8cf0 100644
--- a/include/io/dir_entry.h
+++ b/include/io/dir_entry.h
@@ -16,7 +16,7 @@ typedef enum {
} DIR_ENTRY_FLAG;
/**
- * @struct dir_entry_t
+ * @struct sqfs_dir_entry_t
*
* @brief A directory entry returned by a @ref dir_iterator_t
*/
@@ -82,13 +82,13 @@ typedef struct {
* Windows with encoding-aware APIs, the name is converted to UTF-8.
*/
char name[];
-} dir_entry_t;
+} sqfs_dir_entry_t;
#ifdef __cplusplus
extern "C" {
#endif
-dir_entry_t *dir_entry_create(const char *name);
+sqfs_dir_entry_t *dir_entry_create(const char *name);
#ifdef __cplusplus
}
diff --git a/include/io/dir_iterator.h b/include/io/dir_iterator.h
index 1ea3321..18c0e9a 100644
--- a/include/io/dir_iterator.h
+++ b/include/io/dir_iterator.h
@@ -27,7 +27,7 @@ typedef struct dir_iterator_t {
* @return Zero on success, postivie value if the end of the list was
* reached, negative @ref SQFS_ERROR value on failure.
*/
- int (*next)(struct dir_iterator_t *it, dir_entry_t **out);
+ int (*next)(struct dir_iterator_t *it, sqfs_dir_entry_t **out);
/**
* @brief If the last entry was a symlink, extract the target path
diff --git a/lib/fstree/src/fstree.c b/lib/fstree/src/fstree.c
index 1421d44..432a380 100644
--- a/lib/fstree/src/fstree.c
+++ b/lib/fstree/src/fstree.c
@@ -75,7 +75,7 @@ static void insert_sorted(tree_node_t *root, tree_node_t *n)
static tree_node_t *mknode(fstree_t *fs, tree_node_t *parent, const char *name,
size_t name_len, const char *extra,
- const dir_entry_t *ent)
+ const sqfs_dir_entry_t *ent)
{
tree_node_t *n;
size_t size;
@@ -212,7 +212,7 @@ tree_node_t *fstree_get_node_by_path(fstree_t *fs, tree_node_t *root,
n = child_by_name(root, path, len);
if (n == NULL) {
- dir_entry_t ent;
+ sqfs_dir_entry_t ent;
if (!create_implicitly) {
errno = ENOENT;
@@ -239,7 +239,7 @@ tree_node_t *fstree_get_node_by_path(fstree_t *fs, tree_node_t *root,
return root;
}
-tree_node_t *fstree_add_generic(fstree_t *fs, const dir_entry_t *ent,
+tree_node_t *fstree_add_generic(fstree_t *fs, const sqfs_dir_entry_t *ent,
const char *extra)
{
tree_node_t *child, *parent;
diff --git a/lib/fstree/test/add_by_path.c b/lib/fstree/test/add_by_path.c
index 4fd7d3d..b9f4b75 100644
--- a/lib/fstree/test/add_by_path.c
+++ b/lib/fstree/test/add_by_path.c
@@ -10,10 +10,10 @@
#include "common.h"
#include "util/test.h"
-static dir_entry_t *mkentry(const char *name, sqfs_u16 mode, sqfs_u32 uid,
+static sqfs_dir_entry_t *mkentry(const char *name, sqfs_u16 mode, sqfs_u32 uid,
sqfs_u32 gid)
{
- dir_entry_t *ent = dir_entry_create(name);
+ sqfs_dir_entry_t *ent = dir_entry_create(name);
TEST_NOT_NULL(ent);
ent->mode = mode;
@@ -26,7 +26,7 @@ int main(int argc, char **argv)
{
fstree_defaults_t fsd;
tree_node_t *a, *b;
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
fstree_t fs;
char *opts;
(void)argc; (void)argv;
diff --git a/lib/fstree/test/fstree_sort.c b/lib/fstree/test/fstree_sort.c
index 7bce367..6f20ce7 100644
--- a/lib/fstree/test/fstree_sort.c
+++ b/lib/fstree/test/fstree_sort.c
@@ -12,7 +12,7 @@
static tree_node_t *mkentry(fstree_t *fs, const char *name)
{
- dir_entry_t *ent = dir_entry_create(name);
+ sqfs_dir_entry_t *ent = dir_entry_create(name);
tree_node_t *out;
TEST_NOT_NULL(ent);
diff --git a/lib/fstree/test/gen_inode_numbers.c b/lib/fstree/test/gen_inode_numbers.c
index ea310a4..34d8322 100644
--- a/lib/fstree/test/gen_inode_numbers.c
+++ b/lib/fstree/test/gen_inode_numbers.c
@@ -12,7 +12,7 @@
static tree_node_t *gen_node(fstree_t *fs, const char *path)
{
- dir_entry_t *ent = dir_entry_create(path);
+ sqfs_dir_entry_t *ent = dir_entry_create(path);
tree_node_t *ret;
TEST_NOT_NULL(ent);
diff --git a/lib/fstree/test/get_path.c b/lib/fstree/test/get_path.c
index 50faeb4..f248c79 100644
--- a/lib/fstree/test/get_path.c
+++ b/lib/fstree/test/get_path.c
@@ -10,9 +10,9 @@
#include "common.h"
#include "util/test.h"
-static dir_entry_t *mkentry(const char *name)
+static sqfs_dir_entry_t *mkentry(const char *name)
{
- dir_entry_t *ent = dir_entry_create(name);
+ sqfs_dir_entry_t *ent = dir_entry_create(name);
TEST_NOT_NULL(ent);
ent->mode = S_IFDIR | 0750;
ent->uid = 1000;
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
{
tree_node_t *a, *b, *c, *d;
fstree_defaults_t fsd;
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
fstree_t fs;
char *str;
(void)argc; (void)argv;
diff --git a/lib/fstree/test/mknode_dir.c b/lib/fstree/test/mknode_dir.c
index 080cc0e..f852706 100644
--- a/lib/fstree/test/mknode_dir.c
+++ b/lib/fstree/test/mknode_dir.c
@@ -9,9 +9,9 @@
#include "fstree.h"
#include "util/test.h"
-static dir_entry_t *mkentry(const char *name)
+static sqfs_dir_entry_t *mkentry(const char *name)
{
- dir_entry_t *ent = dir_entry_create(name);
+ sqfs_dir_entry_t *ent = dir_entry_create(name);
TEST_NOT_NULL(ent);
ent->mode = S_IFDIR | 0654;
ent->uid = 123;
@@ -25,7 +25,7 @@ int main(int argc, char **argv)
{
fstree_defaults_t defaults;
tree_node_t *root, *a, *b;
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
fstree_t fs;
int ret;
(void)argc; (void)argv;
diff --git a/lib/fstree/test/mknode_simple.c b/lib/fstree/test/mknode_simple.c
index 0e7c872..d871c5a 100644
--- a/lib/fstree/test/mknode_simple.c
+++ b/lib/fstree/test/mknode_simple.c
@@ -9,9 +9,9 @@
#include "fstree.h"
#include "util/test.h"
-static dir_entry_t *mkentry(const char *name, sqfs_u16 mode)
+static sqfs_dir_entry_t *mkentry(const char *name, sqfs_u16 mode)
{
- dir_entry_t *ent = dir_entry_create(name);
+ sqfs_dir_entry_t *ent = dir_entry_create(name);
TEST_NOT_NULL(ent);
ent->mode = mode | 0654;
ent->uid = 123;
@@ -25,7 +25,7 @@ int main(int argc, char **argv)
{
fstree_defaults_t defaults;
tree_node_t *node;
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
fstree_t fs;
int ret;
(void)argc; (void)argv;
diff --git a/lib/io/src/dir_entry.c b/lib/io/src/dir_entry.c
index 15f078f..1bfc887 100644
--- a/lib/io/src/dir_entry.c
+++ b/lib/io/src/dir_entry.c
@@ -10,10 +10,10 @@
#include <stdlib.h>
#include <string.h>
-dir_entry_t *dir_entry_create(const char *name)
+sqfs_dir_entry_t *dir_entry_create(const char *name)
{
size_t len, name_len;
- dir_entry_t *out;
+ sqfs_dir_entry_t *out;
name_len = strlen(name);
if (SZ_ADD_OV(name_len, 1, &name_len))
diff --git a/lib/io/src/dir_tree_iterator.c b/lib/io/src/dir_tree_iterator.c
index 4303817..989907b 100644
--- a/lib/io/src/dir_tree_iterator.c
+++ b/lib/io/src/dir_tree_iterator.c
@@ -51,7 +51,7 @@ static int push(dir_tree_iterator_t *it, const char *name, dir_iterator_t *dir)
return 0;
}
-static bool should_skip(const dir_tree_iterator_t *dir, const dir_entry_t *ent)
+static bool should_skip(const dir_tree_iterator_t *dir, const sqfs_dir_entry_t *ent)
{
unsigned int type_mask;
@@ -76,7 +76,7 @@ static bool should_skip(const dir_tree_iterator_t *dir, const dir_entry_t *ent)
return (dir->cfg.flags & type_mask) != 0;
}
-static dir_entry_t *expand_path(const dir_tree_iterator_t *it, dir_entry_t *ent)
+static sqfs_dir_entry_t *expand_path(const dir_tree_iterator_t *it, sqfs_dir_entry_t *ent)
{
size_t slen = strlen(ent->name) + 1, plen = 0;
dir_stack_t *sit;
@@ -120,7 +120,7 @@ static dir_entry_t *expand_path(const dir_tree_iterator_t *it, dir_entry_t *ent)
return ent;
}
-static void apply_changes(const dir_tree_iterator_t *it, dir_entry_t *ent)
+static void apply_changes(const dir_tree_iterator_t *it, sqfs_dir_entry_t *ent)
{
if (!(it->cfg.flags & DIR_SCAN_KEEP_TIME))
ent->mtime = it->cfg.def_mtime;
@@ -149,11 +149,11 @@ static void destroy(sqfs_object_t *obj)
free(it);
}
-static int next(dir_iterator_t *base, dir_entry_t **out)
+static int next(dir_iterator_t *base, sqfs_dir_entry_t **out)
{
dir_tree_iterator_t *it = (dir_tree_iterator_t *)base;
dir_iterator_t *sub;
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
int ret;
retry:
*out = NULL;
diff --git a/lib/io/src/unix/dir_iterator.c b/lib/io/src/unix/dir_iterator.c
index 5129eb0..99713fd 100644
--- a/lib/io/src/unix/dir_iterator.c
+++ b/lib/io/src/unix/dir_iterator.c
@@ -73,7 +73,7 @@ static int dir_read_link(dir_iterator_t *base, char **out)
return 0;
}
-static int dir_next(dir_iterator_t *base, dir_entry_t **out)
+static int dir_next(dir_iterator_t *base, sqfs_dir_entry_t **out)
{
unix_dir_iterator_t *it = (unix_dir_iterator_t *)base;
diff --git a/lib/io/src/win32/dir_iterator.c b/lib/io/src/win32/dir_iterator.c
index 22b4870..b7a47b9 100644
--- a/lib/io/src/win32/dir_iterator.c
+++ b/lib/io/src/win32/dir_iterator.c
@@ -50,10 +50,10 @@ static int dir_iterator_read_link(dir_iterator_t *it, char **out)
return SQFS_ERROR_UNSUPPORTED;
}
-static int dir_iterator_next(dir_iterator_t *it, dir_entry_t **out)
+static int dir_iterator_next(dir_iterator_t *it, sqfs_dir_entry_t **out)
{
dir_iterator_win32_t *w32 = (dir_iterator_win32_t *)it;
- dir_entry_t *ent = NULL;
+ sqfs_dir_entry_t *ent = NULL;
DWORD length;
if (w32->state == 0 && !w32->is_first) {
diff --git a/lib/io/test/dir_iterator.c b/lib/io/test/dir_iterator.c
index 57e76ab..1f04b96 100644
--- a/lib/io/test/dir_iterator.c
+++ b/lib/io/test/dir_iterator.c
@@ -13,8 +13,8 @@
static int compare_entries(const void *a, const void *b)
{
- const dir_entry_t *const *lhs = a;
- const dir_entry_t *const *rhs = b;
+ const sqfs_dir_entry_t *const *lhs = a;
+ const sqfs_dir_entry_t *const *rhs = b;
return strcmp((*lhs)->name, (*rhs)->name);
}
@@ -22,7 +22,7 @@ static int compare_entries(const void *a, const void *b)
int main(int argc, char **argv)
{
dir_iterator_t *dir, *suba, *subb, *subc, *sub;
- dir_entry_t *dent, *ent[6];
+ sqfs_dir_entry_t *dent, *ent[6];
size_t i;
int ret;
(void)argc; (void)argv;
diff --git a/lib/io/test/dir_tree_iterator.c b/lib/io/test/dir_tree_iterator.c
index 0c735e2..14fad7e 100644
--- a/lib/io/test/dir_tree_iterator.c
+++ b/lib/io/test/dir_tree_iterator.c
@@ -13,15 +13,15 @@
static int compare_entries(const void *a, const void *b)
{
- const dir_entry_t *const *lhs = a;
- const dir_entry_t *const *rhs = b;
+ const sqfs_dir_entry_t *const *lhs = a;
+ const sqfs_dir_entry_t *const *rhs = b;
return strcmp((*lhs)->name, (*rhs)->name);
}
int main(int argc, char **argv)
{
- dir_entry_t *ent[17];
+ sqfs_dir_entry_t *ent[17];
dir_iterator_t *dir;
dir_tree_cfg_t cfg;
size_t i;
diff --git a/lib/io/test/dir_tree_iterator2.c b/lib/io/test/dir_tree_iterator2.c
index 280fa78..961cd39 100644
--- a/lib/io/test/dir_tree_iterator2.c
+++ b/lib/io/test/dir_tree_iterator2.c
@@ -13,15 +13,15 @@
static int compare_entries(const void *a, const void *b)
{
- const dir_entry_t *const *lhs = a;
- const dir_entry_t *const *rhs = b;
+ const sqfs_dir_entry_t *const *lhs = a;
+ const sqfs_dir_entry_t *const *rhs = b;
return strcmp((*lhs)->name, (*rhs)->name);
}
int main(int argc, char **argv)
{
- dir_entry_t *ent[17];
+ sqfs_dir_entry_t *ent[17];
dir_iterator_t *dir;
dir_tree_cfg_t cfg;
size_t i;
diff --git a/lib/io/test/dir_tree_iterator3.c b/lib/io/test/dir_tree_iterator3.c
index 180beff..5e414d7 100644
--- a/lib/io/test/dir_tree_iterator3.c
+++ b/lib/io/test/dir_tree_iterator3.c
@@ -13,15 +13,15 @@
static int compare_entries(const void *a, const void *b)
{
- const dir_entry_t *const *lhs = a;
- const dir_entry_t *const *rhs = b;
+ const sqfs_dir_entry_t *const *lhs = a;
+ const sqfs_dir_entry_t *const *rhs = b;
return strcmp((*lhs)->name, (*rhs)->name);
}
int main(int argc, char **argv)
{
- dir_entry_t *ent[17];
+ sqfs_dir_entry_t *ent[17];
dir_iterator_t *dir;
dir_tree_cfg_t cfg;
size_t i;
diff --git a/lib/sqfs/src/dir_writer.c b/lib/sqfs/src/dir_writer.c
index 3f7fed1..3e2114a 100644
--- a/lib/sqfs/src/dir_writer.c
+++ b/lib/sqfs/src/dir_writer.c
@@ -23,18 +23,18 @@
#define DIR_INDEX_THRESHOLD (256)
-typedef struct dir_entry_t {
- struct dir_entry_t *next;
+typedef struct sqfs_dir_entry_t {
+ struct sqfs_dir_entry_t *next;
sqfs_u64 inode_ref;
sqfs_u32 inode_num;
sqfs_u16 type;
size_t name_len;
char name[];
-} dir_entry_t;
+} sqfs_dir_entry_t;
typedef struct index_ent_t {
struct index_ent_t *next;
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
sqfs_u64 block;
sqfs_u32 index;
} index_ent_t;
@@ -42,8 +42,8 @@ typedef struct index_ent_t {
struct sqfs_dir_writer_t {
sqfs_object_t base;
- dir_entry_t *list;
- dir_entry_t *list_end;
+ sqfs_dir_entry_t *list;
+ sqfs_dir_entry_t *list_end;
index_ent_t *idx;
index_ent_t *idx_end;
@@ -75,7 +75,7 @@ static int get_type(sqfs_u16 mode)
static void writer_reset(sqfs_dir_writer_t *writer)
{
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
index_ent_t *idx;
while (writer->idx != NULL) {
@@ -183,7 +183,7 @@ int sqfs_dir_writer_add_entry(sqfs_dir_writer_t *writer, const char *name,
sqfs_u32 inode_num, sqfs_u64 inode_ref,
sqfs_u16 mode)
{
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
int type, err;
type = get_type(mode);
@@ -218,10 +218,10 @@ int sqfs_dir_writer_add_entry(sqfs_dir_writer_t *writer, const char *name,
return 0;
}
-static size_t get_conseq_entry_count(sqfs_u32 offset, dir_entry_t *head)
+static size_t get_conseq_entry_count(sqfs_u32 offset, sqfs_dir_entry_t *head)
{
size_t size, count = 0;
- dir_entry_t *it;
+ sqfs_dir_entry_t *it;
sqfs_s32 diff;
size = (offset + sizeof(sqfs_dir_header_t)) % SQFS_META_BLOCK_SIZE;
@@ -250,7 +250,7 @@ static size_t get_conseq_entry_count(sqfs_u32 offset, dir_entry_t *head)
}
static int add_header(sqfs_dir_writer_t *writer, size_t count,
- dir_entry_t *ref, sqfs_u64 block)
+ sqfs_dir_entry_t *ref, sqfs_u64 block)
{
sqfs_dir_header_t hdr;
index_ent_t *idx;
@@ -285,7 +285,7 @@ static int add_header(sqfs_dir_writer_t *writer, size_t count,
int sqfs_dir_writer_end(sqfs_dir_writer_t *writer)
{
- dir_entry_t *it, *first;
+ sqfs_dir_entry_t *it, *first;
sqfs_dir_node_t ent;
sqfs_u16 *diff_u16;
size_t i, count;
diff --git a/lib/tar/src/iterator.c b/lib/tar/src/iterator.c
index 506148f..b11be77 100644
--- a/lib/tar/src/iterator.c
+++ b/lib/tar/src/iterator.c
@@ -164,7 +164,7 @@ static void strm_destroy(sqfs_object_t *obj)
/*****************************************************************************/
-static int it_next(dir_iterator_t *it, dir_entry_t **out)
+static int it_next(dir_iterator_t *it, sqfs_dir_entry_t **out)
{
tar_iterator_t *tar = (tar_iterator_t *)it;
int ret;
diff --git a/lib/tar/test/tar_iterator.c b/lib/tar/test/tar_iterator.c
index e59b210..6931a7c 100644
--- a/lib/tar/test/tar_iterator.c
+++ b/lib/tar/test/tar_iterator.c
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
{
sqfs_istream_t *fp, *ti, *ti2;
dir_iterator_t *it;
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
char buffer[100];
sqfs_s32 ret;
sqfs_s64 ts;
diff --git a/lib/tar/test/tar_iterator2.c b/lib/tar/test/tar_iterator2.c
index ac041fe..681835d 100644
--- a/lib/tar/test/tar_iterator2.c
+++ b/lib/tar/test/tar_iterator2.c
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
unsigned char buffer[941];
sqfs_istream_t *fp, *ti;
dir_iterator_t *it;
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
uint64_t offset;
sqfs_s32 i, ret;
int iret;
diff --git a/lib/tar/test/tar_iterator3.c b/lib/tar/test/tar_iterator3.c
index 214fe9c..36a9060 100644
--- a/lib/tar/test/tar_iterator3.c
+++ b/lib/tar/test/tar_iterator3.c
@@ -16,7 +16,7 @@ int main(int argc, char **argv)
sqfs_istream_t *fp, *ti;
dir_iterator_t *it;
char buffer[100];
- dir_entry_t *ent;
+ sqfs_dir_entry_t *ent;
char *link;
int ret;
(void)argc; (void)argv;