summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2009-10-12 00:53:47 +0200
committerMichael Stapelberg <michael@stapelberg.de>2009-10-12 00:53:47 +0200
commitc4c17294ad466328d303f478992f174cdfb44933 (patch)
tree8de75c13830340d870ea77216145584f6cebcf81
parent783707906c102c6b30f18a3837cec523974b882c (diff)
Cleanup disk "module"
-rw-r--r--src/print_disk_info.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/print_disk_info.c b/src/print_disk_info.c
index 84524c3..7ad27a4 100644
--- a/src/print_disk_info.c
+++ b/src/print_disk_info.c
@@ -14,8 +14,11 @@
#define MEGABYTE (1024ULL * 1024)
#define KILOBYTE (1024ULL)
-void print_bytes_human(uint64_t bytes) {
- /* 1 TB */
+/*
+ * Prints the given amount of bytes in a human readable manner.
+ *
+ */
+static void print_bytes_human(uint64_t bytes) {
if (bytes > TERABYTE)
printf("%f TB", (double)bytes / TERABYTE);
else if (bytes > GIGABYTE)
@@ -27,13 +30,11 @@ void print_bytes_human(uint64_t bytes) {
else {
printf("%.01f B", (double)bytes);
}
-
}
/*
- * Just parses /proc/net/wireless looking for lines beginning with
- * wlan_interface, extracting the quality of the link and adding the
- * current IP address of wlan_interface.
+ * Does a statvfs and prints either free, used or total amounts of bytes in a
+ * human readable manner.
*
*/
void print_disk_info(const char *path, const char *format) {