aboutsummaryrefslogtreecommitdiff
path: root/lib/io/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/io/src')
-rw-r--r--lib/io/src/dir_tree_iterator.c13
-rw-r--r--lib/io/src/unix/dir_iterator.c9
-rw-r--r--lib/io/src/win32/dir_iterator.c9
3 files changed, 31 insertions, 0 deletions
diff --git a/lib/io/src/dir_tree_iterator.c b/lib/io/src/dir_tree_iterator.c
index 51d289a..0174d73 100644
--- a/lib/io/src/dir_tree_iterator.c
+++ b/lib/io/src/dir_tree_iterator.c
@@ -284,6 +284,18 @@ static int open_file_ro(dir_iterator_t *base, istream_t **out)
return it->top->dir->open_file_ro(it->top->dir, out);
}
+static int read_xattr(dir_iterator_t *base, dir_entry_xattr_t **out)
+{
+ dir_tree_iterator_t *it = (dir_tree_iterator_t *)base;
+
+ if (it->top == NULL) {
+ *out = NULL;
+ return SQFS_ERROR_NO_ENTRY;
+ }
+
+ return it->top->dir->read_xattr(it->top->dir, out);
+}
+
dir_iterator_t *dir_tree_iterator_create(const char *path,
const dir_tree_cfg_t *cfg)
{
@@ -315,6 +327,7 @@ dir_iterator_t *dir_tree_iterator_create(const char *path,
((dir_iterator_t *)it)->open_subdir = open_subdir;
((dir_iterator_t *)it)->ignore_subdir = ignore_subdir;
((dir_iterator_t *)it)->open_file_ro = open_file_ro;
+ ((dir_iterator_t *)it)->read_xattr = read_xattr;
return (dir_iterator_t *)it;
fail:
diff --git a/lib/io/src/unix/dir_iterator.c b/lib/io/src/unix/dir_iterator.c
index d6a7454..fb7edae 100644
--- a/lib/io/src/unix/dir_iterator.c
+++ b/lib/io/src/unix/dir_iterator.c
@@ -137,6 +137,13 @@ static int dir_open_file_ro(dir_iterator_t *it, istream_t **out)
return SQFS_ERROR_UNSUPPORTED;
}
+static int dir_read_xattr(dir_iterator_t *it, dir_entry_xattr_t **out)
+{
+ (void)it;
+ *out = NULL;
+ return 0;
+}
+
static int dir_open_subdir(dir_iterator_t *base, dir_iterator_t **out)
{
const unix_dir_iterator_t *it = (const unix_dir_iterator_t *)base;
@@ -178,6 +185,7 @@ static int dir_open_subdir(dir_iterator_t *base, dir_iterator_t **out)
((dir_iterator_t *)sub)->open_subdir = dir_open_subdir;
((dir_iterator_t *)sub)->ignore_subdir = dir_ignore_subdir;
((dir_iterator_t *)sub)->open_file_ro = dir_open_file_ro;
+ ((dir_iterator_t *)sub)->read_xattr = dir_read_xattr;
*out = (dir_iterator_t *)sub;
return 0;
@@ -219,6 +227,7 @@ dir_iterator_t *dir_iterator_create(const char *path)
((dir_iterator_t *)it)->open_subdir = dir_open_subdir;
((dir_iterator_t *)it)->ignore_subdir = dir_ignore_subdir;
((dir_iterator_t *)it)->open_file_ro = dir_open_file_ro;
+ ((dir_iterator_t *)it)->read_xattr = dir_read_xattr;
return (dir_iterator_t *)it;
}
diff --git a/lib/io/src/win32/dir_iterator.c b/lib/io/src/win32/dir_iterator.c
index d8ac8f3..c9defc7 100644
--- a/lib/io/src/win32/dir_iterator.c
+++ b/lib/io/src/win32/dir_iterator.c
@@ -119,6 +119,13 @@ static int dir_iterator_open_file_ro(dir_iterator_t *it, istream_t **out)
return SQFS_ERROR_UNSUPPORTED;
}
+static int dir_iterator_read_xattr(dir_iterator_t *it, dir_entry_xattr_t **out)
+{
+ (void)it;
+ *out = NULL;
+ return 0;
+}
+
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;
@@ -153,6 +160,7 @@ static int dir_iterator_open_subdir(dir_iterator_t *it, dir_iterator_t **out)
((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;
+ ((dir_iterator_t *)sub)->read_xattr = dir_iterator_read_xattr;
sub->is_first = true;
sub->state = 0;
@@ -214,6 +222,7 @@ dir_iterator_t *dir_iterator_create(const char *path)
((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;
it->is_first = true;
it->state = 0;