master ohmu/fastfetch-openbsd / src / modules / top / option.h
ohmu  ·  2026-10-15
 1#pragma once
 2
 3#include "common/option.h"
 4#include "common/percent.h"
 5
 6typedef enum FFTopTypes: uint8_t {
 7    FF_TOP_TYPE_CPU = 1 << 0,
 8    FF_TOP_TYPE_MEMORY = 1 << 1,
 9    FF_TOP_TYPE_DISK_READ = 1 << 2,
10    FF_TOP_TYPE_DISK_WRITE = 1 << 3,
11    FF_TOP_TYPE_START_TIME = 1 << 4,
12    FF_TOP_TYPE_THREADS = 1 << 5,
13
14    FF_TOP_TYPE_DISK = FF_TOP_TYPE_DISK_READ | FF_TOP_TYPE_DISK_WRITE,
15} FFTopTypes;
16
17typedef struct FFTopOptions {
18    FFModuleArgs moduleArgs;
19    FFTopTypes sort;
20    FFTopTypes showTypes; // bitfields
21    uint32_t nProcesses;
22    uint32_t waitTime;
23    FFPercentageModuleConfig percent;
24    bool compact;
25} FFTopOptions;
26
27static_assert(sizeof(FFTopOptions) <= FF_OPTION_MAX_SIZE, "FFTopOptions size exceeds maximum allowed size");