path: root/utils.h
diff options
authorGui Hecheng <>2014-06-30 11:54:11 +0800
committerDavid Sterba <>2014-08-22 14:55:27 +0200
commita184abc70f7b1468e6036ab576f1587ee0574668 (patch)
treeb2195990a6e95695f163ab06952b386421e644c4 /utils.h
parent266c81a910540d85cc47463b2a0cb16b0dd4e1e1 (diff)
btrfs-progs: move the check_argc_* functions into utils.c
To let the independent tools(e.g. btrfs-image, btrfs-convert, etc.) share the convenience of check_argc_* functions, just move it into utils.c. Also add a new function "set_argv0" to set the correct tool name: *btrfs-image*: too few arguments The original btrfs* tools work as before. Signed-off-by: Gui Hecheng <> [moved argv0 and check_argc to utils.*] Signed-off-by: David Sterba <>
Diffstat (limited to 'utils.h')
1 files changed, 9 insertions, 0 deletions
diff --git a/utils.h b/utils.h
index 6599ee4d..e29ab936 100644
--- a/utils.h
+++ b/utils.h
@@ -39,6 +39,15 @@
+#define ARGV0_BUF_SIZE 64
+int check_argc_exact(int nargs, int expected);
+int check_argc_min(int nargs, int expected);
+int check_argc_max(int nargs, int expected);
+void fixup_argv0(char **argv, const char *token);
+void set_argv0(char **argv);
int make_btrfs(int fd, const char *device, const char *label,
char *fs_uuid, u64 blocks[6], u64 num_bytes, u32 nodesize,
u32 leafsize, u32 sectorsize, u32 stripesize, u64 features);