From 810bf9488fe74c90258b542ba2cb0d130e3785dd Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Wed, 10 Jan 2018 09:54:34 +0100 Subject: Implement manual choice of output unit Add an optional argument to option -s allowing user to manually specify units used for outputting results. Signed-off-by: Jan Kara --- common.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'common.h') diff --git a/common.h b/common.h index 935d6f1..4bf3e15 100644 --- a/common.h +++ b/common.h @@ -46,7 +46,21 @@ char *sstrdup(const char *s); /* Print version string */ void version(void); +/* Desired output unit */ +enum s2s_unit { + S2S_NONE = 0, + S2S_KB, + S2S_MB, + S2S_GB, + S2S_TB, + S2S_AUTO, + S2S_INVALID +}; + /* Compare two times */ int timespec_cmp(struct timespec *a, struct timespec *b); +/* Convert command line option to desired output unit */ +int unitopt2unit(char *opt, enum s2s_unit *space_unit, enum s2s_unit *inode_unit); + #endif /* GUARD_COMMON_H */ -- cgit v1.2.1