aboutsummaryrefslogtreecommitdiff
path: root/include/util/dir_iterator.h
blob: 66c13f379ec9c687167c034fbe628a415a7b1fed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* SPDX-License-Identifier: LGPL-3.0-or-later */
/*
 * dir_iterator.h
 *
 * Copyright (C) 2023 David Oberhollenzer <goliath@infraroot.at>
 */
#ifndef UTIL_DIR_ITERATOR_H
#define UTIL_DIR_ITERATOR_H

#include "sqfs/predef.h"

typedef struct {
	sqfs_s64 mtime;
	sqfs_u64 dev;
	sqfs_u64 rdev;
	sqfs_u32 uid;
	sqfs_u32 gid;
	sqfs_u16 mode;

	char name[];
} dir_entry_t;

typedef struct dir_iterator_t {
	sqfs_object_t obj;

	int (*next)(struct dir_iterator_t *it,
		    dir_entry_t **out);
} dir_iterator_t;

dir_iterator_t *dir_iterator_create(const char *path);

#endif /* UTIL_DIR_ITERATOR_H */