mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-16 05:54:34 +03:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
eebd5e8517
|
|||
7044d546ea
|
|||
765e3de1e7
|
|||
637550ed51
|
|||
fc016ae780
|
|||
36260b5814
|
|||
611ea4606f |
34
CRT.h
34
CRT.h
@ -15,8 +15,8 @@ in the source distribution for its full text.
|
||||
#include "ProvideCurses.h"
|
||||
#include "Settings.h"
|
||||
|
||||
|
||||
typedef enum TreeStr_ {
|
||||
typedef enum TreeStr_
|
||||
{
|
||||
TREE_STR_VERT,
|
||||
TREE_STR_RTEE,
|
||||
TREE_STR_BEND,
|
||||
@ -28,7 +28,8 @@ typedef enum TreeStr_ {
|
||||
LAST_TREE_STR
|
||||
} TreeStr;
|
||||
|
||||
typedef enum ColorScheme_ {
|
||||
typedef enum ColorScheme_
|
||||
{
|
||||
COLORSCHEME_DEFAULT,
|
||||
COLORSCHEME_MONOCHROME,
|
||||
COLORSCHEME_BLACKONWHITE,
|
||||
@ -39,7 +40,8 @@ typedef enum ColorScheme_ {
|
||||
LAST_COLORSCHEME
|
||||
} ColorScheme;
|
||||
|
||||
typedef enum ColorElements_ {
|
||||
typedef enum ColorElements_
|
||||
{
|
||||
RESET_COLOR,
|
||||
DEFAULT_COLOR,
|
||||
FUNCTION_BAR,
|
||||
@ -64,6 +66,8 @@ typedef enum ColorElements_ {
|
||||
METER_VALUE_WARN,
|
||||
LED_COLOR,
|
||||
UPTIME,
|
||||
TEMP,
|
||||
FREQ,
|
||||
BATTERY,
|
||||
TASKS_RUNNING,
|
||||
SWAP,
|
||||
@ -148,24 +152,24 @@ typedef enum ColorElements_ {
|
||||
LAST_COLORELEMENT
|
||||
} ColorElements;
|
||||
|
||||
void CRT_fatalError(const char* note) ATTR_NORETURN;
|
||||
void CRT_fatalError(const char *note) ATTR_NORETURN;
|
||||
|
||||
#ifdef NDEBUG
|
||||
# define CRT_debug(...)
|
||||
#define CRT_debug(...)
|
||||
#else
|
||||
void CRT_debug_impl(const char* file, size_t lineno, const char* func, const char* fmt, ...) ATTR_FORMAT(printf, 4, 5);
|
||||
# define CRT_debug(...) CRT_debug_impl(__FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||
void CRT_debug_impl(const char *file, size_t lineno, const char *func, const char *fmt, ...) ATTR_FORMAT(printf, 4, 5);
|
||||
#define CRT_debug(...) CRT_debug_impl(__FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
void CRT_handleSIGSEGV(int signal) ATTR_NORETURN;
|
||||
|
||||
#define KEY_WHEELUP KEY_F(30)
|
||||
#define KEY_WHEELUP KEY_F(30)
|
||||
#define KEY_WHEELDOWN KEY_F(31)
|
||||
#define KEY_RECLICK KEY_F(32)
|
||||
#define KEY_RECLICK KEY_F(32)
|
||||
#define KEY_SHIFT_TAB KEY_F(33)
|
||||
#define KEY_ALT(x) (KEY_F(64 - 26) + ((x) - 'A'))
|
||||
#define KEY_ALT(x) (KEY_F(64 - 26) + ((x) - 'A'))
|
||||
|
||||
extern const char* CRT_degreeSign;
|
||||
extern const char *CRT_degreeSign;
|
||||
|
||||
#ifdef HAVE_LIBNCURSESW
|
||||
|
||||
@ -173,9 +177,9 @@ extern bool CRT_utf8;
|
||||
|
||||
#endif
|
||||
|
||||
extern const char* const* CRT_treeStr;
|
||||
extern const char *const *CRT_treeStr;
|
||||
|
||||
extern const int* CRT_colors;
|
||||
extern const int *CRT_colors;
|
||||
|
||||
extern int CRT_cursorX;
|
||||
|
||||
@ -187,7 +191,7 @@ extern ColorScheme CRT_colorScheme;
|
||||
|
||||
void CRT_setMouse(bool enabled);
|
||||
|
||||
void CRT_init(const Settings* settings, bool allowUnicode);
|
||||
void CRT_init(const Settings *settings, bool allowUnicode);
|
||||
|
||||
void CRT_done(void);
|
||||
|
||||
|
29
FreqMeter.c
Normal file
29
FreqMeter.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include "FreqMeter.h"
|
||||
|
||||
#include "CRT.h"
|
||||
#include "Object.h"
|
||||
#include "Platform.h"
|
||||
#include "XUtils.h"
|
||||
|
||||
static const int FreqMeter_attributes[] = {
|
||||
FREQ};
|
||||
|
||||
static void FreqMeter_updateValues(Meter *this)
|
||||
{
|
||||
float freq = Platform_getFreq();
|
||||
|
||||
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%.1lf GHz", freq);
|
||||
}
|
||||
|
||||
const MeterClass FreqMeter_class = {
|
||||
.super = {
|
||||
.extends = Class(Meter),
|
||||
.delete = Meter_delete},
|
||||
.updateValues = FreqMeter_updateValues,
|
||||
.defaultMode = TEXT_METERMODE,
|
||||
.maxItems = 1,
|
||||
.total = 100.0,
|
||||
.attributes = FreqMeter_attributes,
|
||||
.name = "Freq",
|
||||
.uiName = "CPU Frequency",
|
||||
.caption = "CPU/Frequency: "};
|
8
FreqMeter.h
Normal file
8
FreqMeter.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef HEADER_FreqMeter
|
||||
#define HEADER_FreqMeter
|
||||
|
||||
#include "Meter.h"
|
||||
|
||||
extern const MeterClass FreqMeter_class;
|
||||
|
||||
#endif
|
@ -82,6 +82,8 @@ myhtopsources = \
|
||||
TasksMeter.c \
|
||||
TraceScreen.c \
|
||||
UptimeMeter.c \
|
||||
FreqMeter.c \
|
||||
TempMeter.c \
|
||||
UsersTable.c \
|
||||
Vector.c \
|
||||
XUtils.c
|
||||
@ -144,6 +146,8 @@ myhtopheaders = \
|
||||
TasksMeter.h \
|
||||
TraceScreen.h \
|
||||
UptimeMeter.h \
|
||||
FreqMeter.h \
|
||||
TempMeter.h \
|
||||
UsersTable.h \
|
||||
Vector.h \
|
||||
XUtils.h
|
||||
|
135
README
135
README
@ -8,7 +8,22 @@
|
||||
[](https://repology.org/project/htop/versions)
|
||||
[](COPYING?raw=true)
|
||||
|
||||

|
||||

|
||||
|
||||
## **Warning!**
|
||||
|
||||
This fork was created for personal use; correct operation is not guaranteed.
|
||||
|
||||
<details>
|
||||
<summary>Tested on</summary>
|
||||
|
||||
- Manjaro ARM Minimal (Raspberry Pi 4)
|
||||
- Debian 11 (Raspberry Pi 4)
|
||||
- Ubuntu Server 22.04 (Raspberry Pi 4)
|
||||
- Raspbian 64bit (Raspberry Pi 3B+)
|
||||
- Arch Linux (x86 PC), used for the screenshot above
|
||||
|
||||
</details>
|
||||
|
||||
## Introduction
|
||||
|
||||
@ -30,55 +45,66 @@ For more information and details visit [htop.dev](https://htop.dev).
|
||||
## Build instructions
|
||||
|
||||
### Prerequisite
|
||||
|
||||
List of build-time dependencies:
|
||||
* standard GNU autotools-based C toolchain
|
||||
- C99 compliant compiler
|
||||
- `autoconf`
|
||||
- `autotools`
|
||||
* `ncurses`
|
||||
|
||||
- standard GNU autotools-based C toolchain
|
||||
- C99 compliant compiler
|
||||
- `autoconf`
|
||||
- `autotools`
|
||||
- `ncurses`
|
||||
|
||||
**Note about `ncurses`:**
|
||||
> `htop` requires `ncurses` 6.0. Be aware the appropriate package is sometimes still called libncurses5 (on Debian/Ubuntu). Also `ncurses` usually comes in two flavours:
|
||||
>* With Unicode support.
|
||||
>* Without Unicode support.
|
||||
>
|
||||
>- With Unicode support.
|
||||
>- Without Unicode support.
|
||||
>
|
||||
> This is also something that is reflected in the package name on Debian/Ubuntu (via the additional 'w' - 'w'ide character support).
|
||||
|
||||
List of additional build-time dependencies (based on feature flags):
|
||||
* `sensors`
|
||||
* `hwloc`
|
||||
* `libcap` (v2.21 or later)
|
||||
* `libnl-3`
|
||||
|
||||
- `sensors`
|
||||
- `hwloc`
|
||||
- `libcap` (v2.21 or later)
|
||||
- `libnl-3`
|
||||
|
||||
Install these and other required packages for C development from your package manager.
|
||||
|
||||
**Debian/Ubuntu**
|
||||
|
||||
~~~ shell
|
||||
sudo apt install libncursesw5-dev autotools-dev autoconf build-essential
|
||||
~~~
|
||||
|
||||
**Fedora/RHEL**
|
||||
|
||||
~~~ shell
|
||||
sudo dnf install ncurses-devel automake autoconf gcc
|
||||
~~~
|
||||
|
||||
**Archlinux/Manjaro**
|
||||
|
||||
~~~ shell
|
||||
sudo pacman -S ncurses automake autoconf gcc
|
||||
~~~
|
||||
|
||||
**macOS**
|
||||
|
||||
~~~ shell
|
||||
brew install ncurses automake autoconf gcc
|
||||
~~~
|
||||
|
||||
### Compile from source:
|
||||
### Compile from source
|
||||
|
||||
To compile from source, download from the Git repository (`git clone` or downloads from [GitHub releases](https://github.com/htop-dev/htop/releases/)), then run:
|
||||
|
||||
~~~ shell
|
||||
./autogen.sh && ./configure && make
|
||||
~~~
|
||||
|
||||
### Install
|
||||
|
||||
To install on the local system run `make install`. By default `make install` installs into `/usr/local`. To change this path use `./configure --prefix=/some/path`.
|
||||
|
||||
### Build Options
|
||||
@ -87,80 +113,85 @@ To install on the local system run `make install`. By default `make install` ins
|
||||
|
||||
#### Generic
|
||||
|
||||
* `--enable-unicode`:
|
||||
- `--enable-unicode`:
|
||||
enable Unicode support
|
||||
- dependency: *libncursesw*
|
||||
- default: *yes*
|
||||
* `--enable-affinity`:
|
||||
- dependency: *libncursesw*
|
||||
- default: *yes*
|
||||
- `--enable-affinity`:
|
||||
enable `sched_setaffinity(2)` and `sched_getaffinity(2)` for affinity support; conflicts with hwloc
|
||||
- default: *check*
|
||||
* `--enable-hwloc`:
|
||||
- default: *check*
|
||||
- `--enable-hwloc`:
|
||||
enable hwloc support for CPU affinity; disables affinity support
|
||||
- dependency: *libhwloc*
|
||||
- default: *no*
|
||||
* `--enable-static`:
|
||||
- dependency: *libhwloc*
|
||||
- default: *no*
|
||||
- `--enable-static`:
|
||||
build a static htop binary; hwloc and delay accounting are not supported
|
||||
- default: *no*
|
||||
* `--enable-debug`:
|
||||
- default: *no*
|
||||
- `--enable-debug`:
|
||||
Enable asserts and internal sanity checks; implies a performance penalty
|
||||
- default: *no*
|
||||
- default: *no*
|
||||
|
||||
#### Performance Co-Pilot
|
||||
|
||||
* `--enable-pcp`:
|
||||
- `--enable-pcp`:
|
||||
enable Performance Co-Pilot support via a new pcp-htop utility
|
||||
- dependency: *libpcp*
|
||||
- default: *no*
|
||||
- dependency: *libpcp*
|
||||
- default: *no*
|
||||
|
||||
#### Linux
|
||||
|
||||
* `--enable-sensors`:
|
||||
- `--enable-sensors`:
|
||||
enable libsensors(3) support for reading temperature data
|
||||
- dependencies: *libsensors-dev*(build-time), at runtime *libsensors* is loaded via `dlopen(3)` if available
|
||||
- default: *check*
|
||||
* `--enable-capabilities`:
|
||||
- dependencies: *libsensors-dev*(build-time), at runtime *libsensors* is loaded via `dlopen(3)` if available
|
||||
- default: *check*
|
||||
- `--enable-capabilities`:
|
||||
enable Linux capabilities support
|
||||
- dependency: *libcap*
|
||||
- default: *check*
|
||||
* `--with-proc`:
|
||||
- dependency: *libcap*
|
||||
- default: *check*
|
||||
- `--with-proc`:
|
||||
location of a Linux-compatible proc filesystem
|
||||
- default: */proc*
|
||||
* `--enable-openvz`:
|
||||
- default: */proc*
|
||||
- `--enable-openvz`:
|
||||
enable OpenVZ support
|
||||
- default: *no*
|
||||
* `--enable-vserver`:
|
||||
- default: *no*
|
||||
- `--enable-vserver`:
|
||||
enable VServer support
|
||||
- default: *no*
|
||||
* `--enable-ancient-vserver`:
|
||||
- default: *no*
|
||||
- `--enable-ancient-vserver`:
|
||||
enable ancient VServer support (implies `--enable-vserver`)
|
||||
- default: *no*
|
||||
* `--enable-delayacct`:
|
||||
- default: *no*
|
||||
- `--enable-delayacct`:
|
||||
enable Linux delay accounting support
|
||||
- dependencies: *pkg-config*(build-time), *libnl-3* and *libnl-genl-3*
|
||||
- default: *check*
|
||||
- dependencies: *pkg-config*(build-time), *libnl-3* and *libnl-genl-3*
|
||||
- default: *check*
|
||||
|
||||
## Runtime dependencies
|
||||
|
||||
## Runtime dependencies:
|
||||
`htop` has a set of fixed minimum runtime dependencies, which is kept as minimal as possible:
|
||||
* `ncurses` libraries for terminal handling (wide character support).
|
||||
|
||||
### Runtime optional dependencies:
|
||||
- `ncurses` libraries for terminal handling (wide character support).
|
||||
|
||||
### Runtime optional dependencies
|
||||
|
||||
`htop` has a set of fixed optional dependencies, depending on build/configure option used:
|
||||
|
||||
#### Linux
|
||||
* `libdl`, if not building a static binary, is always required when support for optional dependencies (i.e. `libsensors`, `libsystemd`) is present.
|
||||
* `libcap`, user-space interfaces to POSIX 1003.1e capabilities, is always required when `--enable-capabilities` was used to configure `htop`.
|
||||
* `libsensors`, readout of temperatures and CPU speeds, is optional even when `--enable-sensors` was used to configure `htop`.
|
||||
* `libsystemd` is optional when `--enable-static` was not used to configure `htop`. If building statically and `libsystemd` is not found by `configure`, support for the systemd meter is disabled entirely.
|
||||
|
||||
- `libdl`, if not building a static binary, is always required when support for optional dependencies (i.e. `libsensors`, `libsystemd`) is present.
|
||||
- `libcap`, user-space interfaces to POSIX 1003.1e capabilities, is always required when `--enable-capabilities` was used to configure `htop`.
|
||||
- `libsensors`, readout of temperatures and CPU speeds, is optional even when `--enable-sensors` was used to configure `htop`.
|
||||
- `libsystemd` is optional when `--enable-static` was not used to configure `htop`. If building statically and `libsystemd` is not found by `configure`, support for the systemd meter is disabled entirely.
|
||||
|
||||
`htop` checks for the availability of the actual runtime libraries as `htop` runs.
|
||||
|
||||
#### BSD
|
||||
|
||||
On most BSD systems `kvm` is a requirement to read kernel information.
|
||||
|
||||
More information on required and optional dependencies can be found in [configure.ac](configure.ac).
|
||||
|
||||
## Usage
|
||||
|
||||
See the manual page (`man htop`) or the help menu (**F1** or **h** inside `htop`) for a list of supported key commands.
|
||||
|
||||
## Support
|
||||
|
642
Settings.c
642
Settings.c
File diff suppressed because it is too large
Load Diff
29
TempMeter.c
Normal file
29
TempMeter.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include "TempMeter.h"
|
||||
|
||||
#include "CRT.h"
|
||||
#include "Object.h"
|
||||
#include "Platform.h"
|
||||
#include "XUtils.h"
|
||||
|
||||
static const int TempMeter_attributes[] = {
|
||||
TEMP};
|
||||
|
||||
static void TempMeter_updateValues(Meter *this)
|
||||
{
|
||||
float temp_c = Platform_getTemp();
|
||||
|
||||
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%.1lf °C", temp_c);
|
||||
}
|
||||
|
||||
const MeterClass TempMeter_class = {
|
||||
.super = {
|
||||
.extends = Class(Meter),
|
||||
.delete = Meter_delete},
|
||||
.updateValues = TempMeter_updateValues,
|
||||
.defaultMode = TEXT_METERMODE,
|
||||
.maxItems = 1,
|
||||
.total = 100.0,
|
||||
.attributes = TempMeter_attributes,
|
||||
.name = "Temp",
|
||||
.uiName = "CPU Temperature",
|
||||
.caption = "CPU/Temperature: "};
|
8
TempMeter.h
Normal file
8
TempMeter.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef HEADER_TempMeter
|
||||
#define HEADER_TempMeter
|
||||
|
||||
#include "Meter.h"
|
||||
|
||||
extern const MeterClass TempMeter_class;
|
||||
|
||||
#endif
|
47
XUtils.h
47
XUtils.h
@ -17,60 +17,61 @@ in the source distribution for its full text.
|
||||
#include "Compat.h"
|
||||
#include "Macros.h"
|
||||
|
||||
|
||||
void fail(void) ATTR_NORETURN;
|
||||
|
||||
void* xMalloc(size_t size) ATTR_ALLOC_SIZE1(1) ATTR_MALLOC;
|
||||
void *xMalloc(size_t size) ATTR_ALLOC_SIZE1(1) ATTR_MALLOC;
|
||||
|
||||
void* xMallocArray(size_t nmemb, size_t size) ATTR_ALLOC_SIZE2(1, 2) ATTR_MALLOC;
|
||||
void *xMallocArray(size_t nmemb, size_t size) ATTR_ALLOC_SIZE2(1, 2) ATTR_MALLOC;
|
||||
|
||||
void* xCalloc(size_t nmemb, size_t size) ATTR_ALLOC_SIZE2(1, 2) ATTR_MALLOC;
|
||||
void *xCalloc(size_t nmemb, size_t size) ATTR_ALLOC_SIZE2(1, 2) ATTR_MALLOC;
|
||||
|
||||
void* xRealloc(void* ptr, size_t size) ATTR_ALLOC_SIZE1(2);
|
||||
void *xRealloc(void *ptr, size_t size) ATTR_ALLOC_SIZE1(2);
|
||||
|
||||
void* xReallocArray(void* ptr, size_t nmemb, size_t size) ATTR_ALLOC_SIZE2(2, 3);
|
||||
void *xReallocArray(void *ptr, size_t nmemb, size_t size) ATTR_ALLOC_SIZE2(2, 3);
|
||||
|
||||
void* xReallocArrayZero(void* ptr, size_t prevmemb, size_t newmemb, size_t size) ATTR_ALLOC_SIZE2(3, 4);
|
||||
void *xReallocArrayZero(void *ptr, size_t prevmemb, size_t newmemb, size_t size) ATTR_ALLOC_SIZE2(3, 4);
|
||||
|
||||
/*
|
||||
* String_startsWith gives better performance if strlen(match) can be computed
|
||||
* at compile time (e.g. when they are immutable string literals). :)
|
||||
*/
|
||||
static inline bool String_startsWith(const char* s, const char* match) {
|
||||
static inline bool String_startsWith(const char *s, const char *match)
|
||||
{
|
||||
return strncmp(s, match, strlen(match)) == 0;
|
||||
}
|
||||
|
||||
bool String_contains_i(const char* s1, const char* s2, bool multi);
|
||||
bool String_contains_i(const char *s1, const char *s2, bool multi);
|
||||
|
||||
static inline bool String_eq(const char* s1, const char* s2) {
|
||||
static inline bool String_eq(const char *s1, const char *s2)
|
||||
{
|
||||
return strcmp(s1, s2) == 0;
|
||||
}
|
||||
|
||||
char* String_cat(const char* s1, const char* s2) ATTR_MALLOC;
|
||||
char *String_cat(const char *s1, const char *s2) ATTR_MALLOC;
|
||||
|
||||
char* String_trim(const char* in) ATTR_MALLOC;
|
||||
char *String_trim(const char *in) ATTR_MALLOC;
|
||||
|
||||
char** String_split(const char* s, char sep, size_t* n);
|
||||
char **String_split(const char *s, char sep, size_t *n);
|
||||
|
||||
void String_freeArray(char** s);
|
||||
void String_freeArray(char **s);
|
||||
|
||||
char* String_readLine(FILE* fd) ATTR_MALLOC;
|
||||
char *String_readLine(FILE *fd) ATTR_MALLOC;
|
||||
|
||||
/* Always null-terminates dest. Caller must pass a strictly positive size. */
|
||||
size_t String_safeStrncpy(char* restrict dest, const char* restrict src, size_t size);
|
||||
size_t String_safeStrncpy(char *restrict dest, const char *restrict src, size_t size);
|
||||
|
||||
ATTR_FORMAT(printf, 2, 3)
|
||||
int xAsprintf(char** strp, const char* fmt, ...);
|
||||
int xAsprintf(char **strp, const char *fmt, ...);
|
||||
|
||||
ATTR_FORMAT(printf, 3, 4)
|
||||
int xSnprintf(char* buf, size_t len, const char* fmt, ...);
|
||||
int xSnprintf(char *buf, size_t len, const char *fmt, ...);
|
||||
|
||||
char* xStrdup(const char* str) ATTR_NONNULL ATTR_MALLOC;
|
||||
void free_and_xStrdup(char** ptr, const char* str);
|
||||
char *xStrdup(const char *str) ATTR_NONNULL ATTR_MALLOC;
|
||||
void free_and_xStrdup(char **ptr, const char *str);
|
||||
|
||||
char* xStrndup(const char* str, size_t len) ATTR_NONNULL ATTR_MALLOC;
|
||||
char *xStrndup(const char *str, size_t len) ATTR_NONNULL ATTR_MALLOC;
|
||||
|
||||
ssize_t xReadfile(const char* pathname, void* buffer, size_t count);
|
||||
ssize_t xReadfileat(openat_arg_t dirfd, const char* pathname, void* buffer, size_t count);
|
||||
ssize_t xReadfile(const char *pathname, void *buffer, size_t count);
|
||||
ssize_t xReadfileat(openat_arg_t dirfd, const char *pathname, void *buffer, size_t count);
|
||||
|
||||
#endif
|
||||
|
742
linux/Platform.c
742
linux/Platform.c
File diff suppressed because it is too large
Load Diff
@ -34,10 +34,9 @@ in the source distribution for its full text.
|
||||
|
||||
/* GNU/Hurd does not have PATH_MAX in limits.h */
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 4096
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
|
||||
extern const ScreenDefaults Platform_defaultScreens[];
|
||||
|
||||
extern const unsigned int Platform_numberOfDefaultScreens;
|
||||
@ -46,90 +45,98 @@ extern const SignalItem Platform_signals[];
|
||||
|
||||
extern const unsigned int Platform_numberOfSignals;
|
||||
|
||||
extern const MeterClass* const Platform_meterTypes[];
|
||||
extern const MeterClass *const Platform_meterTypes[];
|
||||
|
||||
bool Platform_init(void);
|
||||
void Platform_done(void);
|
||||
|
||||
extern bool Running_containerized;
|
||||
|
||||
void Platform_setBindings(Htop_Action* keys);
|
||||
void Platform_setBindings(Htop_Action *keys);
|
||||
|
||||
int Platform_getUptime(void);
|
||||
|
||||
void Platform_getLoadAverage(double* one, double* five, double* fifteen);
|
||||
float Platform_getTemp(void);
|
||||
|
||||
float Platform_getFreq(void);
|
||||
|
||||
void Platform_getLoadAverage(double *one, double *five, double *fifteen);
|
||||
|
||||
int Platform_getMaxPid(void);
|
||||
|
||||
double Platform_setCPUValues(Meter* this, unsigned int cpu);
|
||||
double Platform_setCPUValues(Meter *this, unsigned int cpu);
|
||||
|
||||
void Platform_setMemoryValues(Meter* this);
|
||||
void Platform_setMemoryValues(Meter *this);
|
||||
|
||||
void Platform_setSwapValues(Meter* this);
|
||||
void Platform_setSwapValues(Meter *this);
|
||||
|
||||
void Platform_setZramValues(Meter* this);
|
||||
void Platform_setZramValues(Meter *this);
|
||||
|
||||
void Platform_setZfsArcValues(Meter* this);
|
||||
void Platform_setZfsArcValues(Meter *this);
|
||||
|
||||
void Platform_setZfsCompressedArcValues(Meter* this);
|
||||
void Platform_setZfsCompressedArcValues(Meter *this);
|
||||
|
||||
char* Platform_getProcessEnv(pid_t pid);
|
||||
char *Platform_getProcessEnv(pid_t pid);
|
||||
|
||||
char* Platform_getInodeFilename(pid_t pid, ino_t inode);
|
||||
char *Platform_getInodeFilename(pid_t pid, ino_t inode);
|
||||
|
||||
FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid);
|
||||
FileLocks_ProcessData *Platform_getProcessLocks(pid_t pid);
|
||||
|
||||
void Platform_getPressureStall(const char* file, bool some, double* ten, double* sixty, double* threehundred);
|
||||
void Platform_getPressureStall(const char *file, bool some, double *ten, double *sixty, double *threehundred);
|
||||
|
||||
bool Platform_getDiskIO(DiskIOData* data);
|
||||
bool Platform_getDiskIO(DiskIOData *data);
|
||||
|
||||
bool Platform_getNetworkIO(NetworkIOData* data);
|
||||
bool Platform_getNetworkIO(NetworkIOData *data);
|
||||
|
||||
void Platform_getBattery(double* percent, ACPresence* isOnAC);
|
||||
void Platform_getBattery(double *percent, ACPresence *isOnAC);
|
||||
|
||||
static inline void Platform_getHostname(char* buffer, size_t size) {
|
||||
static inline void Platform_getHostname(char *buffer, size_t size)
|
||||
{
|
||||
Generic_hostname(buffer, size);
|
||||
}
|
||||
|
||||
static inline void Platform_getRelease(char** string) {
|
||||
static inline void Platform_getRelease(char **string)
|
||||
{
|
||||
*string = Generic_uname();
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBCAP
|
||||
#define PLATFORM_LONG_OPTIONS \
|
||||
{"drop-capabilities", optional_argument, 0, 160},
|
||||
#define PLATFORM_LONG_OPTIONS \
|
||||
{"drop-capabilities", optional_argument, 0, 160},
|
||||
#else
|
||||
#define PLATFORM_LONG_OPTIONS
|
||||
#define PLATFORM_LONG_OPTIONS
|
||||
#endif
|
||||
|
||||
void Platform_longOptionsUsage(const char* name);
|
||||
void Platform_longOptionsUsage(const char *name);
|
||||
|
||||
CommandLineStatus Platform_getLongOption(int opt, int argc, char** argv);
|
||||
CommandLineStatus Platform_getLongOption(int opt, int argc, char **argv);
|
||||
|
||||
static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) {
|
||||
static inline void Platform_gettime_realtime(struct timeval *tv, uint64_t *msec)
|
||||
{
|
||||
Generic_gettime_realtime(tv, msec);
|
||||
}
|
||||
|
||||
static inline void Platform_gettime_monotonic(uint64_t* msec) {
|
||||
static inline void Platform_gettime_monotonic(uint64_t *msec)
|
||||
{
|
||||
Generic_gettime_monotonic(msec);
|
||||
}
|
||||
|
||||
static inline Hashtable* Platform_dynamicMeters(void) { return NULL; }
|
||||
static inline Hashtable *Platform_dynamicMeters(void) { return NULL; }
|
||||
|
||||
static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { }
|
||||
static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable *table) {}
|
||||
|
||||
static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { }
|
||||
static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter *meter) {}
|
||||
|
||||
static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { }
|
||||
static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter *meter) {}
|
||||
|
||||
static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { }
|
||||
static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter *meter, ATTR_UNUSED RichString *out) {}
|
||||
|
||||
static inline Hashtable* Platform_dynamicColumns(void) { return NULL; }
|
||||
static inline Hashtable *Platform_dynamicColumns(void) { return NULL; }
|
||||
|
||||
static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { }
|
||||
static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable *table) {}
|
||||
|
||||
static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { return NULL; }
|
||||
static inline const char *Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { return NULL; }
|
||||
|
||||
static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { return false; }
|
||||
static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process *proc, ATTR_UNUSED RichString *str, ATTR_UNUSED unsigned int key) { return false; }
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user