blob: 6c81b09c8a98901bab9245fc6c51f36b64a3bc8f [file] [log] [blame]
Theodore Ts'o3839e651997-04-26 13:21:57 +00001/*
2 * debugfs.h --- header file for the debugfs program
3 */
4
Theodore Ts'o54c637d2001-05-14 11:45:38 +00005#include "ext2fs/ext2_fs.h"
Theodore Ts'o3839e651997-04-26 13:21:57 +00006#include "ext2fs/ext2fs.h"
7
Theodore Ts'o50e1e101997-04-26 13:58:21 +00008#ifdef __STDC__
9#define NOARGS void
10#else
11#define NOARGS
12#define const
13#endif
14
Theodore Ts'oe1018ee2002-01-03 04:55:25 -050015/*
16 * Flags used by the common argument processing functions
17 */
18#define CHECK_FS_RW 0x0001
19#define CHECK_FS_BITMAPS 0x0002
20#define CHECK_FS_NOTOPEN 0x0004
21
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +000022extern ext2_filsys current_fs;
Theodore Ts'ob044c2e2001-01-11 15:26:39 +000023extern ext2_ino_t root, cwd;
Theodore Ts'o3839e651997-04-26 13:21:57 +000024
25extern FILE *open_pager(void);
26extern void close_pager(FILE *stream);
27extern int check_fs_open(char *name);
28extern int check_fs_not_open(char *name);
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +000029extern int check_fs_read_write(char *name);
Theodore Ts'od61f6172000-05-27 16:04:00 +000030extern int check_fs_bitmaps(char *name);
Theodore Ts'ob044c2e2001-01-11 15:26:39 +000031extern ext2_ino_t string_to_inode(char *str);
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +000032extern char *time_to_string(__u32);
Theodore Ts'oe1018ee2002-01-03 04:55:25 -050033extern unsigned long parse_ulong(const char *str, const char *cmd,
34 const char *descr, int *err);
35extern int strtoblk(const char *cmd, const char *str, blk_t *ret);
36extern int common_args_process(int argc, char *argv[], int min_argc,
37 int max_argc, const char *cmd,
38 const char *usage, int flags);
39extern int common_inode_args_process(int argc, char *argv[],
40 ext2_ino_t *inode, int flags);
41extern int common_block_args_process(int argc, char *argv[],
42 blk_t *block, int *count);
43extern int debugfs_read_inode(ext2_ino_t ino, struct ext2_inode * inode,
44 const char *cmd);
45extern int debugfs_write_inode(ext2_ino_t ino, struct ext2_inode * inode,
46 const char *cmd);
Theodore Ts'o3839e651997-04-26 13:21:57 +000047
Theodore Ts'o50e1e101997-04-26 13:58:21 +000048/* ss command functions */
49
50/* dump.c */
51extern void do_dump(int argc, char **argv);
52extern void do_cat(int argc, char **argv);
Theodore Ts'ob044c2e2001-01-11 15:26:39 +000053extern void do_rdump(int argc, char **argv);
Theodore Ts'o50e1e101997-04-26 13:58:21 +000054
Theodore Ts'o5e4f0702001-06-01 15:36:05 +000055/* logdump.c */
56extern void do_logdump(int argc, char **argv);
57
Theodore Ts'o50e1e101997-04-26 13:58:21 +000058/* lsdel.c */
59extern void do_lsdel(int argc, char **argv);
60
61/* icheck.c */
62extern void do_icheck(int argc, char **argv);
63
64/* ncheck.c */
65extern void do_ncheck(int argc, char **argv);
66
Theodore Ts'ob74d1d82001-01-12 17:23:52 +000067/* set_super.c */
68extern void do_set_super(int argc, char **);
69
Theodore Ts'o50e1e101997-04-26 13:58:21 +000070/* debugfs.c */
Theodore Ts'o5e4f0702001-06-01 15:36:05 +000071extern void internal_dump_inode(FILE *, const char *, ext2_ino_t,
Theodore Ts'oda81e3f2001-03-29 20:49:58 +000072 struct ext2_inode *, int);
73
Theodore Ts'o4a31c481998-03-30 01:27:25 +000074extern void do_dirty_filesys(int argc, char **argv);
Theodore Ts'o50e1e101997-04-26 13:58:21 +000075extern void do_open_filesys(int argc, char **argv);
76extern void do_close_filesys(int argc, char **argv);
Theodore Ts'ob044c2e2001-01-11 15:26:39 +000077extern void do_lcd(int argc, char **argv);
Theodore Ts'o50e1e101997-04-26 13:58:21 +000078extern void do_init_filesys(int argc, char **argv);
79extern void do_show_super_stats(int argc, char **argv);
80extern void do_kill_file(int argc, char **argv);
81extern void do_rm(int argc, char **argv);
82extern void do_link(int argc, char **argv);
Theodore Ts'o682720a2002-01-03 05:10:04 -050083extern void do_undel(int argc, char **argv);
Theodore Ts'o50e1e101997-04-26 13:58:21 +000084extern void do_unlink(int argc, char **argv);
85extern void do_find_free_block(int argc, char **argv);
86extern void do_find_free_inode(int argc, char **argv);
87extern void do_stat(int argc, char **argv);
88
89extern void do_chroot(int argc, char **argv);
90extern void do_clri(int argc, char **argv);
91extern void do_freei(int argc, char **argv);
92extern void do_seti(int argc, char **argv);
93extern void do_testi(int argc, char **argv);
94extern void do_freeb(int argc, char **argv);
95extern void do_setb(int argc, char **argv);
96extern void do_testb(int argc, char **argv);
97extern void do_modify_inode(int argc, char **argv);
98extern void do_list_dir(int argc, char **argv);
99extern void do_change_working_dir(int argc, char **argv);
100extern void do_print_working_directory(int argc, char **argv);
101extern void do_write(int argc, char **argv);
102extern void do_mknod(int argc, char **argv);
103extern void do_mkdir(int argc, char **argv);
104extern void do_rmdir(int argc, char **argv);
105extern void do_show_debugfs_params(int argc, char **argv);
106extern void do_expand_dir(int argc, char **argv);
Theodore Ts'of68aa411999-10-26 14:20:22 +0000107extern void do_features(int argc, char *argv[]);
Theodore Ts'oda81e3f2001-03-29 20:49:58 +0000108