Mike Frysinger | 85cffcc | 2005-06-11 00:08:50 +0000 | [diff] [blame] | 1 | #include "busybox.h" |
Mike Frysinger | d89e629 | 2005-04-24 05:07:59 +0000 | [diff] [blame] | 2 | #include <sys/types.h> /* Needed by dirent.h on netbsd */ |
| 3 | #include <stdio.h> |
| 4 | #include <dirent.h> |
| 5 | |
"Vladimir N. Oleynik" | 083d3f4 | 2005-10-10 11:35:17 +0000 | [diff] [blame^] | 6 | #include "../ext2fs/ext2_fs.h" |
Mike Frysinger | d89e629 | 2005-04-24 05:07:59 +0000 | [diff] [blame] | 7 | |
| 8 | #define E2P_FEATURE_COMPAT 0 |
| 9 | #define E2P_FEATURE_INCOMPAT 1 |
| 10 | #define E2P_FEATURE_RO_INCOMPAT 2 |
"Vladimir N. Oleynik" | 083d3f4 | 2005-10-10 11:35:17 +0000 | [diff] [blame^] | 11 | #ifndef EXT3_FEATURE_INCOMPAT_EXTENTS |
| 12 | #define EXT3_FEATURE_INCOMPAT_EXTENTS 0x0040 |
| 13 | #endif |
Mike Frysinger | d89e629 | 2005-04-24 05:07:59 +0000 | [diff] [blame] | 14 | |
| 15 | /* `options' for print_flags() */ |
| 16 | |
| 17 | #define PFOPT_LONG 1 /* Must be 1 for compatibility with `int long_format'. */ |
| 18 | |
Mike Frysinger | 548ffd4 | 2005-05-07 07:14:41 +0000 | [diff] [blame] | 19 | /*int fgetversion (const char * name, unsigned long * version);*/ |
| 20 | /*int fsetversion (const char * name, unsigned long version);*/ |
| 21 | int fgetsetversion(const char * name, unsigned long * get_version, unsigned long set_version); |
| 22 | #define fgetversion(name, version) fgetsetversion(name, version, 0) |
| 23 | #define fsetversion(name, version) fgetsetversion(name, NULL, version) |
Mike Frysinger | d89e629 | 2005-04-24 05:07:59 +0000 | [diff] [blame] | 24 | |
Mike Frysinger | 548ffd4 | 2005-05-07 07:14:41 +0000 | [diff] [blame] | 25 | /*int fgetflags (const char * name, unsigned long * flags);*/ |
| 26 | /*int fsetflags (const char * name, unsigned long flags);*/ |
| 27 | int fgetsetflags(const char * name, unsigned long * get_flags, unsigned long set_flags); |
| 28 | #define fgetflags(name, flags) fgetsetflags(name, flags, 0) |
| 29 | #define fsetflags(name, flags) fgetsetflags(name, NULL, flags) |
| 30 | |
Mike Frysinger | d89e629 | 2005-04-24 05:07:59 +0000 | [diff] [blame] | 31 | int getflags (int fd, unsigned long * flags); |
| 32 | int getversion (int fd, unsigned long * version); |
| 33 | int iterate_on_dir (const char * dir_name, |
| 34 | int (*func) (const char *, struct dirent *, void *), |
| 35 | void * private); |
Mike Frysinger | 85cffcc | 2005-06-11 00:08:50 +0000 | [diff] [blame] | 36 | /*void list_super(struct ext2_super_block * s);*/ |
Mike Frysinger | d89e629 | 2005-04-24 05:07:59 +0000 | [diff] [blame] | 37 | void list_super2(struct ext2_super_block * s, FILE *f); |
Mike Frysinger | 85cffcc | 2005-06-11 00:08:50 +0000 | [diff] [blame] | 38 | #define list_super(s) list_super2(s, stdout) |
Mike Frysinger | d89e629 | 2005-04-24 05:07:59 +0000 | [diff] [blame] | 39 | void print_fs_errors (FILE * f, unsigned short errors); |
| 40 | void print_flags (FILE * f, unsigned long flags, unsigned options); |
| 41 | void print_fs_state (FILE * f, unsigned short state); |
| 42 | int setflags (int fd, unsigned long flags); |
| 43 | int setversion (int fd, unsigned long version); |
| 44 | |
| 45 | const char *e2p_feature2string(int compat, unsigned int mask); |
| 46 | int e2p_string2feature(char *string, int *compat, unsigned int *mask); |
| 47 | int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array); |
| 48 | |
| 49 | int e2p_is_null_uuid(void *uu); |
| 50 | void e2p_uuid_to_str(void *uu, char *out); |
| 51 | const char *e2p_uuid2str(void *uu); |
| 52 | |
| 53 | const char *e2p_hash2string(int num); |
| 54 | int e2p_string2hash(char *string); |
| 55 | |
| 56 | const char *e2p_mntopt2string(unsigned int mask); |
| 57 | int e2p_string2mntopt(char *string, unsigned int *mask); |
| 58 | int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok); |
| 59 | |
| 60 | unsigned long parse_num_blocks(const char *arg, int log_block_size); |
| 61 | |
| 62 | char *e2p_os2string(int os_type); |
| 63 | int e2p_string2os(char *str); |