diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:58:07 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:58:07 +0000 |
commit | 10eea2ab1bae2a8ec159d81c0446fd8061b33e2b (patch) | |
tree | e8270dd60ec096bee8157dbadf029e15ed584592 /pcp/PCPDynamicColumn.h | |
parent | Initial commit. (diff) | |
download | htop-10eea2ab1bae2a8ec159d81c0446fd8061b33e2b.tar.xz htop-10eea2ab1bae2a8ec159d81c0446fd8061b33e2b.zip |
Adding upstream version 3.3.0.upstream/3.3.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pcp/PCPDynamicColumn.h')
-rw-r--r-- | pcp/PCPDynamicColumn.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/pcp/PCPDynamicColumn.h b/pcp/PCPDynamicColumn.h new file mode 100644 index 0000000..ade782b --- /dev/null +++ b/pcp/PCPDynamicColumn.h @@ -0,0 +1,54 @@ +#ifndef HEADER_PCPDynamicColumn +#define HEADER_PCPDynamicColumn +/* +htop - PCPDynamicColumn.h +(C) 2023 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ + +#include <stddef.h> + +#include "DynamicColumn.h" +#include "Hashtable.h" +#include "Process.h" +#include "RichString.h" + +#include "pcp/PCPProcess.h" + + +struct pmDesc; + +typedef struct PCPDynamicColumn_ { + DynamicColumn super; + char* metricName; + char* format; + size_t id; /* identifier for metric array lookups */ + int width; /* optional width from configuration file */ + bool defaultEnabled; /* default enabled in dynamic screen */ + bool percent; + bool instances; /* an instance *names* column, not values */ +} PCPDynamicColumn; + +typedef struct PCPDynamicColumns_ { + Hashtable* table; + size_t count; /* count of dynamic columns discovered by scan */ + size_t offset; /* start offset into the Platform metric array */ + size_t cursor; /* identifier allocator for each new metric used */ +} PCPDynamicColumns; + +void PCPDynamicColumns_init(PCPDynamicColumns* columns); + +void PCPDynamicColumns_done(Hashtable* table); + +void PCPDynamicColumns_setupWidths(PCPDynamicColumns* columns); + +void PCPDynamicColumn_writeField(PCPDynamicColumn* this, const Process* proc, RichString* str); + +void PCPDynamicColumn_writeAtomValue(PCPDynamicColumn* column, RichString* str, const struct Settings_* settings, int metric, int instance, const struct pmDesc* desc, const void* atomvalue); + +int PCPDynamicColumn_compareByKey(const PCPProcess* p1, const PCPProcess* p2, ProcessField key); + +void PCPDynamicColumn_done(PCPDynamicColumn* this); + +#endif |