summaryrefslogtreecommitdiff
path: root/tools-util.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-12-29 21:14:51 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2017-12-29 21:15:47 -0500
commitdbad1685bc2d3bad50c5e161b78d2b8fb9f4d8aa (patch)
treeeb3127084883e6816c5b8e9218c26647634c3af8 /tools-util.h
parent88242ec7a3acb99a99fe184bbe3c51ab9a620916 (diff)
show-super can now print more stuff
Diffstat (limited to 'tools-util.h')
-rw-r--r--tools-util.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools-util.h b/tools-util.h
index dcca376b..dca9be29 100644
--- a/tools-util.h
+++ b/tools-util.h
@@ -47,6 +47,8 @@ struct stat xfstat(int);
_ret; \
})
+int printf_pad(unsigned pad, const char * fmt, ...);
+
enum units {
BYTES,
SECTORS,
@@ -151,4 +153,18 @@ char *dev_to_name(dev_t);
char *dev_to_path(dev_t);
char *dev_to_mount(char *);
+#define args_shift(_nr) \
+do { \
+ argc -= (_nr); \
+ argv += (_nr); \
+} while (0)
+
+#define arg_pop() \
+({ \
+ char *_ret = argc ? argv[0] : NULL; \
+ if (_ret) \
+ args_shift(1); \
+ _ret; \
+})
+
#endif /* _TOOLS_UTIL_H */