e2p.h revision 7100351d352903aa84cb2978ef9389ee5b0b09ad
150e1e10fa0ac12a3e2a9d20a75ee9041873cda96Theodore Ts'o#include <sys/types.h>		/* Needed by dirent.h on netbsd */
23839e65723771b85975f4263102dd3ceec4523cTheodore Ts'o#include <stdio.h>
350e1e10fa0ac12a3e2a9d20a75ee9041873cda96Theodore Ts'o#include <dirent.h>
43839e65723771b85975f4263102dd3ceec4523cTheodore Ts'o
57c2d25699f2da458ba8201a375b00562d7a2469eTheodore Ts'o#include <ext2fs/ext2_fs.h>
63839e65723771b85975f4263102dd3ceec4523cTheodore Ts'o
7d7b701ded6fda284d7c77cd5ac48c2607ff72b13Theodore Ts'o#define E2P_FEATURE_COMPAT	0
8d7b701ded6fda284d7c77cd5ac48c2607ff72b13Theodore Ts'o#define E2P_FEATURE_INCOMPAT	1
9d7b701ded6fda284d7c77cd5ac48c2607ff72b13Theodore Ts'o#define E2P_FEATURE_RO_INCOMPAT	2
107100351d352903aa84cb2978ef9389ee5b0b09adTheodore Ts'o#define E2P_FEATURE_TYPE_MASK	0x03
11d7b701ded6fda284d7c77cd5ac48c2607ff72b13Theodore Ts'o
127100351d352903aa84cb2978ef9389ee5b0b09adTheodore Ts'o#define E2P_FEATURE_NEGATE_FLAG	0x80
13dede39bbb8ef92920f26875de7d5cc64a319e033Theodore Ts'o
14dede39bbb8ef92920f26875de7d5cc64a319e033Theodore Ts'o/* `options' for print_flags() */
15dede39bbb8ef92920f26875de7d5cc64a319e033Theodore Ts'o
16dede39bbb8ef92920f26875de7d5cc64a319e033Theodore Ts'o#define PFOPT_LONG  1 /* Must be 1 for compatibility with `int long_format'. */
17dede39bbb8ef92920f26875de7d5cc64a319e033Theodore Ts'o
18dede39bbb8ef92920f26875de7d5cc64a319e033Theodore Ts'o
193839e65723771b85975f4263102dd3ceec4523cTheodore Ts'oint fgetflags (const char * name, unsigned long * flags);
203839e65723771b85975f4263102dd3ceec4523cTheodore Ts'oint fgetversion (const char * name, unsigned long * version);
213839e65723771b85975f4263102dd3ceec4523cTheodore Ts'oint fsetflags (const char * name, unsigned long flags);
223839e65723771b85975f4263102dd3ceec4523cTheodore Ts'oint fsetversion (const char * name, unsigned long version);
233839e65723771b85975f4263102dd3ceec4523cTheodore Ts'oint getflags (int fd, unsigned long * flags);
243839e65723771b85975f4263102dd3ceec4523cTheodore Ts'oint getversion (int fd, unsigned long * version);
253839e65723771b85975f4263102dd3ceec4523cTheodore Ts'oint iterate_on_dir (const char * dir_name,
263839e65723771b85975f4263102dd3ceec4523cTheodore Ts'o		    int (*func) (const char *, struct dirent *, void *),
273839e65723771b85975f4263102dd3ceec4523cTheodore Ts'o		    void * private);
2853d3955001593b668b15e2d10b3a191f689f9779Theodore Ts'ovoid list_super(struct ext2_super_block * s);
2953d3955001593b668b15e2d10b3a191f689f9779Theodore Ts'ovoid list_super2(struct ext2_super_block * s, FILE *f);
303839e65723771b85975f4263102dd3ceec4523cTheodore Ts'ovoid print_fs_errors (FILE * f, unsigned short errors);
31dede39bbb8ef92920f26875de7d5cc64a319e033Theodore Ts'ovoid print_flags (FILE * f, unsigned long flags, unsigned options);
323839e65723771b85975f4263102dd3ceec4523cTheodore Ts'ovoid print_fs_state (FILE * f, unsigned short state);
333839e65723771b85975f4263102dd3ceec4523cTheodore Ts'oint setflags (int fd, unsigned long flags);
343839e65723771b85975f4263102dd3ceec4523cTheodore Ts'oint setversion (int fd, unsigned long version);
351e3472c5f37ca3686dd69b079d4d02a302f5798dTheodore Ts'o
3636caf25f8d61eb8ffddc9895463bce5807e96808Theodore Ts'oconst char *e2p_feature2string(int compat, unsigned int mask);
37d7b701ded6fda284d7c77cd5ac48c2607ff72b13Theodore Ts'oint e2p_string2feature(char *string, int *compat, unsigned int *mask);
3836caf25f8d61eb8ffddc9895463bce5807e96808Theodore Ts'oint e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array);
397100351d352903aa84cb2978ef9389ee5b0b09adTheodore Ts'oint e2p_edit_feature2(const char *str, __u32 *compat_array, __u32 *ok_array,
407100351d352903aa84cb2978ef9389ee5b0b09adTheodore Ts'o		      __u32 *clear_ok_array, int *type_err,
417100351d352903aa84cb2978ef9389ee5b0b09adTheodore Ts'o		      unsigned int *mask_err);
42d7b701ded6fda284d7c77cd5ac48c2607ff72b13Theodore Ts'o
431e3472c5f37ca3686dd69b079d4d02a302f5798dTheodore Ts'oint e2p_is_null_uuid(void *uu);
441e3472c5f37ca3686dd69b079d4d02a302f5798dTheodore Ts'ovoid e2p_uuid_to_str(void *uu, char *out);
45f61fc0b5d98ef2455252d596e7b20131526d6762Theodore Ts'oconst char *e2p_uuid2str(void *uu);
46f61fc0b5d98ef2455252d596e7b20131526d6762Theodore Ts'o
47f61fc0b5d98ef2455252d596e7b20131526d6762Theodore Ts'oconst char *e2p_hash2string(int num);
48f61fc0b5d98ef2455252d596e7b20131526d6762Theodore Ts'oint e2p_string2hash(char *string);
49a0c3fd5e4cdc2e0b032c9ace89d960a622069c32Theodore Ts'o
504a959fe6f18a3b6023234a66f4455f7ec660b8b4Theodore Ts'oconst char *e2p_mntopt2string(unsigned int mask);
51a0c3fd5e4cdc2e0b032c9ace89d960a622069c32Theodore Ts'oint e2p_string2mntopt(char *string, unsigned int *mask);
52a0c3fd5e4cdc2e0b032c9ace89d960a622069c32Theodore Ts'oint e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok);
5355f4cbd96e0029f0ff67c4913192d87bf52fd149Theodore Ts'o
5455f4cbd96e0029f0ff67c4913192d87bf52fd149Theodore Ts'ounsigned long parse_num_blocks(const char *arg, int log_block_size);
5563253946309651c1015947d522e2ba4b35a807a5Theodore Ts'o
5663253946309651c1015947d522e2ba4b35a807a5Theodore Ts'ochar *e2p_os2string(int os_type);
5763253946309651c1015947d522e2ba4b35a807a5Theodore Ts'oint e2p_string2os(char *str);
58a8862d9e90d0d94761ba28dbbf9674308fd7d7c0Theodore Ts'o
59a8862d9e90d0d94761ba28dbbf9674308fd7d7c0Theodore Ts'ounsigned int e2p_percent(int percent, unsigned int base);
60