/usr/include/libr/r_fs.h is in libradare2-dev 2.3.0+dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | #ifndef R2_FS_H
#define R2_FS_H
#include <r_types.h>
#include <r_list.h>
#include <r_bind.h> // RCoreBind
#include <r_io.h> // RIOBind
#ifdef __cplusplus
extern "C" {
#endif
R_LIB_VERSION_HEADER (r_fs);
struct r_fs_plugin_t;
struct r_fs_root_t;
struct r_fs_t;
typedef struct r_fs_t {
RIOBind iob;
RCoreBind cob;
RList /*<RFSPlugin>*/ *plugins;
RList /*<RFSRoot>*/ *roots;
int view;
void *ptr;
} RFS;
typedef struct r_fs_partition_plugin_t {
const char *name;
} RFSPartitionPlugin;
typedef struct r_fs_file_t {
char *name;
char *path;
ut64 off;
ut32 size;
ut8 *data;
void *ctx;
char type;
ut64 time;
struct r_fs_plugin_t *p;
struct r_fs_root_t *root;
void *ptr; // internal pointer
} RFSFile;
typedef struct r_fs_root_t {
char *path;
ut64 delta;
struct r_fs_plugin_t *p;
void *ptr;
RIOBind iob;
RCoreBind cob;
} RFSRoot;
typedef struct r_fs_plugin_t {
const char *name;
const char *desc;
const char *license;
RFSFile* (*slurp)(RFSRoot *root, const char *path);
RFSFile* (*open)(RFSRoot *root, const char *path);
bool (*read)(RFSFile *fs, ut64 addr, int len);
void (*close)(RFSFile *fs);
RList *(*dir)(RFSRoot *root, const char *path, int view);
void (*init)(void);
void (*fini)(void);
int (*mount)(RFSRoot *root);
void (*umount)(RFSRoot *root);
} RFSPlugin;
typedef struct r_fs_partition_t {
int number;
ut64 start;
ut64 length;
int index;
int type;
} RFSPartition;
#define R_FS_FILE_TYPE_MOUNTPOINT 'm'
#define R_FS_FILE_TYPE_DIRECTORY 'd'
#define R_FS_FILE_TYPE_REGULAR 'r'
#define R_FS_FILE_TYPE_DELETED 'x'
#define R_FS_FILE_TYPE_SPECIAL 's'
#define R_FS_FILE_TYPE_MOUNT 'm'
typedef int (*RFSPartitionIterator)(void *disk, void *ptr, void *user);
typedef struct r_fs_partition_type_t {
const char *name;
void *ptr; // grub_msdos_partition_map
RFSPartitionIterator iterate;
//RFSPartitionIterator parhook;
} RFSPartitionType;
#define R_FS_PARTITIONS_LENGTH (int)(sizeof (partitions)/sizeof(RFSPartitionType)-1)
enum {
R_FS_VIEW_NORMAL = 0,
R_FS_VIEW_DELETED = 1,
R_FS_VIEW_SPECIAL = 2,
R_FS_VIEW_ALL = 0xff,
};
#ifdef R_API
R_API RFS *r_fs_new(void);
R_API void r_fs_view(RFS* fs, int view);
R_API void r_fs_free(RFS* fs);
R_API void r_fs_add(RFS *fs, RFSPlugin *p);
R_API void r_fs_del(RFS *fs, RFSPlugin *p);
R_API RFSRoot *r_fs_mount(RFS* fs, const char *fstype, const char *path, ut64 delta);
R_API bool r_fs_umount(RFS* fs, const char *path);
R_API RList *r_fs_root(RFS *fs, const char *path);
R_API RFSFile *r_fs_open(RFS* fs, const char *path);
R_API void r_fs_close(RFS* fs, RFSFile *file);
R_API int r_fs_read(RFS* fs, RFSFile *file, ut64 addr, int len);
R_API RFSFile *r_fs_slurp(RFS* fs, const char *path);
R_API RList *r_fs_dir(RFS* fs, const char *path);
R_API int r_fs_dir_dump(RFS* fs, const char *path, const char *name);
R_API RList *r_fs_find_name(RFS* fs, const char *name, const char *glob);
R_API RList *r_fs_find_off(RFS* fs, const char *name, ut64 off);
R_API RList *r_fs_partitions(RFS* fs, const char *ptype, ut64 delta);
R_API char *r_fs_name(RFS *fs, ut64 offset);
R_API int r_fs_prompt(RFS *fs, const char *root);
R_API bool r_fs_check(RFS *fs, const char *p);
/* file.c */
R_API RFSFile *r_fs_file_new(RFSRoot *root, const char *path);
R_API void r_fs_file_free(RFSFile *file);
R_API RFSRoot *r_fs_root_new(const char *path, ut64 delta);
R_API void r_fs_root_free(RFSRoot *root);
R_API RFSPartition *r_fs_partition_new(int num, ut64 start, ut64 length);
R_API void r_fs_partition_free(RFSPartition *p);
R_API const char *r_fs_partition_type(const char *part, int type);
R_API const char *r_fs_partition_type_get(int n);
R_API int r_fs_partition_get_size(void); // WTF. wrong function name
/* plugins */
extern RFSPlugin r_fs_plugin_io;
extern RFSPlugin r_fs_plugin_r2;
extern RFSPlugin r_fs_plugin_ext2;
extern RFSPlugin r_fs_plugin_fat;
extern RFSPlugin r_fs_plugin_ntfs;
extern RFSPlugin r_fs_plugin_hfs;
extern RFSPlugin r_fs_plugin_hfsplus;
extern RFSPlugin r_fs_plugin_reiserfs;
extern RFSPlugin r_fs_plugin_tar;
extern RFSPlugin r_fs_plugin_iso9660;
extern RFSPlugin r_fs_plugin_udf;
extern RFSPlugin r_fs_plugin_ufs;
extern RFSPlugin r_fs_plugin_ufs2;
extern RFSPlugin r_fs_plugin_sfs;
extern RFSPlugin r_fs_plugin_tar;
extern RFSPlugin r_fs_plugin_btrfs;
extern RFSPlugin r_fs_plugin_jfs;
extern RFSPlugin r_fs_plugin_afs;
extern RFSPlugin r_fs_plugin_affs;
extern RFSPlugin r_fs_plugin_cpio;
extern RFSPlugin r_fs_plugin_xfs;
extern RFSPlugin r_fs_plugin_fb;
extern RFSPlugin r_fs_plugin_minix;
extern RFSPlugin r_fs_plugin_posix;
#endif
#ifdef __cplusplus
}
#endif
#endif
|