Mike Frysinger | 51a43b4 | 2005-09-24 07:11:16 +0000 | [diff] [blame] | 1 | /* |
| 2 | * fsck.h |
| 3 | */ |
| 4 | |
| 5 | #include <time.h> |
| 6 | |
| 7 | #define FSCK_ATTR(x) __attribute__(x) |
| 8 | |
| 9 | |
| 10 | #ifndef DEFAULT_FSTYPE |
| 11 | #define DEFAULT_FSTYPE "ext2" |
| 12 | #endif |
| 13 | |
| 14 | #define MAX_DEVICES 32 |
| 15 | #define MAX_ARGS 32 |
| 16 | |
| 17 | #define EXIT_OK 0 |
| 18 | #define EXIT_NONDESTRUCT 1 |
| 19 | #define EXIT_DESTRUCT 2 |
| 20 | #define EXIT_UNCORRECTED 4 |
| 21 | #define EXIT_ERROR 8 |
| 22 | #define EXIT_USAGE 16 |
| 23 | #define EXIT_LIBRARY 128 |
| 24 | |
| 25 | /* |
| 26 | * Internal structure for mount tabel entries. |
| 27 | */ |
| 28 | |
| 29 | struct fs_info { |
| 30 | char *device; |
| 31 | char *mountpt; |
| 32 | char *type; |
| 33 | char *opts; |
| 34 | int freq; |
| 35 | int passno; |
| 36 | int flags; |
| 37 | struct fs_info *next; |
| 38 | }; |
| 39 | |
| 40 | #define FLAG_DONE 1 |
| 41 | #define FLAG_PROGRESS 2 |
| 42 | |
| 43 | /* |
| 44 | * Structure to allow exit codes to be stored |
| 45 | */ |
| 46 | struct fsck_instance { |
| 47 | int pid; |
| 48 | int flags; |
| 49 | int exit_status; |
| 50 | time_t start_time; |
| 51 | char * prog; |
| 52 | char * type; |
| 53 | char * device; |
| 54 | char * base_device; |
| 55 | struct fsck_instance *next; |
| 56 | }; |
| 57 | |
| 58 | extern char *base_device(const char *device); |
| 59 | extern const char *identify_fs(const char *fs_name, const char *fs_types); |