| Nathan Scott | f0ed0fd | 2021-06-23 17:44:56 +1000 | [diff] [blame] | 1 | #ifndef HEADER_DynamicMeter |
| 2 | #define HEADER_DynamicMeter |
| Benny Baumann | 8e4ce18 | 2023-05-24 11:14:25 +0200 | [diff] [blame] | 3 | /* |
| 4 | htop - DynamicMeter.h |
| 5 | (C) 2021 htop dev team |
| 6 | (C) 2021 Red Hat, Inc. All Rights Reserved. |
| 7 | Released under the GNU GPLv2+, see the COPYING file |
| 8 | in the source distribution for its full text. |
| 9 | */ |
| Nathan Scott | f0ed0fd | 2021-06-23 17:44:56 +1000 | [diff] [blame] | 10 | |
| Sohaib Mohamed | 6f2021f | 2021-07-11 03:11:29 +0200 | [diff] [blame] | 11 | #include <stdbool.h> |
| 12 | |
| Sohaib Mohamed | 90b209e | 2021-07-18 06:25:45 +0200 | [diff] [blame] | 13 | #include "Hashtable.h" |
| Nathan Scott | f0ed0fd | 2021-06-23 17:44:56 +1000 | [diff] [blame] | 14 | #include "Meter.h" |
| 15 | |
| 16 | |
| 17 | typedef struct DynamicMeter_ { |
| 18 | char name[32]; /* unique name, cannot contain spaces */ |
| 19 | char* caption; |
| 20 | char* description; |
| 21 | unsigned int type; |
| 22 | double maximum; |
| Nathan Scott | f0ed0fd | 2021-06-23 17:44:56 +1000 | [diff] [blame] | 23 | } DynamicMeter; |
| 24 | |
| 25 | Hashtable* DynamicMeters_new(void); |
| 26 | |
| Nathan Scott | c0c2bb9 | 2021-09-03 12:11:31 +1000 | [diff] [blame] | 27 | void DynamicMeters_delete(Hashtable* dynamics); |
| 28 | |
| Christian Göttsche | c3746dc | 2021-08-22 17:14:29 +0200 | [diff] [blame] | 29 | const char* DynamicMeter_lookup(Hashtable* dynamics, unsigned int key); |
| Nathan Scott | f0ed0fd | 2021-06-23 17:44:56 +1000 | [diff] [blame] | 30 | |
| Nathan Scott | bf853ad | 2021-07-12 16:51:19 +1000 | [diff] [blame] | 31 | bool DynamicMeter_search(Hashtable* dynamics, const char* name, unsigned int* key); |
| Nathan Scott | f0ed0fd | 2021-06-23 17:44:56 +1000 | [diff] [blame] | 32 | |
| 33 | extern const MeterClass DynamicMeter_class; |
| 34 | |
| 35 | #endif |