Files
fastfetch/src/detection/netio/netio.h
T
李通洲 75d2c668d0 Modules: refactor module option handling for static allocation
Moves module option structs out of global config and removes dynamic allocation, using static buffers and size assertions for safer, simpler management.

Refactors module initialization and destruction to work with isolated option structs, eliminating the need for the previous modules container and related code.

Unifies module option header usage and updates detection logic to leverage statically-sized option buffers, improving encapsulation and maintainability.

Simplifies module function signatures and reduces coupling between modules and config.

Enhances future extensibility and reliability by enforcing max size constraints and removing unnecessary indirections.
2025-08-04 14:46:01 +08:00

22 lines
488 B
C

#pragma once
#include "fastfetch.h"
#include "modules/netio/option.h"
typedef struct FFNetIOResult
{
FFstrbuf name;
bool defaultRoute;
uint64_t txBytes;
uint64_t rxBytes;
uint64_t txPackets;
uint64_t rxPackets;
uint64_t rxErrors;
uint64_t txErrors;
uint64_t rxDrops;
uint64_t txDrops;
} FFNetIOResult;
const char* ffDetectNetIO(FFlist* result, FFNetIOOptions* options);
const char* ffNetIOGetIoCounters(FFlist* result, FFNetIOOptions* options);