From eb6f986361713d6ce47c6d4572bb24d9f6207ddf Mon Sep 17 00:00:00 2001 From: Anser Date: Tue, 11 Aug 2026 00:18:57 +0200 Subject: TOBESQUISHED: safe in reconstruction of the codes layout and rework of information handeling also ascii art printing --- src/modules/memory/memory.c | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/modules/memory/memory.c (limited to 'src/modules/memory/memory.c') diff --git a/src/modules/memory/memory.c b/src/modules/memory/memory.c deleted file mode 100644 index 62eeafe..0000000 --- a/src/modules/memory/memory.c +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include "memory.h" - -char *memory(void) { - FILE *file = fopen("/proc/meminfo", "r"); - - if (!file) { - perror("Error fopen meminfo"); - return NULL; - } - - char line[256]; - long total = 0; - long available = 0; - - // read per line - while (fgets(line, sizeof(line), file)) { - if (sscanf(line, "MemTotal: %ld kB", &total) == 1) continue; - if (sscanf(line, "MemAvailable: %ld kB", &available) == 1) continue; - } - - fclose(file); - - printf("Memory: %.2f GB / %.2f GB\n", (total - available) / (1024.0 * 1024.0), total / (1024.0 * 1024.0)); - - return 0; -} -- cgit v1.2.3