This commit is contained in:
2026-05-11 11:13:54 +02:00
parent c93ae21114
commit c1fd1f706e
11 changed files with 41 additions and 39 deletions

View File

@@ -2,6 +2,7 @@
#define GPU_H
#include <stdint.h>
#include <stdbool.h>
struct gpu_sensors_t {
uint64_t vram_used;

View File

@@ -20,7 +20,7 @@ typedef enum {
LOG_ERR,
LOG_DBG,
LOG_START,
} LogLevel;
} log_level_t;
/* __PRETTY_FUNCTION__ is a GCC/Clang extension that gives the full
s ignature: "voi*d foo(int x)" — same thing source_location gave you.
@@ -30,7 +30,7 @@ log_write(level, __PRETTY_FUNCTION__, fmt, ##__VA_ARGS__)
/* format attribute gives compile-time printf format checking —
better than wha*t std::format gave you at runtime */
void log_write(LogLevel level, const char *func, const char *fmt, ...)
void log_write(log_level_t level, const char *func, const char *fmt, ...)
__attribute__((format(printf, 3, 4)));
#else /* APPLOG_ENABLED not defined */

View File

@@ -2,11 +2,12 @@
#define UTILS_H
#include <time.h>
#include <stdbool.h>
uint64_t timespec_diff_us(const struct timespec *a, const struct timespec *b);
void timespec_add_ms(struct timespec *ts, uint16_t ms);
char *pretty_bytes(uint64_t bytes, int8_t start_suffix, char *buf, size_t bufsz);
char *pretty_num(const double num, char *buf, const size_t bufsz);
char *pretty_num(double num, char *buf, size_t bufsz);
void fast_read_num_u64(const char* dir, const char* file, char* buf, uint64_t* result, uint32_t divider);
void fast_read_num_u16(const char* dir, const char* file, char* buf, uint16_t* result, uint32_t divider);