xref: /aosp_15_r20/external/e2fsprogs/misc/fsck.h (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1*6a54128fSAndroid Build Coastguard Worker /*
2*6a54128fSAndroid Build Coastguard Worker  * fsck.h
3*6a54128fSAndroid Build Coastguard Worker  */
4*6a54128fSAndroid Build Coastguard Worker 
5*6a54128fSAndroid Build Coastguard Worker #include <time.h>
6*6a54128fSAndroid Build Coastguard Worker 
7*6a54128fSAndroid Build Coastguard Worker #ifdef __STDC__
8*6a54128fSAndroid Build Coastguard Worker #define NOARGS void
9*6a54128fSAndroid Build Coastguard Worker #else
10*6a54128fSAndroid Build Coastguard Worker #define NOARGS
11*6a54128fSAndroid Build Coastguard Worker #define const
12*6a54128fSAndroid Build Coastguard Worker #endif
13*6a54128fSAndroid Build Coastguard Worker 
14*6a54128fSAndroid Build Coastguard Worker #ifdef __GNUC__
15*6a54128fSAndroid Build Coastguard Worker #define FSCK_ATTR(x) __attribute__(x)
16*6a54128fSAndroid Build Coastguard Worker #else
17*6a54128fSAndroid Build Coastguard Worker #define FSCK_ATTR(x)
18*6a54128fSAndroid Build Coastguard Worker #endif
19*6a54128fSAndroid Build Coastguard Worker 
20*6a54128fSAndroid Build Coastguard Worker 
21*6a54128fSAndroid Build Coastguard Worker #ifndef DEFAULT_FSTYPE
22*6a54128fSAndroid Build Coastguard Worker #define DEFAULT_FSTYPE	"ext2"
23*6a54128fSAndroid Build Coastguard Worker #endif
24*6a54128fSAndroid Build Coastguard Worker 
25*6a54128fSAndroid Build Coastguard Worker #define MAX_DEVICES 32
26*6a54128fSAndroid Build Coastguard Worker #define MAX_ARGS 32
27*6a54128fSAndroid Build Coastguard Worker 
28*6a54128fSAndroid Build Coastguard Worker #define EXIT_OK          0
29*6a54128fSAndroid Build Coastguard Worker #define EXIT_NONDESTRUCT 1
30*6a54128fSAndroid Build Coastguard Worker #define EXIT_DESTRUCT    2
31*6a54128fSAndroid Build Coastguard Worker #define EXIT_UNCORRECTED 4
32*6a54128fSAndroid Build Coastguard Worker #define EXIT_ERROR       8
33*6a54128fSAndroid Build Coastguard Worker #define EXIT_USAGE       16
34*6a54128fSAndroid Build Coastguard Worker #define EXIT_LIBRARY     128
35*6a54128fSAndroid Build Coastguard Worker 
36*6a54128fSAndroid Build Coastguard Worker /*
37*6a54128fSAndroid Build Coastguard Worker  * Internal structure for mount table entries.
38*6a54128fSAndroid Build Coastguard Worker  */
39*6a54128fSAndroid Build Coastguard Worker 
40*6a54128fSAndroid Build Coastguard Worker struct fs_info {
41*6a54128fSAndroid Build Coastguard Worker 	char  *device;
42*6a54128fSAndroid Build Coastguard Worker 	char  *mountpt;
43*6a54128fSAndroid Build Coastguard Worker 	char  *type;
44*6a54128fSAndroid Build Coastguard Worker 	char  *opts;
45*6a54128fSAndroid Build Coastguard Worker 	int   freq;
46*6a54128fSAndroid Build Coastguard Worker 	int   passno;
47*6a54128fSAndroid Build Coastguard Worker 	int   flags;
48*6a54128fSAndroid Build Coastguard Worker 	struct fs_info *next;
49*6a54128fSAndroid Build Coastguard Worker };
50*6a54128fSAndroid Build Coastguard Worker 
51*6a54128fSAndroid Build Coastguard Worker #define FLAG_DONE 1
52*6a54128fSAndroid Build Coastguard Worker #define FLAG_PROGRESS 2
53*6a54128fSAndroid Build Coastguard Worker 
54*6a54128fSAndroid Build Coastguard Worker /*
55*6a54128fSAndroid Build Coastguard Worker  * Structure to allow exit codes to be stored
56*6a54128fSAndroid Build Coastguard Worker  */
57*6a54128fSAndroid Build Coastguard Worker struct fsck_instance {
58*6a54128fSAndroid Build Coastguard Worker 	int	pid;
59*6a54128fSAndroid Build Coastguard Worker 	int	flags;
60*6a54128fSAndroid Build Coastguard Worker 	int	exit_status;
61*6a54128fSAndroid Build Coastguard Worker 	time_t	start_time;
62*6a54128fSAndroid Build Coastguard Worker 	char *	prog;
63*6a54128fSAndroid Build Coastguard Worker 	char *	type;
64*6a54128fSAndroid Build Coastguard Worker 	char *	device;
65*6a54128fSAndroid Build Coastguard Worker 	char *	base_device;
66*6a54128fSAndroid Build Coastguard Worker 	struct fsck_instance *next;
67*6a54128fSAndroid Build Coastguard Worker };
68*6a54128fSAndroid Build Coastguard Worker 
69*6a54128fSAndroid Build Coastguard Worker extern char *base_device(const char *device);
70*6a54128fSAndroid Build Coastguard Worker extern const char *identify_fs(const char *fs_name, const char *fs_types);
71*6a54128fSAndroid Build Coastguard Worker 
72*6a54128fSAndroid Build Coastguard Worker /* ismounted.h */
73*6a54128fSAndroid Build Coastguard Worker extern int is_mounted(const char *file);
74