Cleanup disk "module"
This commit is contained in:
parent
783707906c
commit
c4c17294ad
@ -14,8 +14,11 @@
|
|||||||
#define MEGABYTE (1024ULL * 1024)
|
#define MEGABYTE (1024ULL * 1024)
|
||||||
#define KILOBYTE (1024ULL)
|
#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)
|
if (bytes > TERABYTE)
|
||||||
printf("%f TB", (double)bytes / TERABYTE);
|
printf("%f TB", (double)bytes / TERABYTE);
|
||||||
else if (bytes > GIGABYTE)
|
else if (bytes > GIGABYTE)
|
||||||
@ -27,13 +30,11 @@ void print_bytes_human(uint64_t bytes) {
|
|||||||
else {
|
else {
|
||||||
printf("%.01f B", (double)bytes);
|
printf("%.01f B", (double)bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Just parses /proc/net/wireless looking for lines beginning with
|
* Does a statvfs and prints either free, used or total amounts of bytes in a
|
||||||
* wlan_interface, extracting the quality of the link and adding the
|
* human readable manner.
|
||||||
* current IP address of wlan_interface.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void print_disk_info(const char *path, const char *format) {
|
void print_disk_info(const char *path, const char *format) {
|
||||||
|
Loading…
Reference in New Issue
Block a user