aboutsummaryrefslogtreecommitdiff
path: root/lib/io/src/win32
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-05-14 13:13:38 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-05-14 13:13:38 +0200
commit20a4e5acd78dcb5f681ab5320adb0289cebfc277 (patch)
tree6f394a029f4e985d7323ec9ef8a09a3a6610c280 /lib/io/src/win32
parent7d01bbb78c11cb54c96cf9708916a116190364cb (diff)
libio: Add a function to open an istream_t from a directory iterator
For the native versions, this is currently dummied out, always returning an error number. The idea is to laster wrap the libtar interface around a directory iterator, here we need that method to support the existing use case in tar2sqfs. 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.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/io/src/win32/dir_iterator.c b/lib/io/src/win32/dir_iterator.c
index 94fd6e6..d8ac8f3 100644
--- a/lib/io/src/win32/dir_iterator.c
+++ b/lib/io/src/win32/dir_iterator.c
@@ -112,6 +112,13 @@ static void dir_iterator_ignore_subdir(dir_iterator_t *it)
(void)it;
}
+static int dir_iterator_open_file_ro(dir_iterator_t *it, istream_t **out)
+{
+ (void)it;
+ *out = NULL;
+ return SQFS_ERROR_UNSUPPORTED;
+}
+
static int dir_iterator_open_subdir(dir_iterator_t *it, dir_iterator_t **out)
{
const dir_iterator_win32_t *dir = (const dir_iterator_win32_t *)it;
@@ -145,6 +152,7 @@ static int dir_iterator_open_subdir(dir_iterator_t *it, dir_iterator_t **out)
((dir_iterator_t *)sub)->read_link = dir_iterator_read_link;
((dir_iterator_t *)sub)->open_subdir = dir_iterator_open_subdir;
((dir_iterator_t *)sub)->ignore_subdir = dir_iterator_ignore_subdir;
+ ((dir_iterator_t *)sub)->open_file_ro = dir_iterator_open_file_ro;
sub->is_first = true;
sub->state = 0;
@@ -205,6 +213,7 @@ dir_iterator_t *dir_iterator_create(const char *path)
((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;
it->is_first = true;
it->state = 0;