-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdevman.h
More file actions
29 lines (24 loc) · 809 Bytes
/
devman.h
File metadata and controls
29 lines (24 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef __DEVMAN_H
#define __DEVMAN_H
#include <stdbool.h>
#include <time.h>
struct utsname;
struct sysinfo;
struct devman_ctx {
struct utsname *uname;
struct sysinfo *sysinfo;
time_t last_update;
};
struct devman_ctx *devman_ctx_init(void);
void devman_ctx_free(struct devman_ctx *ctx);
int devman_ctx_update(struct devman_ctx *ctx);
char *get_kernel_version(const struct devman_ctx *ctx);
char *get_uptime_str(const struct devman_ctx *ctx);
char *get_cpuload_str(const struct devman_ctx *ctx);
char *get_rpi_serial(void);
int get_rpi_cpu_temp(void);
int get_netdevices(char ***devices, bool (*filter)(const char *));
int get_df(char ***filesystems, bool (*filter)(const char *));
double total_mem_usage(const struct devman_ctx *ctx, bool swap);
double total_cpu_usage(void);
#endif /* __DEVMAN_H */