blob: 57bcec31f9e6b9071ebd7a5a2327fa0e6e740490 [file] [log] [blame]
Mike Frysinger85cffcc2005-06-11 00:08:50 +00001#include "busybox.h"
Mike Frysingerd89e6292005-04-24 05:07:59 +00002#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 Frysinger548ffd42005-05-07 07:14:41 +000017/*int fgetversion (const char * name, unsigned long * version);*/
18/*int fsetversion (const char * name, unsigned long version);*/
19int 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 Frysingerd89e6292005-04-24 05:07:59 +000022
Mike Frysinger548ffd42005-05-07 07:14:41 +000023/*int fgetflags (const char * name, unsigned long * flags);*/
24/*int fsetflags (const char * name, unsigned long flags);*/
25int 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 Frysingerd89e6292005-04-24 05:07:59 +000029int getflags (int fd, unsigned long * flags);
30int getversion (int fd, unsigned long * version);
31int iterate_on_dir (const char * dir_name,
32 int (*func) (const char *, struct dirent *, void *),
33 void * private);
Mike Frysinger85cffcc2005-06-11 00:08:50 +000034/*void list_super(struct ext2_super_block * s);*/
Mike Frysingerd89e6292005-04-24 05:07:59 +000035void list_super2(struct ext2_super_block * s, FILE *f);
Mike Frysinger85cffcc2005-06-11 00:08:50 +000036#define list_super(s) list_super2(s, stdout)
Mike Frysingerd89e6292005-04-24 05:07:59 +000037void print_fs_errors (FILE * f, unsigned short errors);
38void print_flags (FILE * f, unsigned long flags, unsigned options);
39void print_fs_state (FILE * f, unsigned short state);
40int setflags (int fd, unsigned long flags);
41int setversion (int fd, unsigned long version);
42
43const char *e2p_feature2string(int compat, unsigned int mask);
44int e2p_string2feature(char *string, int *compat, unsigned int *mask);
45int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array);
46
47int e2p_is_null_uuid(void *uu);
48void e2p_uuid_to_str(void *uu, char *out);
49const char *e2p_uuid2str(void *uu);
50
51const char *e2p_hash2string(int num);
52int e2p_string2hash(char *string);
53
54const char *e2p_mntopt2string(unsigned int mask);
55int e2p_string2mntopt(char *string, unsigned int *mask);
56int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok);
57
58unsigned long parse_num_blocks(const char *arg, int log_block_size);
59
60char *e2p_os2string(int os_type);
61int e2p_string2os(char *str);