mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-04 04:04:17 +01:00
75d2c668d0
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.
15 lines
321 B
C
15 lines
321 B
C
#pragma once
|
|
|
|
#include "common/option.h"
|
|
|
|
typedef struct FFLoadavgOptions
|
|
{
|
|
FFModuleArgs moduleArgs;
|
|
|
|
FFPercentageModuleConfig percent;
|
|
uint8_t ndigits;
|
|
bool compact;
|
|
} FFLoadavgOptions;
|
|
|
|
static_assert(sizeof(FFLoadavgOptions) <= FF_OPTION_MAX_SIZE, "FFLoadavgOptions size exceeds maximum allowed size");
|