]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - lib/e2p/e2p.h
libe2p: print the filename character encoding in list_super[2]
[thirdparty/e2fsprogs.git] / lib / e2p / e2p.h
CommitLineData
543547a5
TT
1/*
2 * e2p.h --- header file for the e2p library
3 *
4 * %Begin-Header%
5 * This file may be redistributed under the terms of the GNU Library
6 * General Public License, version 2.
7 * %End-Header%
8 */
9
50e1e10f 10#include <sys/types.h> /* Needed by dirent.h on netbsd */
3839e657 11#include <stdio.h>
50e1e10f 12#include <dirent.h>
3839e657 13
7c2d2569 14#include <ext2fs/ext2_fs.h>
3839e657 15
d7b701de
TT
16#define E2P_FEATURE_COMPAT 0
17#define E2P_FEATURE_INCOMPAT 1
18#define E2P_FEATURE_RO_INCOMPAT 2
7100351d 19#define E2P_FEATURE_TYPE_MASK 0x03
d7b701de 20
7100351d 21#define E2P_FEATURE_NEGATE_FLAG 0x80
dede39bb 22
03efde8a
AD
23#define E2P_FS_FEATURE 0
24#define E2P_JOURNAL_FEATURE 1
25
dede39bb
TT
26/* `options' for print_flags() */
27
28#define PFOPT_LONG 1 /* Must be 1 for compatibility with `int long_format'. */
29
30
3839e657
TT
31int fgetflags (const char * name, unsigned long * flags);
32int fgetversion (const char * name, unsigned long * version);
33int fsetflags (const char * name, unsigned long flags);
34int fsetversion (const char * name, unsigned long version);
3627e838
LX
35int fgetproject(const char *name, unsigned long *project);
36int fsetproject(const char *name, unsigned long project);
3839e657
TT
37int getflags (int fd, unsigned long * flags);
38int getversion (int fd, unsigned long * version);
39int iterate_on_dir (const char * dir_name,
40 int (*func) (const char *, struct dirent *, void *),
f3fa5689 41 void * private_arg);
53d39550
TT
42void list_super(struct ext2_super_block * s);
43void list_super2(struct ext2_super_block * s, FILE *f);
3839e657 44void print_fs_errors (FILE * f, unsigned short errors);
dede39bb 45void print_flags (FILE * f, unsigned long flags, unsigned options);
3839e657
TT
46void print_fs_state (FILE * f, unsigned short state);
47int setflags (int fd, unsigned long flags);
48int setversion (int fd, unsigned long version);
1e3472c5 49
03a179a1
TT
50void e2p_list_journal_super(FILE *f, char *journal_sb_buf,
51 int exp_block_size, int flags);
52
36caf25f 53const char *e2p_feature2string(int compat, unsigned int mask);
022c925c 54const char *e2p_jrnl_feature2string(int compat, unsigned int mask);
d7b701de 55int e2p_string2feature(char *string, int *compat, unsigned int *mask);
022c925c 56int e2p_jrnl_string2feature(char *string, int *compat_type, unsigned int *mask);
36caf25f 57int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array);
7100351d 58int e2p_edit_feature2(const char *str, __u32 *compat_array, __u32 *ok_array,
efc6f628 59 __u32 *clear_ok_array, int *type_err,
7100351d 60 unsigned int *mask_err);
d7b701de 61
1e3472c5
TT
62int e2p_is_null_uuid(void *uu);
63void e2p_uuid_to_str(void *uu, char *out);
f61fc0b5
TT
64const char *e2p_uuid2str(void *uu);
65
66const char *e2p_hash2string(int num);
67int e2p_string2hash(char *string);
a0c3fd5e 68
4a959fe6 69const char *e2p_mntopt2string(unsigned int mask);
a0c3fd5e
TT
70int e2p_string2mntopt(char *string, unsigned int *mask);
71int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok);
55f4cbd9
TT
72
73unsigned long parse_num_blocks(const char *arg, int log_block_size);
b4e0163d 74unsigned long long parse_num_blocks2(const char *arg, int log_block_size);
63253946
TT
75
76char *e2p_os2string(int os_type);
77int e2p_string2os(char *str);
a8862d9e
TT
78
79unsigned int e2p_percent(int percent, unsigned int base);
ac3256fd
TT
80
81const char *e2p_encmode2string(int num);
82int e2p_string2encmode(char *string);
d85c5a61
GKB
83
84int e2p_str2encoding(const char *string);
5a7761e8 85const char *e2p_encoding2str(int encoding);
d85c5a61
GKB
86int e2p_get_encoding_flags(int encoding);
87int e2p_str2encoding_flags(int encoding, char *param, __u16 *flags);