aboutsummaryrefslogtreecommitdiff
path: root/src/lib.c
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2023-04-10 20:14:18 -0400
committerShav Kinderlehrer <[email protected]>2023-04-10 20:14:18 -0400
commit0e59c5f27cc3badd3e48a87bba39bdac9077e1a5 (patch)
treeb90c2caa254233426b326f6a38011ea15435d840 /src/lib.c
parentaeafcc6891913327aa784da5879bdf9b8cf11cc4 (diff)
downloadlat-0e59c5f27cc3badd3e48a87bba39bdac9077e1a5.tar.gz
lat-0e59c5f27cc3badd3e48a87bba39bdac9077e1a5.zip
Breakup monolithic code
Diffstat (limited to 'src/lib.c')
-rw-r--r--src/lib.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/lib.c b/src/lib.c
deleted file mode 100644
index b7ee492..0000000
--- a/src/lib.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-
-void die(const char *message) {
- perror(message);
- exit(1);
-}
-
-char *formatBytes(double *bytes) {
- char *SIZES[] = {"bytes", "kB", "MB", "GB"};
-
- size_t size = *bytes;
- size_t div = 0;
- size_t rem = 0;
-
- while (size >= 1024 && div < (sizeof SIZES / sizeof *SIZES)) {
- rem = (size % 1024);
- div++;
- size /= 1024;
- }
-
- *bytes = (float)size + (float)rem / 1024.0;
-
- return SIZES[div];
-}
-
-int intlen(unsigned i) {
- int l = 1;
-
- while (i > 9) {
- l++;
- i /= 10;
- }
-
- return l;
-}