1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/libe2access/include/e2access/image.h Wed Aug 25 01:28:08 2021 +0200
1.3 @@ -0,0 +1,79 @@
1.4 +/*
1.5 + * Filesystem image access functions.
1.6 + *
1.7 + * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
1.8 + *
1.9 + * This program is free software; you can redistribute it and/or
1.10 + * modify it under the terms of the GNU General Public License as
1.11 + * published by the Free Software Foundation; either version 2 of
1.12 + * the License, or (at your option) any later version.
1.13 + *
1.14 + * This program is distributed in the hope that it will be useful,
1.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.17 + * GNU General Public License for more details.
1.18 + *
1.19 + * You should have received a copy of the GNU General Public License
1.20 + * along with this program; if not, write to the Free Software
1.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
1.22 + * Boston, MA 02110-1301, USA
1.23 + */
1.24 +
1.25 +#ifndef __IMAGE_H__
1.26 +#define __IMAGE_H__
1.27 +
1.28 +#include <ext2fs/ext2fs.h>
1.29 +
1.30 +
1.31 +
1.32 +#ifdef __cplusplus
1.33 +extern "C" {
1.34 +#endif
1.35 +
1.36 +errcode_t image_create_file(ext2_filsys fs, ext2_ino_t ino_target,
1.37 + const char *basename, __u16 mode,
1.38 + __u16 uid, __u16 gid, ext2_ino_t *ino_file);
1.39 +
1.40 +errcode_t image_find_next(ext2_filsys fs, ext2_ino_t ino_dir,
1.41 + const char **basename, char *buf, ext2_ino_t *ino);
1.42 +
1.43 +errcode_t image_find_path(ext2_filsys fs, const char **pathname,
1.44 + ext2_ino_t *ino);
1.45 +
1.46 +errcode_t image_find_file(ext2_filsys fs, const char *dirname,
1.47 + const char *basename, ext2_ino_t *ino);
1.48 +
1.49 +errcode_t image_inode(ext2_filsys fs, const char *pathname,
1.50 + struct ext2_inode *inode);
1.51 +
1.52 +errcode_t image_make_dir(ext2_filsys fs, ext2_ino_t ino_dir,
1.53 + const char *basename, __u16 mode,
1.54 + __u16 uid, __u16 gid, ext2_ino_t *ino);
1.55 +
1.56 +errcode_t image_make_next_dir(ext2_filsys fs, ext2_ino_t ino_dir,
1.57 + const char **basename, __u16 mode, __u16 uid,
1.58 + __u16 gid, ext2_ino_t *ino);
1.59 +
1.60 +errcode_t image_make_dirs(ext2_filsys fs, const char **pathname,
1.61 + ext2_ino_t ino_dir, __u16 mode, __u16 uid,
1.62 + __u16 gid);
1.63 +
1.64 +void image_set_metadata(struct ext2_inode *inode, int clean, __u16 mode,
1.65 + __u16 uid, __u16 gid);
1.66 +
1.67 +errcode_t image_stat_inode(ext2_filsys fs, ext2_ino_t ino, struct stat *st);
1.68 +
1.69 +int _image_isdir(ext2_filsys fs, ext2_ino_t ino);
1.70 +
1.71 +int image_isdir(ext2_filsys fs, const char *name);
1.72 +
1.73 +int _image_isfile(ext2_filsys fs, ext2_ino_t ino);
1.74 +
1.75 +int image_isfile(ext2_filsys fs, const char *name);
1.76 +
1.77 +#ifdef __cplusplus
1.78 +}
1.79 +#endif
1.80 +
1.81 +
1.82 +#endif /* __IMAGE_H__ */