X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=commands.h;h=76991f2b28d591264bd4a1440a66bc9c9c42ce0b;hb=f37ae8d275c2f988c9fc967f8272648fb0118d3d;hp=3f12fab941a7ff586ce0e64300ce9f44518c7323;hpb=514aa5d8f10a60bd2642cb15c3708a21f79501e4;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/commands.h b/commands.h index 3f12fab..76991f2 100644 --- a/commands.h +++ b/commands.h @@ -14,7 +14,13 @@ * Boston, MA 021110-1307, USA. */ -#define ARGV0_BUF_SIZE 64 +#ifndef __BTRFS_COMMANDS_H__ +#define __BTRFS_COMMANDS_H__ + +enum { + CMD_HIDDEN = (1 << 0), /* should not be in help listings */ + CMD_ALIAS = (1 << 1), /* alias of next command in cmd_group */ +}; struct cmd_struct { const char *token; @@ -46,10 +52,12 @@ struct cmd_struct { /* should be NULL if token is not a subgroup */ const struct cmd_group *next; - /* if true don't list this token in help listings */ - int hidden; + /* CMD_* flags above */ + int flags; }; +#define NULL_CMD_STRUCT {NULL, NULL, NULL, NULL, 0} + struct cmd_group { const char * const *usagestr; const char *infostr; @@ -57,52 +65,51 @@ struct cmd_group { const struct cmd_struct commands[]; }; -/* btrfs.c */ -int prefixcmp(const char *str, const char *prefix); - -int check_argc_exact(int nargs, int expected); -int check_argc_min(int nargs, int expected); -int check_argc_max(int nargs, int expected); - int handle_command_group(const struct cmd_group *grp, int argc, char **argv); -/* help.c */ extern const char * const generic_cmd_help_usage[]; -void usage(const char * const *usagestr); -void usage_command(const struct cmd_struct *cmd, int full, int err); -void usage_command_group(const struct cmd_group *grp, int all, int err); - -void help_unknown_token(const char *arg, const struct cmd_group *grp); -void help_ambiguous_token(const char *arg, const struct cmd_group *grp); - -void help_command_group(const struct cmd_group *grp, int argc, char **argv); - extern const struct cmd_group subvolume_cmd_group; extern const struct cmd_group filesystem_cmd_group; extern const struct cmd_group balance_cmd_group; extern const struct cmd_group device_cmd_group; extern const struct cmd_group scrub_cmd_group; extern const struct cmd_group inspect_cmd_group; +extern const struct cmd_group property_cmd_group; extern const struct cmd_group quota_cmd_group; extern const struct cmd_group qgroup_cmd_group; extern const struct cmd_group replace_cmd_group; +extern const struct cmd_group rescue_cmd_group; extern const char * const cmd_send_usage[]; extern const char * const cmd_receive_usage[]; extern const char * const cmd_check_usage[]; extern const char * const cmd_chunk_recover_usage[]; +extern const char * const cmd_super_recover_usage[]; extern const char * const cmd_restore_usage[]; +extern const char * const cmd_rescue_usage[]; +extern const char * const cmd_inspect_dump_super_usage[]; +extern const char * const cmd_inspect_dump_tree_usage[]; +extern const char * const cmd_inspect_tree_stats_usage[]; +extern const char * const cmd_filesystem_du_usage[]; +extern const char * const cmd_filesystem_usage_usage[]; int cmd_subvolume(int argc, char **argv); int cmd_filesystem(int argc, char **argv); +int cmd_filesystem_du(int argc, char **argv); +int cmd_filesystem_usage(int argc, char **argv); int cmd_balance(int argc, char **argv); int cmd_device(int argc, char **argv); int cmd_scrub(int argc, char **argv); int cmd_check(int argc, char **argv); int cmd_chunk_recover(int argc, char **argv); +int cmd_super_recover(int argc, char **argv); int cmd_inspect(int argc, char **argv); +int cmd_inspect_dump_super(int argc, char **argv); +int cmd_inspect_dump_tree(int argc, char **argv); +int cmd_inspect_tree_stats(int argc, char **argv); +int cmd_property(int argc, char **argv); int cmd_send(int argc, char **argv); int cmd_receive(int argc, char **argv); int cmd_quota(int argc, char **argv); @@ -112,10 +119,6 @@ int cmd_restore(int argc, char **argv); int cmd_select_super(int argc, char **argv); int cmd_dump_super(int argc, char **argv); int cmd_debug_tree(int argc, char **argv); +int cmd_rescue(int argc, char **argv); -/* subvolume exported functions */ -int test_issubvolume(char *path); - -/* send.c */ -int find_mount_root(const char *path, char **mount_root); -char *get_subvol_name(char *mnt, char *full_path); +#endif