blob: 56afcf9888d39f61a86fe405e03dbf49161cb14a [file] [log] [blame]
Theodore Ts'o3839e651997-04-26 13:21:57 +00001/*
2 * fsck.h
3 */
4
Theodore Ts'o8820c792001-01-06 04:20:03 +00005#include <time.h>
6
Theodore Ts'o3839e651997-04-26 13:21:57 +00007#ifdef __STDC__
8#define NOARGS void
9#else
10#define NOARGS
11#define const
12#endif
13
14#ifndef DEFAULT_FSTYPE
Theodore Ts'of3db3561997-04-26 13:34:30 +000015#define DEFAULT_FSTYPE "ext2"
Theodore Ts'o3839e651997-04-26 13:21:57 +000016#endif
17
18#define MAX_DEVICES 32
19#define MAX_ARGS 32
20
21#define EXIT_OK 0
22#define EXIT_NONDESTRUCT 1
23#define EXIT_DESTRUCT 2
24#define EXIT_UNCORRECTED 4
25#define EXIT_ERROR 8
26#define EXIT_USAGE 16
27#define EXIT_LIBRARY 128
28
29/*
30 * Internal structure for mount tabel entries.
31 */
32
33struct fs_info {
34 char *device;
35 char *mountpt;
36 char *type;
37 char *opts;
38 int freq;
39 int passno;
40 int flags;
41 struct fs_info *next;
42};
43
44#define FLAG_DONE 1
Theodore Ts'o50787ea1999-07-19 15:30:21 +000045#define FLAG_PROGRESS 2
Theodore Ts'o3839e651997-04-26 13:21:57 +000046
47/*
48 * Structure to allow exit codes to be stored
49 */
50struct fsck_instance {
51 int pid;
52 int flags;
53 int exit_status;
Theodore Ts'o7f4bb6c1999-10-20 18:11:01 +000054 time_t start_time;
Theodore Ts'o3839e651997-04-26 13:21:57 +000055 char * prog;
Theodore Ts'o50787ea1999-07-19 15:30:21 +000056 char * type;
Theodore Ts'o3839e651997-04-26 13:21:57 +000057 char * device;
Theodore Ts'o793e27d2000-12-03 06:33:56 +000058 char * base_device;
Theodore Ts'o3839e651997-04-26 13:21:57 +000059 struct fsck_instance *next;
60};
61
Theodore Ts'oed1b33e2003-03-01 19:29:01 -050062extern char *base_device(const char *device);
Theodore Ts'o5599c2f2002-02-03 00:08:52 -050063extern const char *identify_fs(const char *fs_name, const char *fs_types);