blob: 78930ec17825b234b0f6e7dcbb8646e9905ffacb [file] [log] [blame]
Mike Frysingerd89e6292005-04-24 05:07:59 +00001#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
11
12/* `options' for print_flags() */
13
14#define PFOPT_LONG 1 /* Must be 1 for compatibility with `int long_format'. */
15
Mike Frysinger548ffd42005-05-07 07:14:41 +000016/*int fgetversion (const char * name, unsigned long * version);*/
17/*int fsetversion (const char * name, unsigned long version);*/
18int fgetsetversion(const char * name, unsigned long * get_version, unsigned long set_version);
19#define fgetversion(name, version) fgetsetversion(name, version, 0)
20#define fsetversion(name, version) fgetsetversion(name, NULL, version)
Mike Frysingerd89e6292005-04-24 05:07:59 +000021
Mike Frysinger548ffd42005-05-07 07:14:41 +000022/*int fgetflags (const char * name, unsigned long * flags);*/
23/*int fsetflags (const char * name, unsigned long flags);*/
24int fgetsetflags(const char * name, unsigned long * get_flags, unsigned long set_flags);
25#define fgetflags(name, flags) fgetsetflags(name, flags, 0)
26#define fsetflags(name, flags) fgetsetflags(name, NULL, flags)
27
Mike Frysingerd89e6292005-04-24 05:07:59 +000028int getflags (int fd, unsigned long * flags);
29int getversion (int fd, unsigned long * version);
30int iterate_on_dir (const char * dir_name,
31 int (*func) (const char *, struct dirent *, void *),
32 void * private);
33void list_super(struct ext2_super_block * s);
34void list_super2(struct ext2_super_block * s, FILE *f);
35void print_fs_errors (FILE * f, unsigned short errors);
36void print_flags (FILE * f, unsigned long flags, unsigned options);
37void print_fs_state (FILE * f, unsigned short state);
38int setflags (int fd, unsigned long flags);
39int setversion (int fd, unsigned long version);
40
41const char *e2p_feature2string(int compat, unsigned int mask);
42int e2p_string2feature(char *string, int *compat, unsigned int *mask);
43int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array);
44
45int e2p_is_null_uuid(void *uu);
46void e2p_uuid_to_str(void *uu, char *out);
47const char *e2p_uuid2str(void *uu);
48
49const char *e2p_hash2string(int num);
50int e2p_string2hash(char *string);
51
52const char *e2p_mntopt2string(unsigned int mask);
53int e2p_string2mntopt(char *string, unsigned int *mask);
54int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok);
55
56unsigned long parse_num_blocks(const char *arg, int log_block_size);
57
58char *e2p_os2string(int os_type);
59int e2p_string2os(char *str);