Home | History | Annotate | Download | only in debugfs
      1 /*
      2  * debugfs.h --- header file for the debugfs program
      3  */
      4 
      5 #include "ext2fs/ext2_fs.h"
      6 #include "ext2fs/ext2fs.h"
      7 
      8 #ifdef __STDC__
      9 #define NOARGS void
     10 #else
     11 #define NOARGS
     12 #define const
     13 #endif
     14 
     15 /*
     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 
     22 extern ext2_filsys current_fs;
     23 extern ext2_ino_t	root, cwd;
     24 
     25 extern void reset_getopt(void);
     26 extern FILE *open_pager(void);
     27 extern void close_pager(FILE *stream);
     28 extern int check_fs_open(char *name);
     29 extern int check_fs_not_open(char *name);
     30 extern int check_fs_read_write(char *name);
     31 extern int check_fs_bitmaps(char *name);
     32 extern ext2_ino_t string_to_inode(char *str);
     33 extern char *time_to_string(__u32);
     34 extern time_t string_to_time(const char *);
     35 extern unsigned long parse_ulong(const char *str, const char *cmd,
     36 				 const char *descr, int *err);
     37 extern int strtoblk(const char *cmd, const char *str, blk_t *ret);
     38 extern int common_args_process(int argc, char *argv[], int min_argc,
     39 			       int max_argc, const char *cmd,
     40 			       const char *usage, int flags);
     41 extern int common_inode_args_process(int argc, char *argv[],
     42 				     ext2_ino_t *inode, int flags);
     43 extern int common_block_args_process(int argc, char *argv[],
     44 				     blk_t *block, blk_t *count);
     45 extern int debugfs_read_inode(ext2_ino_t ino, struct ext2_inode * inode,
     46 			      const char *cmd);
     47 extern int debugfs_read_inode_full(ext2_ino_t ino, struct ext2_inode * inode,
     48 				   const char *cmd, int bufsize);
     49 extern int debugfs_write_inode(ext2_ino_t ino, struct ext2_inode * inode,
     50 			       const char *cmd);
     51 extern int debugfs_write_new_inode(ext2_ino_t ino, struct ext2_inode * inode,
     52 				   const char *cmd);
     53 
     54 /* ss command functions */
     55 
     56 /* dump.c */
     57 extern void do_dump(int argc, char **argv);
     58 extern void do_cat(int argc, char **argv);
     59 extern void do_rdump(int argc, char **argv);
     60 
     61 /* htree.c */
     62 extern void do_htree_dump(int argc, char **argv);
     63 extern void do_dx_hash(int argc, char **argv);
     64 extern void do_dirsearch(int argc, char **argv);
     65 
     66 /* logdump.c */
     67 extern void do_logdump(int argc, char **argv);
     68 
     69 /* lsdel.c */
     70 extern void do_lsdel(int argc, char **argv);
     71 
     72 /* icheck.c */
     73 extern void do_icheck(int argc, char **argv);
     74 
     75 /* ncheck.c */
     76 extern void do_ncheck(int argc, char **argv);
     77 
     78 /* set_fields.c */
     79 extern void do_set_super(int argc, char **);
     80 extern void do_set_inode(int argc, char **);
     81 extern void do_set_block_group_descriptor(int argc, char **);
     82 
     83 /* unused.c */
     84 extern void do_dump_unused(int argc, char **argv);
     85 
     86 /* debugfs.c */
     87 extern void internal_dump_inode(FILE *, const char *, ext2_ino_t,
     88 				struct ext2_inode *, int);
     89 
     90 extern void do_dirty_filesys(int argc, char **argv);
     91 extern void do_open_filesys(int argc, char **argv);
     92 extern void do_close_filesys(int argc, char **argv);
     93 extern void do_lcd(int argc, char **argv);
     94 extern void do_init_filesys(int argc, char **argv);
     95 extern void do_show_super_stats(int argc, char **argv);
     96 extern void do_kill_file(int argc, char **argv);
     97 extern void do_rm(int argc, char **argv);
     98 extern void do_link(int argc, char **argv);
     99 extern void do_undel(int argc, char **argv);
    100 extern void do_unlink(int argc, char **argv);
    101 extern void do_find_free_block(int argc, char **argv);
    102 extern void do_find_free_inode(int argc, char **argv);
    103 extern void do_stat(int argc, char **argv);
    104 
    105 extern void do_chroot(int argc, char **argv);
    106 extern void do_clri(int argc, char **argv);
    107 extern void do_freei(int argc, char **argv);
    108 extern void do_seti(int argc, char **argv);
    109 extern void do_testi(int argc, char **argv);
    110 extern void do_freeb(int argc, char **argv);
    111 extern void do_setb(int argc, char **argv);
    112 extern void do_testb(int argc, char **argv);
    113 extern void do_modify_inode(int argc, char **argv);
    114 extern void do_list_dir(int argc, char **argv);
    115 extern void do_change_working_dir(int argc, char **argv);
    116 extern void do_print_working_directory(int argc, char **argv);
    117 extern void do_write(int argc, char **argv);
    118 extern void do_mknod(int argc, char **argv);
    119 extern void do_mkdir(int argc, char **argv);
    120 extern void do_rmdir(int argc, char **argv);
    121 extern void do_show_debugfs_params(int argc, char **argv);
    122 extern void do_expand_dir(int argc, char **argv);
    123 extern void do_features(int argc, char **argv);
    124 extern void do_bmap(int argc, char **argv);
    125 extern void do_imap(int argc, char **argv);
    126 extern void do_set_current_time(int argc, char **argv);
    127 extern void do_supported_features(int argc, char **argv);
    128 
    129