* Boston, MA 021110-1307, USA.
*/
+#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;
int (*fn)(int, char **);
/* 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}
const struct cmd_struct commands[];
};
-/* btrfs.c */
-int prefixcmp(const char *str, const char *prefix);
-
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) __attribute__((noreturn));
-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) __attribute__((noreturn));
-void help_ambiguous_token(const char *arg, const struct cmd_group *grp) __attribute__((noreturn));
-
-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;
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 */
-char *get_subvol_name(char *mnt, char *full_path);
+#endif