1 #ifndef FSMAP_H 2 # define FSMAP_H 3 4 # ifndef _GNU_SOURCE 5 # define _GNU_SOURCE // asprintf 6 # endif 7 # include <stdio.h> 8 # include <stdint.h> 9 # include <stdbool.h> 10 # include <sys/types.h> 11 # include <ext2fs/ext2fs.h> 12 13 struct fsmap_format { 14 void* (* init)(const char *file, const char *mountpoint); 15 int (* start_new_file)(char *path, ext2_ino_t ino, 16 struct ext2_inode *inode, void *data); 17 int (* add_block)(ext2_filsys fs, blk64_t blocknr, int metadata, 18 void *data); 19 int (* inline_data)(void *inline_data, void *data); 20 int (* end_new_file)(void *data); 21 int (* cleanup)(void *data); 22 23 void *private; 24 }; 25 26 errcode_t fsmap_iter_filsys(ext2_filsys fs, struct fsmap_format *format, 27 const char *file, const char *mountpoint); 28 29 #endif /* !FSMAP_H */ 30