Home | History | Annotate | Download | only in e2p
      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 #define E2P_FS_FEATURE		0
     15 #define E2P_JOURNAL_FEATURE	1
     16 
     17 /* `options' for print_flags() */
     18 
     19 #define PFOPT_LONG  1 /* Must be 1 for compatibility with `int long_format'. */
     20 
     21 
     22 int fgetflags (const char * name, unsigned long * flags);
     23 int fgetversion (const char * name, unsigned long * version);
     24 int fsetflags (const char * name, unsigned long flags);
     25 int fsetversion (const char * name, unsigned long version);
     26 int getflags (int fd, unsigned long * flags);
     27 int getversion (int fd, unsigned long * version);
     28 int iterate_on_dir (const char * dir_name,
     29 		    int (*func) (const char *, struct dirent *, void *),
     30 		    void * private);
     31 void list_super(struct ext2_super_block * s);
     32 void list_super2(struct ext2_super_block * s, FILE *f);
     33 void print_fs_errors (FILE * f, unsigned short errors);
     34 void print_flags (FILE * f, unsigned long flags, unsigned options);
     35 void print_fs_state (FILE * f, unsigned short state);
     36 int setflags (int fd, unsigned long flags);
     37 int setversion (int fd, unsigned long version);
     38 
     39 const char *e2p_feature2string(int compat, unsigned int mask);
     40 const char *e2p_jrnl_feature2string(int compat, unsigned int mask);
     41 int e2p_string2feature(char *string, int *compat, unsigned int *mask);
     42 int e2p_jrnl_string2feature(char *string, int *compat_type, unsigned int *mask);
     43 int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array);
     44 int e2p_edit_feature2(const char *str, __u32 *compat_array, __u32 *ok_array,
     45 		      __u32 *clear_ok_array, int *type_err,
     46 		      unsigned int *mask_err);
     47 
     48 int e2p_is_null_uuid(void *uu);
     49 void e2p_uuid_to_str(void *uu, char *out);
     50 const char *e2p_uuid2str(void *uu);
     51 
     52 const char *e2p_hash2string(int num);
     53 int e2p_string2hash(char *string);
     54 
     55 const char *e2p_mntopt2string(unsigned int mask);
     56 int e2p_string2mntopt(char *string, unsigned int *mask);
     57 int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok);
     58 
     59 unsigned long parse_num_blocks(const char *arg, int log_block_size);
     60 
     61 char *e2p_os2string(int os_type);
     62 int e2p_string2os(char *str);
     63 
     64 unsigned int e2p_percent(int percent, unsigned int base);
     65