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