paul@250 | 1 | /* |
paul@250 | 2 | * Common utilities for filesystem users. |
paul@250 | 3 | * |
paul@250 | 4 | * Copyright (C) 2019, 2022 Paul Boddie <paul@boddie.org.uk> |
paul@250 | 5 | * |
paul@250 | 6 | * This program is free software; you can redistribute it and/or |
paul@250 | 7 | * modify it under the terms of the GNU General Public License as |
paul@250 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@250 | 9 | * the License, or (at your option) any later version. |
paul@250 | 10 | * |
paul@250 | 11 | * This program is distributed in the hope that it will be useful, |
paul@250 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@250 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@250 | 14 | * GNU General Public License for more details. |
paul@250 | 15 | * |
paul@250 | 16 | * You should have received a copy of the GNU General Public License |
paul@250 | 17 | * along with this program; if not, write to the Free Software |
paul@250 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@250 | 19 | * Boston, MA 02110-1301, USA |
paul@250 | 20 | */ |
paul@250 | 21 | |
paul@250 | 22 | #ifndef __UTILS_H__ |
paul@250 | 23 | #define __UTILS_H__ |
paul@250 | 24 | |
paul@250 | 25 | #include <ext2fs/ext2fs.h> |
paul@250 | 26 | |
paul@250 | 27 | #ifdef __cplusplus |
paul@250 | 28 | extern "C" { |
paul@250 | 29 | #endif |
paul@250 | 30 | |
paul@250 | 31 | struct utils_list_dir_data |
paul@250 | 32 | { |
paul@250 | 33 | ext2_filsys fs; /* filesystem */ |
paul@250 | 34 | const char *filename; /* single filename to show */ |
paul@252 | 35 | int link_count; /* flag to show link counts */ |
paul@250 | 36 | }; |
paul@250 | 37 | |
paul@250 | 38 | errcode_t utils_list_dir(ext2_filsys fs, const char *path); |
paul@250 | 39 | |
paul@250 | 40 | int utils_list_dir_proc(struct ext2_dir_entry *dirent, int offset, |
paul@250 | 41 | int blocksize, char *buf, void *priv_data); |
paul@250 | 42 | |
paul@250 | 43 | #ifdef __cplusplus |
paul@250 | 44 | } |
paul@250 | 45 | #endif |
paul@250 | 46 | |
paul@250 | 47 | #endif /* __UTILS_H__ */ |
paul@250 | 48 | |
paul@250 | 49 | /* vim: tabstop=4 expandtab shiftwidth=4 |
paul@250 | 50 | */ |