Files
fastfetch/src/detection/terminalshell/terminalshell.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

35 lines
830 B
C

#pragma once
#include "fastfetch.h"
#include "modules/terminal/option.h"
#include "modules/shell/option.h"
typedef struct FFShellResult
{
FFstrbuf processName;
FFstrbuf exe; //Actually arg0 in *nix
const char* exeName; //pointer to a char in exe
FFstrbuf exePath; //Full real path to executable file
FFstrbuf prettyName;
FFstrbuf version;
uint32_t pid;
uint32_t ppid;
int32_t tty;
} FFShellResult;
typedef struct FFTerminalResult
{
FFstrbuf processName;
FFstrbuf exe;
FFstrbuf prettyName;
const char* exeName; //pointer to a char in exe
FFstrbuf exePath; //Full real path to executable file
FFstrbuf version;
FFstrbuf tty;
uint32_t pid;
uint32_t ppid;
} FFTerminalResult;
const FFShellResult* ffDetectShell();
const FFTerminalResult* ffDetectTerminal();