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