aboutsummaryrefslogtreecommitdiff
path: root/lib/io/src/win32
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-07-15 14:51:20 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-08-10 09:28:25 +0200
commitf572a1ed601267438c34c61a201ae1ab051da7a3 (patch)
tree9fde385df0791860e31dc474bed03b10caf81fd6 /lib/io/src/win32
parenta7bf75ebdb991092dd9165db99acfa034166fb43 (diff)
Refactor: rename dir_iterator_t to sqfs_dir_iterator_t
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/io/src/win32')
-rw-r--r--lib/io/src/win32/dir_iterator.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/lib/io/src/win32/dir_iterator.c b/lib/io/src/win32/dir_iterator.c
index f66e323..15cfbc5 100644
--- a/lib/io/src/win32/dir_iterator.c
+++ b/lib/io/src/win32/dir_iterator.c
@@ -18,7 +18,7 @@
#define W32_TICS_PER_SEC 10000000UL
typedef struct {
- dir_iterator_t base;
+ sqfs_dir_iterator_t base;
WIN32_FIND_DATAW ent;
HANDLE dirhnd;
@@ -44,14 +44,14 @@ static sqfs_s64 w32time_to_unix(const FILETIME *ft)
return w32ts - UNIX_EPOCH_ON_W32;
}
-static int dir_iterator_read_link(dir_iterator_t *it, char **out)
+static int dir_iterator_read_link(sqfs_dir_iterator_t *it, char **out)
{
(void)it;
*out = NULL;
return SQFS_ERROR_UNSUPPORTED;
}
-static int dir_iterator_next(dir_iterator_t *it, sqfs_dir_entry_t **out)
+static int dir_iterator_next(sqfs_dir_iterator_t *it, sqfs_dir_entry_t **out)
{
dir_iterator_win32_t *w32 = (dir_iterator_win32_t *)it;
sqfs_dir_entry_t *ent = NULL;
@@ -115,12 +115,13 @@ static void dir_iterator_destroy(sqfs_object_t *obj)
free(dir);
}
-static void dir_iterator_ignore_subdir(dir_iterator_t *it)
+static void dir_iterator_ignore_subdir(sqfs_dir_iterator_t *it)
{
(void)it;
}
-static int dir_iterator_open_file_ro(dir_iterator_t *it, sqfs_istream_t **out)
+static int dir_iterator_open_file_ro(sqfs_dir_iterator_t *it,
+ sqfs_istream_t **out)
{
dir_iterator_win32_t *dir = (dir_iterator_win32_t *)it;
size_t plen, slen;
@@ -184,7 +185,7 @@ static int dir_iterator_open_file_ro(dir_iterator_t *it, sqfs_istream_t **out)
return ret;
}
-static int dir_iterator_read_xattr(dir_iterator_t *it, sqfs_xattr_t **out)
+static int dir_iterator_read_xattr(sqfs_dir_iterator_t *it, sqfs_xattr_t **out)
{
(void)it;
*out = NULL;
@@ -193,7 +194,8 @@ static int dir_iterator_read_xattr(dir_iterator_t *it, sqfs_xattr_t **out)
static int dir_iterator_init(dir_iterator_win32_t *it);
-static int dir_iterator_open_subdir(dir_iterator_t *it, dir_iterator_t **out)
+static int dir_iterator_open_subdir(sqfs_dir_iterator_t *it,
+ sqfs_dir_iterator_t **out)
{
const dir_iterator_win32_t *dir = (const dir_iterator_win32_t *)it;
dir_iterator_win32_t *sub = NULL;
@@ -228,7 +230,7 @@ static int dir_iterator_open_subdir(dir_iterator_t *it, dir_iterator_t **out)
sub = NULL;
}
- *out = (dir_iterator_t *)sub;
+ *out = (sqfs_dir_iterator_t *)sub;
return ret;
}
@@ -236,12 +238,12 @@ static int dir_iterator_init(dir_iterator_win32_t *it)
{
sqfs_object_init(it, dir_iterator_destroy, NULL);
- ((dir_iterator_t *)it)->next = dir_iterator_next;
- ((dir_iterator_t *)it)->read_link = dir_iterator_read_link;
- ((dir_iterator_t *)it)->open_subdir = dir_iterator_open_subdir;
- ((dir_iterator_t *)it)->ignore_subdir = dir_iterator_ignore_subdir;
- ((dir_iterator_t *)it)->open_file_ro = dir_iterator_open_file_ro;
- ((dir_iterator_t *)it)->read_xattr = dir_iterator_read_xattr;
+ ((sqfs_dir_iterator_t *)it)->next = dir_iterator_next;
+ ((sqfs_dir_iterator_t *)it)->read_link = dir_iterator_read_link;
+ ((sqfs_dir_iterator_t *)it)->open_subdir = dir_iterator_open_subdir;
+ ((sqfs_dir_iterator_t *)it)->ignore_subdir = dir_iterator_ignore_subdir;
+ ((sqfs_dir_iterator_t *)it)->open_file_ro = dir_iterator_open_file_ro;
+ ((sqfs_dir_iterator_t *)it)->read_xattr = dir_iterator_read_xattr;
it->is_first = true;
it->state = 0;
@@ -252,7 +254,7 @@ static int dir_iterator_init(dir_iterator_win32_t *it)
return 0;
}
-dir_iterator_t *dir_iterator_create(const char *path)
+sqfs_dir_iterator_t *dir_iterator_create(const char *path)
{
dir_iterator_win32_t *it;
size_t len, newlen;
@@ -299,7 +301,7 @@ dir_iterator_t *dir_iterator_create(const char *path)
it = NULL;
}
- return (dir_iterator_t *)it;
+ return (sqfs_dir_iterator_t *)it;
fail_alloc:
fprintf(stderr, "%s: allocation failure.\n", path);
free(wpath);