diff options
| author | verdant <im@verdant.ee> | 2026-07-27 20:50:31 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-07-27 20:50:31 +0800 |
| commit | 3d686db94ad653df9af65d6fdae7d25b6bce2441 (patch) | |
| tree | 8ccfec270198838d241b6a18eb71b981d7171dc0 /stat.h | |
| parent | c3249db241002c1d0af7e37cf4210ad43c0faa9f (diff) | |
| download | sf-3d686db94ad653df9af65d6fdae7d25b6bce2441.tar.gz sf-3d686db94ad653df9af65d6fdae7d25b6bce2441.zip | |
Delete stat module
Diffstat (limited to 'stat.h')
| -rw-r--r-- | stat.h | 57 |
1 files changed, 0 insertions, 57 deletions
@@ -1,57 +0,0 @@ -#ifndef SF_STAT_H -#define SF_STAT_H - -#include <ncurses.h> - -#define PROC_PATH_VERSION "/proc/version" -#define PROC_PATH_MEMINFO "/proc/meminfo" -#define PROC_PATH_STAT "/proc/stat" - -#define STAT_INFO_WIDTH 15 -#define BAR_LABEL_WIDTH 7 -#define STAT_BAR_HEIGHT 1 - -typedef struct { - char name[16]; - unsigned int user; /* User mode */ - unsigned int nice; /* Low-priority user mode */ - unsigned int system; /* Kernel mode */ - unsigned int idle; /* Free time of CPU */ - unsigned long long iowait; - unsigned long long irq; - unsigned long long softirq; - - unsigned long long prev_total; - unsigned long long prev_idle; - double cpu; - double smooth_cpu; -} cpu_occupy; - -typedef struct { - char sysver[30]; - struct { - unsigned long mem_total; - unsigned long mem_available; - } meminfo; - struct { - unsigned long long disk_total; - unsigned long long disk_available; - } diskinfo; - cpu_occupy *cpu_occ; -} stat; - -void stat_get_sysver(stat *s); -stat *stat_init(); -void stat_print_info(WINDOW *w, int y, int maxx, const char *label, - unsigned long total, unsigned long ava); -void stat_print_cpu_info(WINDOW *w, int y, int maxx, stat *s); -void stat_draw_bar(WINDOW *w, const char *label, int maxx, int y, int x, - unsigned long total, unsigned long ava); -void stat_draw_cpu_bar(WINDOW *w, int maxx, int y, int x, stat *s); -void stat_get_meminfo(stat *s); -void stat_get_diskinfo(stat *s); -void stat_get_cpuinfo(stat *s); -int stat_get_bar_ticks(int maxx, unsigned long long total, - unsigned long long ava); - -#endif /* SF_STAT_H */ |
