2010-05-18 05:31:56 +04:00
|
|
|
/*
|
|
|
|
* e2p.h --- header file for the e2p library
|
|
|
|
*
|
|
|
|
* %Begin-Header%
|
|
|
|
* This file may be redistributed under the terms of the GNU Library
|
|
|
|
* General Public License, version 2.
|
|
|
|
* %End-Header%
|
|
|
|
*/
|
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
#include <sys/types.h> /* Needed by dirent.h on netbsd */
|
1997-04-26 17:21:57 +04:00
|
|
|
#include <stdio.h>
|
1997-04-26 17:58:21 +04:00
|
|
|
#include <dirent.h>
|
1997-04-26 17:21:57 +04:00
|
|
|
|
2001-05-21 06:54:21 +04:00
|
|
|
#include <ext2fs/ext2_fs.h>
|
1997-04-26 17:21:57 +04:00
|
|
|
|
1999-09-15 00:17:38 +04:00
|
|
|
#define E2P_FEATURE_COMPAT 0
|
|
|
|
#define E2P_FEATURE_INCOMPAT 1
|
|
|
|
#define E2P_FEATURE_RO_INCOMPAT 2
|
2008-02-26 22:26:01 +03:00
|
|
|
#define E2P_FEATURE_TYPE_MASK 0x03
|
1999-09-15 00:17:38 +04:00
|
|
|
|
2008-02-26 22:26:01 +03:00
|
|
|
#define E2P_FEATURE_NEGATE_FLAG 0x80
|
2000-02-11 07:48:03 +03:00
|
|
|
|
2008-08-24 07:42:46 +04:00
|
|
|
#define E2P_FS_FEATURE 0
|
|
|
|
#define E2P_JOURNAL_FEATURE 1
|
|
|
|
|
2000-02-11 07:48:03 +03:00
|
|
|
/* `options' for print_flags() */
|
|
|
|
|
|
|
|
#define PFOPT_LONG 1 /* Must be 1 for compatibility with `int long_format'. */
|
|
|
|
|
|
|
|
|
1997-04-26 17:21:57 +04:00
|
|
|
int fgetflags (const char * name, unsigned long * flags);
|
|
|
|
int fgetversion (const char * name, unsigned long * version);
|
|
|
|
int fsetflags (const char * name, unsigned long flags);
|
|
|
|
int fsetversion (const char * name, unsigned long version);
|
|
|
|
int getflags (int fd, unsigned long * flags);
|
|
|
|
int getversion (int fd, unsigned long * version);
|
|
|
|
int iterate_on_dir (const char * dir_name,
|
|
|
|
int (*func) (const char *, struct dirent *, void *),
|
|
|
|
void * private);
|
2000-08-15 00:13:32 +04:00
|
|
|
void list_super(struct ext2_super_block * s);
|
|
|
|
void list_super2(struct ext2_super_block * s, FILE *f);
|
1997-04-26 17:21:57 +04:00
|
|
|
void print_fs_errors (FILE * f, unsigned short errors);
|
2000-02-11 07:48:03 +03:00
|
|
|
void print_flags (FILE * f, unsigned long flags, unsigned options);
|
1997-04-26 17:21:57 +04:00
|
|
|
void print_fs_state (FILE * f, unsigned short state);
|
|
|
|
int setflags (int fd, unsigned long flags);
|
|
|
|
int setversion (int fd, unsigned long version);
|
1997-04-29 18:53:37 +04:00
|
|
|
|
1999-10-26 18:29:22 +04:00
|
|
|
const char *e2p_feature2string(int compat, unsigned int mask);
|
2009-04-22 22:35:45 +04:00
|
|
|
const char *e2p_jrnl_feature2string(int compat, unsigned int mask);
|
1999-09-15 00:17:38 +04:00
|
|
|
int e2p_string2feature(char *string, int *compat, unsigned int *mask);
|
2009-04-22 22:35:45 +04:00
|
|
|
int e2p_jrnl_string2feature(char *string, int *compat_type, unsigned int *mask);
|
1999-10-26 18:29:22 +04:00
|
|
|
int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array);
|
2008-02-26 22:26:01 +03:00
|
|
|
int e2p_edit_feature2(const char *str, __u32 *compat_array, __u32 *ok_array,
|
2008-08-28 07:07:54 +04:00
|
|
|
__u32 *clear_ok_array, int *type_err,
|
2008-02-26 22:26:01 +03:00
|
|
|
unsigned int *mask_err);
|
1999-09-15 00:17:38 +04:00
|
|
|
|
1997-04-29 18:53:37 +04:00
|
|
|
int e2p_is_null_uuid(void *uu);
|
|
|
|
void e2p_uuid_to_str(void *uu, char *out);
|
2002-08-24 08:04:03 +04:00
|
|
|
const char *e2p_uuid2str(void *uu);
|
|
|
|
|
|
|
|
const char *e2p_hash2string(int num);
|
|
|
|
int e2p_string2hash(char *string);
|
2002-10-16 01:43:43 +04:00
|
|
|
|
2002-10-20 09:52:52 +04:00
|
|
|
const char *e2p_mntopt2string(unsigned int mask);
|
2002-10-16 01:43:43 +04:00
|
|
|
int e2p_string2mntopt(char *string, unsigned int *mask);
|
|
|
|
int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok);
|
2005-01-05 11:01:06 +03:00
|
|
|
|
|
|
|
unsigned long parse_num_blocks(const char *arg, int log_block_size);
|
2009-07-22 03:34:42 +04:00
|
|
|
unsigned long long parse_num_blocks2(const char *arg, int log_block_size);
|
2005-03-19 09:13:22 +03:00
|
|
|
|
|
|
|
char *e2p_os2string(int os_type);
|
|
|
|
int e2p_string2os(char *str);
|
2006-08-30 11:08:13 +04:00
|
|
|
|
|
|
|
unsigned int e2p_percent(int percent, unsigned int base);
|