e2p.h revision 7100351d352903aa84cb2978ef9389ee5b0b09ad
1#include <sys/types.h>		/* Needed by dirent.h on netbsd */
2#include <stdio.h>
3#include <dirent.h>
4
5#include <ext2fs/ext2_fs.h>
6
7#define E2P_FEATURE_COMPAT	0
8#define E2P_FEATURE_INCOMPAT	1
9#define E2P_FEATURE_RO_INCOMPAT	2
10#define E2P_FEATURE_TYPE_MASK	0x03
11
12#define E2P_FEATURE_NEGATE_FLAG	0x80
13
14/* `options' for print_flags() */
15
16#define PFOPT_LONG  1 /* Must be 1 for compatibility with `int long_format'. */
17
18
19int fgetflags (const char * name, unsigned long * flags);
20int fgetversion (const char * name, unsigned long * version);
21int fsetflags (const char * name, unsigned long flags);
22int fsetversion (const char * name, unsigned long version);
23int getflags (int fd, unsigned long * flags);
24int getversion (int fd, unsigned long * version);
25int iterate_on_dir (const char * dir_name,
26		    int (*func) (const char *, struct dirent *, void *),
27		    void * private);
28void list_super(struct ext2_super_block * s);
29void list_super2(struct ext2_super_block * s, FILE *f);
30void print_fs_errors (FILE * f, unsigned short errors);
31void print_flags (FILE * f, unsigned long flags, unsigned options);
32void print_fs_state (FILE * f, unsigned short state);
33int setflags (int fd, unsigned long flags);
34int setversion (int fd, unsigned long version);
35
36const char *e2p_feature2string(int compat, unsigned int mask);
37int e2p_string2feature(char *string, int *compat, unsigned int *mask);
38int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array);
39int e2p_edit_feature2(const char *str, __u32 *compat_array, __u32 *ok_array,
40		      __u32 *clear_ok_array, int *type_err,
41		      unsigned int *mask_err);
42
43int e2p_is_null_uuid(void *uu);
44void e2p_uuid_to_str(void *uu, char *out);
45const char *e2p_uuid2str(void *uu);
46
47const char *e2p_hash2string(int num);
48int e2p_string2hash(char *string);
49
50const char *e2p_mntopt2string(unsigned int mask);
51int e2p_string2mntopt(char *string, unsigned int *mask);
52int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok);
53
54unsigned long parse_num_blocks(const char *arg, int log_block_size);
55
56char *e2p_os2string(int os_type);
57int e2p_string2os(char *str);
58
59unsigned int e2p_percent(int percent, unsigned int base);
60