Extract common OMFS code into a library
[omfsprogs.git] / check.h
blob4a779407b2ec02606596cc7ac5f72a944068ac6e
1 #ifndef _CHECK_H
2 #define _CHECK_H
4 #include "config.h"
5 #include "omfs.h"
7 typedef struct _check_fs_config
9 int is_quiet;
10 } check_fs_config_t;
12 typedef enum
14 E_NONE,
15 E_HEADER_XOR,
16 E_HEADER_CRC,
17 E_BIT_SET,
18 E_BIT_CLEAR,
19 E_BITMAP,
20 E_HASH_WRONG,
21 E_BLOCKSIZE,
22 E_SYS_BLOCKSIZE,
23 E_MIRRORS,
24 E_EXTENT_COUNT,
25 E_TERMINATOR,
26 E_MAGIC,
27 E_FILE_MAGIC,
28 E_SELF_PTR,
29 E_PARENT_PTR,
30 E_READ_SUPER,
31 E_READ_ROOT,
32 E_INSANE,
33 E_SCAN,
34 E_LOOP
35 } check_error_t;
37 typedef struct check_context
39 check_fs_config_t *config;
40 u8 *bitmap;
41 u8 *visited;
42 omfs_inode_t *current_inode;
43 omfs_info_t *omfs_info;
44 u64 parent; /* parent inode number */
45 u64 block;
46 int hash;
47 } check_context_t;
49 int check_fs(FILE *fp, check_fs_config_t *config);
50 int check_fix(check_context_t *fix, check_error_t error_code);
52 #endif