From 10eea2ab1bae2a8ec159d81c0446fd8061b33e2b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 21:58:07 +0200 Subject: Adding upstream version 3.3.0. Signed-off-by: Daniel Baumann --- pcp/PCPDynamicMeter.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 pcp/PCPDynamicMeter.h (limited to 'pcp/PCPDynamicMeter.h') diff --git a/pcp/PCPDynamicMeter.h b/pcp/PCPDynamicMeter.h new file mode 100644 index 0000000..3a72d13 --- /dev/null +++ b/pcp/PCPDynamicMeter.h @@ -0,0 +1,50 @@ +#ifndef HEADER_PCPDynamicMeter +#define HEADER_PCPDynamicMeter +/* +htop - PCPDynamicMeter.h +(C) 2023 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ + +#include + +#include "CRT.h" +#include "DynamicMeter.h" +#include "Hashtable.h" +#include "Meter.h" +#include "RichString.h" + + +typedef struct PCPDynamicMetric_ { + size_t id; /* index into metric array */ + ColorElements color; + char* name; /* derived metric name */ + char* label; + char* suffix; +} PCPDynamicMetric; + +typedef struct PCPDynamicMeter_ { + DynamicMeter super; + PCPDynamicMetric* metrics; + size_t totalMetrics; +} PCPDynamicMeter; + +typedef struct PCPDynamicMeters_ { + Hashtable* table; + size_t count; /* count of dynamic meters discovered by scan */ + size_t offset; /* start offset into the Platform metric array */ + size_t cursor; /* identifier allocator for each new metric used */ +} PCPDynamicMeters; + +void PCPDynamicMeters_init(PCPDynamicMeters* meters); + +void PCPDynamicMeters_done(Hashtable* table); + +void PCPDynamicMeter_enable(PCPDynamicMeter* this); + +void PCPDynamicMeter_updateValues(PCPDynamicMeter* this, Meter* meter); + +void PCPDynamicMeter_display(PCPDynamicMeter* this, const Meter* meter, RichString* out); + +#endif -- cgit v1.2.3