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