summaryrefslogtreecommitdiff
path: root/src/utils/size_info.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/size_info.h')
-rw-r--r--src/utils/size_info.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/size_info.h b/src/utils/size_info.h
new file mode 100644
index 0000000..e0994c1
--- /dev/null
+++ b/src/utils/size_info.h
@@ -0,0 +1,14 @@
+#ifndef SIZE_INFO_H_
+#define SIZE_INFO_H_
+
+typedef enum size_unit { SIZE_B, SIZE_KB, SIZE_MB, SIZE_GB } size_unit_t;
+
+typedef struct size_info {
+ long double n;
+ size_unit_t unit;
+ const char *unit_str;
+} size_info_t;
+
+size_info_t num2sizeinfo(const unsigned long n);
+
+#endif