diff options
Diffstat (limited to 'lib/io')
-rw-r--r-- | lib/io/Makemodule.am | 2 | ||||
-rw-r--r-- | lib/io/src/dir_tree_iterator.c | 13 | ||||
-rw-r--r-- | lib/io/src/unix/dir_iterator.c | 9 | ||||
-rw-r--r-- | lib/io/src/win32/dir_iterator.c | 9 |
4 files changed, 32 insertions, 1 deletions
diff --git a/lib/io/Makemodule.am b/lib/io/Makemodule.am index 2fcd1a7..841febf 100644 --- a/lib/io/Makemodule.am +++ b/lib/io/Makemodule.am @@ -1,6 +1,6 @@ libio_a_SOURCES = include/io/istream.h include/io/ostream.h include/io/xfrm.h \ include/io/file.h include/io/std.h \ - include/io/dir_iterator.h \ + include/io/dir_iterator.h include/io/xattr.h \ lib/io/src/internal.h lib/io/src/ostream.c \ lib/io/src/istream.c lib/io/src/get_line.c lib/io/src/xfrm/ostream.c \ lib/io/src/xfrm/istream.c lib/io/src/dir_tree_iterator.c 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; |