Showing preview only (1,734K chars total). Download the full file or copy to clipboard to get everything.
Repository: htop-dev/htop
Branch: main
Commit: 88e00aa53c1c
Files: 335
Total size: 1.6 MB
Directory structure:
gitextract_iydbaqnr/
├── .editorconfig
├── .github/
│ ├── FUNDING.yml
│ ├── dependabot.yml
│ └── workflows/
│ ├── build_release.yml
│ ├── ci.yml
│ ├── codeql-analysis.yml
│ ├── coverity.yml
│ └── htoprc
├── .gitignore
├── .travis.yml
├── AUTHORS
├── Action.c
├── Action.h
├── Affinity.c
├── Affinity.h
├── AffinityPanel.c
├── AffinityPanel.h
├── AvailableColumnsPanel.c
├── AvailableColumnsPanel.h
├── AvailableMetersPanel.c
├── AvailableMetersPanel.h
├── BatteryMeter.c
├── BatteryMeter.h
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── COPYING
├── CPUMeter.c
├── CPUMeter.h
├── CRT.c
├── CRT.h
├── CategoriesPanel.c
├── CategoriesPanel.h
├── ChangeLog
├── ClockMeter.c
├── ClockMeter.h
├── ColorsPanel.c
├── ColorsPanel.h
├── ColumnsPanel.c
├── ColumnsPanel.h
├── CommandLine.c
├── CommandLine.h
├── CommandScreen.c
├── CommandScreen.h
├── DateTimeMeter.c
├── DateTimeMeter.h
├── Debug.h
├── DiskIOMeter.c
├── DiskIOMeter.h
├── DisplayOptionsPanel.c
├── DisplayOptionsPanel.h
├── DynamicColumn.c
├── DynamicColumn.h
├── DynamicMeter.c
├── DynamicMeter.h
├── DynamicScreen.c
├── DynamicScreen.h
├── EnvScreen.c
├── EnvScreen.h
├── FileDescriptorMeter.c
├── FileDescriptorMeter.h
├── FunctionBar.c
├── FunctionBar.h
├── GPUMeter.c
├── GPUMeter.h
├── Hashtable.c
├── Hashtable.h
├── Header.c
├── Header.h
├── HeaderLayout.h
├── HeaderOptionsPanel.c
├── HeaderOptionsPanel.h
├── HostnameMeter.c
├── HostnameMeter.h
├── IncSet.c
├── IncSet.h
├── InfoScreen.c
├── InfoScreen.h
├── ListItem.c
├── ListItem.h
├── LoadAverageMeter.c
├── LoadAverageMeter.h
├── Machine.c
├── Machine.h
├── Macros.h
├── MainPanel.c
├── MainPanel.h
├── Makefile.am
├── MemoryMeter.c
├── MemoryMeter.h
├── MemorySwapMeter.c
├── MemorySwapMeter.h
├── Meter.c
├── Meter.h
├── MeterMode.h
├── MetersPanel.c
├── MetersPanel.h
├── NEWS
├── NetworkIOMeter.c
├── NetworkIOMeter.h
├── Object.c
├── Object.h
├── OpenFilesScreen.c
├── OpenFilesScreen.h
├── OptionItem.c
├── OptionItem.h
├── Panel.c
├── Panel.h
├── Process.c
├── Process.h
├── ProcessLocksScreen.c
├── ProcessLocksScreen.h
├── ProcessTable.c
├── ProcessTable.h
├── ProvideCurses.h
├── ProvideTerm.h
├── README.md
├── RichString.c
├── RichString.h
├── Row.c
├── Row.h
├── RowField.h
├── Scheduling.c
├── Scheduling.h
├── ScreenManager.c
├── ScreenManager.h
├── ScreenTabsPanel.c
├── ScreenTabsPanel.h
├── ScreensPanel.c
├── ScreensPanel.h
├── Settings.c
├── Settings.h
├── SignalsPanel.c
├── SignalsPanel.h
├── SwapMeter.c
├── SwapMeter.h
├── SysArchMeter.c
├── SysArchMeter.h
├── TESTPLAN
├── Table.c
├── Table.h
├── TasksMeter.c
├── TasksMeter.h
├── TraceScreen.c
├── TraceScreen.h
├── UptimeMeter.c
├── UptimeMeter.h
├── UsersTable.c
├── UsersTable.h
├── Vector.c
├── Vector.h
├── XUtils.c
├── XUtils.h
├── autogen.sh
├── check-pcp-style.sh
├── configure.ac
├── darwin/
│ ├── DarwinMachine.c
│ ├── DarwinMachine.h
│ ├── DarwinProcess.c
│ ├── DarwinProcess.h
│ ├── DarwinProcessTable.c
│ ├── DarwinProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ ├── PlatformHelpers.c
│ ├── PlatformHelpers.h
│ └── ProcessField.h
├── docs/
│ ├── ai-contributions-policy.md
│ └── styleguide.md
├── dragonflybsd/
│ ├── DragonFlyBSDMachine.c
│ ├── DragonFlyBSDMachine.h
│ ├── DragonFlyBSDProcess.c
│ ├── DragonFlyBSDProcess.h
│ ├── DragonFlyBSDProcessTable.c
│ ├── DragonFlyBSDProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ └── ProcessField.h
├── freebsd/
│ ├── FreeBSDMachine.c
│ ├── FreeBSDMachine.h
│ ├── FreeBSDProcess.c
│ ├── FreeBSDProcess.h
│ ├── FreeBSDProcessTable.c
│ ├── FreeBSDProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ └── ProcessField.h
├── generic/
│ ├── fdstat_sysctl.c
│ ├── fdstat_sysctl.h
│ ├── gettime.c
│ ├── gettime.h
│ ├── hostname.c
│ ├── hostname.h
│ ├── openzfs_sysctl.c
│ ├── openzfs_sysctl.h
│ ├── uname.c
│ └── uname.h
├── htop.1.in
├── htop.c
├── htop.desktop
├── iwyu/
│ ├── htop.imp
│ └── run_iwyu.sh
├── linux/
│ ├── CGroupUtils.c
│ ├── CGroupUtils.h
│ ├── Compat.c
│ ├── Compat.h
│ ├── GPU.c
│ ├── GPU.h
│ ├── HugePageMeter.c
│ ├── HugePageMeter.h
│ ├── IOPriority.h
│ ├── IOPriorityPanel.c
│ ├── IOPriorityPanel.h
│ ├── LibNl.c
│ ├── LibNl.h
│ ├── LibSensors.c
│ ├── LibSensors.h
│ ├── LinuxMachine.c
│ ├── LinuxMachine.h
│ ├── LinuxProcess.c
│ ├── LinuxProcess.h
│ ├── LinuxProcessTable.c
│ ├── LinuxProcessTable.h
│ ├── OpenRCMeter.c
│ ├── OpenRCMeter.h
│ ├── Platform.c
│ ├── Platform.h
│ ├── PressureStallMeter.c
│ ├── PressureStallMeter.h
│ ├── ProcessField.h
│ ├── SELinuxMeter.c
│ ├── SELinuxMeter.h
│ ├── SystemdMeter.c
│ ├── SystemdMeter.h
│ ├── ZramMeter.c
│ ├── ZramMeter.h
│ ├── ZramStats.h
│ └── ZswapStats.h
├── netbsd/
│ ├── NetBSDMachine.c
│ ├── NetBSDMachine.h
│ ├── NetBSDProcess.c
│ ├── NetBSDProcess.h
│ ├── NetBSDProcessTable.c
│ ├── NetBSDProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ ├── ProcessField.h
│ └── README.md
├── openbsd/
│ ├── OpenBSDMachine.c
│ ├── OpenBSDMachine.h
│ ├── OpenBSDProcess.c
│ ├── OpenBSDProcess.h
│ ├── OpenBSDProcessTable.c
│ ├── OpenBSDProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ └── ProcessField.h
├── pcp/
│ ├── InDomTable.c
│ ├── InDomTable.h
│ ├── Instance.c
│ ├── Instance.h
│ ├── Metric.c
│ ├── Metric.h
│ ├── PCPDynamicColumn.c
│ ├── PCPDynamicColumn.h
│ ├── PCPDynamicMeter.c
│ ├── PCPDynamicMeter.h
│ ├── PCPDynamicScreen.c
│ ├── PCPDynamicScreen.h
│ ├── PCPMachine.c
│ ├── PCPMachine.h
│ ├── PCPProcess.c
│ ├── PCPProcess.h
│ ├── PCPProcessTable.c
│ ├── PCPProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ ├── ProcessField.h
│ ├── columns/
│ │ ├── container
│ │ ├── delayacct
│ │ ├── fdcount
│ │ ├── gpu_memory
│ │ ├── guest
│ │ ├── memory
│ │ ├── sched
│ │ ├── swap
│ │ ├── tcp
│ │ ├── udp
│ │ └── wchan
│ ├── meters/
│ │ ├── entropy
│ │ ├── freespace
│ │ ├── gpu
│ │ ├── ipc
│ │ ├── locks
│ │ ├── memcache
│ │ ├── mysql
│ │ ├── postfix
│ │ ├── redis
│ │ └── tcp
│ └── screens/
│ ├── biosnoop
│ ├── cgroups
│ ├── cgroupsio
│ ├── cgroupsmem
│ ├── devices
│ ├── execsnoop
│ ├── exitsnoop
│ ├── filesystems
│ └── opensnoop
├── pcp-htop.5.in
├── pcp-htop.c
├── scripts/
│ ├── htop_suppressions.valgrind
│ └── run_valgrind.sh
├── solaris/
│ ├── Platform.c
│ ├── Platform.h
│ ├── ProcessField.h
│ ├── SolarisMachine.c
│ ├── SolarisMachine.h
│ ├── SolarisProcess.c
│ ├── SolarisProcess.h
│ ├── SolarisProcessTable.c
│ └── SolarisProcessTable.h
├── test_spec.lua
├── unsupported/
│ ├── Platform.c
│ ├── Platform.h
│ ├── ProcessField.h
│ ├── UnsupportedMachine.c
│ ├── UnsupportedMachine.h
│ ├── UnsupportedProcess.c
│ ├── UnsupportedProcess.h
│ ├── UnsupportedProcessTable.c
│ └── UnsupportedProcessTable.h
└── zfs/
├── ZfsArcMeter.c
├── ZfsArcMeter.h
├── ZfsArcStats.h
├── ZfsCompressedArcMeter.c
└── ZfsCompressedArcMeter.h
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
# EditorConfig configuration for htop
# http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file, utf-8 charset
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
# match C source and header files, set indent to three spaces
[*.{c,h}]
indent_style = space
indent_size = 3
trim_trailing_whitespace = true
================================================
FILE: .github/FUNDING.yml
================================================
custom: ["https://hcb.hackclub.com/donations/start/htop"]
================================================
FILE: .github/dependabot.yml
================================================
---
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
================================================
FILE: .github/workflows/build_release.yml
================================================
name: Build Source Release
# Trigger whenever a release is created
on:
release:
types:
- created
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: archive
id: archive
run: |
VERSION=${{ github.event.release.tag_name }}
PKGNAME="htop-$VERSION"
SHASUM=$PKGNAME.tar.xz.sha256
autoreconf -i
mkdir -p /tmp/$PKGNAME
mv * /tmp/$PKGNAME
mv /tmp/$PKGNAME .
TARBALL=$PKGNAME.tar.xz
tar cJf $TARBALL $PKGNAME
sha256sum $TARBALL > $SHASUM
echo "::set-output name=tarball::$TARBALL"
echo "::set-output name=shasum::$SHASUM"
- name: upload tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.tarball }}
asset_name: ${{ steps.archive.outputs.tarball }}
asset_content_type: application/gzip
- name: upload shasum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.shasum }}
asset_name: ${{ steps.archive.outputs.shasum }}
asset_content_type: text/plain
================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on: [ push, pull_request ]
env:
# Enable format attributes in ncurses headers
# Enable fortified memory/string handling
CPPFLAGS: -DGCC_PRINTF -DGCC_SCANF -D_FORTIFY_SOURCE=2
jobs:
build-ubuntu-latest-minimal-gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends libncursesw5-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --enable-affinity --disable-unicode --disable-sensors || (cat config.log; exit 1)
- name: Enable compatibility modes
run: |
sed -i 's/#define HAVE_FSTATAT 1/#undef HAVE_FSTATAT/g' config.h
sed -i 's/#define HAVE_OPENAT 1/#undef HAVE_OPENAT/g' config.h
sed -i 's/#define HAVE_READLINKAT 1/#undef HAVE_READLINKAT/g' config.h
- name: Build
run: make -k
- name: Distcheck
run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror --enable-affinity --disable-unicode --disable-sensors"
build-ubuntu-latest-minimal-clang:
runs-on: ubuntu-latest
env:
CC: clang-22
steps:
- uses: actions/checkout@v6
- name: install clang repo
run: |
ubuntu_codename=`LC_ALL=C sed 's/^ *UBUNTU_CODENAME *= *\([a-z]*\).*$/\1/p; d' /etc/os-release`
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${ubuntu_codename}/ llvm-toolchain-${ubuntu_codename}-22 main" -y
sudo apt-get update -q
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends clang-22 libncursesw5-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --enable-affinity --disable-unicode --disable-sensors || ( cat config.log; exit 1; )
- name: Build
run: make -k
- name: Distcheck
run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror --enable-affinity --disable-unicode --disable-sensors"
build-ubuntu-latest-full-featured-gcc:
runs-on: ubuntu-latest
# Enable LTO, might trigger additional warnings on advanced inlining
env:
CFLAGS: -O3 -g -flto
LDFLAGS: -O3 -g -flto -Wl,--as-needed
steps:
- uses: actions/checkout@v6
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors-dev libcap-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
- name: Build
run: make -k
- name: Distcheck
run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities'
build-ubuntu-latest-full-featured-clang:
runs-on: ubuntu-latest
env:
CC: clang-22
steps:
- uses: actions/checkout@v6
- name: install clang repo
run: |
ubuntu_codename=`LC_ALL=C sed 's/^ *UBUNTU_CODENAME *= *\([a-z]*\).*$/\1/p; d' /etc/os-release`
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${ubuntu_codename}/ llvm-toolchain-${ubuntu_codename}-22 main" -y
sudo apt-get update -q
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends clang-22 libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors-dev libcap-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
- name: Build
run: make -k
- name: Distcheck
run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities'
build-ubuntu-latest-gcc-static:
runs-on: ubuntu-latest
# Enable LTO, might trigger additional warnings on advanced inlining
env:
CFLAGS: -O3 -g -flto
LDFLAGS: -O3 -g -flto
steps:
- uses: actions/checkout@v6
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends libncursesw5-dev libtinfo-dev libgpm-dev libsensors-dev libcap-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-static --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --disable-hwloc --disable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
- name: Build
run: make -k
- name: Distcheck
run: make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-static --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --disable-hwloc --disable-delayacct --enable-sensors --enable-capabilities'
build-ubuntu-latest-pcp:
# we want PCP v5.2.3+
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends libpcp3-dev libncursesw5-dev libtinfo-dev libgpm-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --enable-pcp --enable-unicode || ( cat config.log; exit 1; )
- name: Build
run: make -k
build-unsupported-latest-gcc:
# build as if we were on an unsupported platform
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends libncursesw5-dev libtinfo-dev libgpm-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --host=`uname -m`-none --enable-werror --enable-unicode || ( cat config.log; exit 1; )
- name: Build
run: make -k
build-ubuntu-latest-clang-analyzer:
runs-on: ubuntu-latest
env:
CC: clang-22
steps:
- uses: actions/checkout@v6
- name: install clang repo
run: |
ubuntu_codename=`LC_ALL=C sed 's/^ *UBUNTU_CODENAME *= *\([a-z]*\).*$/\1/p; d' /etc/os-release`
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${ubuntu_codename}/ llvm-toolchain-${ubuntu_codename}-22 main" -y
sudo apt-get update -q
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends clang-22 clang-tools-22 libncursesw5-dev libnl-3-dev libnl-genl-3-dev libsensors-dev libcap-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: scan-build-22 -analyze-headers --status-bugs ./configure --enable-debug --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
- name: Build
run: scan-build-22 -analyze-headers --status-bugs make -j"$(nproc)"
build-ubuntu-latest-clang-sanitizer:
runs-on: ubuntu-latest
env:
CC: clang-22
CFLAGS: '-O1 -g -ftrivial-auto-var-init=pattern -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-address-use-after-return=always -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=nullability -fsanitize=implicit-conversion -fsanitize=integer -fsanitize=float-divide-by-zero -fsanitize=local-bounds'
LDFLAGS: '-ftrivial-auto-var-init=pattern -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-address-use-after-return=always -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=nullability -fsanitize=implicit-conversion -fsanitize=integer -fsanitize=float-divide-by-zero -fsanitize=local-bounds'
ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
UBSAN_OPTIONS: print_stacktrace=1:print_summary=1:halt_on_error=1
TERM: xterm-color
HTOPRC: .github/workflows/htoprc
steps:
- uses: actions/checkout@v6
- name: install clang repo
run: |
ubuntu_codename=`LC_ALL=C sed 's/^ *UBUNTU_CODENAME *= *\([a-z]*\).*$/\1/p; d' /etc/os-release`
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${ubuntu_codename}/ llvm-toolchain-${ubuntu_codename}-22 main" -y
sudo apt-get update -q
- name: Install LLVM Toolchain
run: sudo apt-get install --no-install-recommends clang-22 libclang-rt-22-dev llvm-22
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors-dev libcap-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities || ( cat config.log; exit 1; )
- name: Build
run: make -k
- name: Run sanitized htop (1)
run: ./htop -h
- name: Run sanitized htop (2)
run: ./htop -n 5
- name: Run sanitized htop (3)
run: ./htop -n 5 -t
- name: Run sanitized htop (4)
run: ./htop -d 1 -n 50
build-macos-latest-clang:
runs-on: macOS-latest
env:
CC: clang
steps:
- uses: actions/checkout@v6
- name: Install Dependencies
run: brew install automake pkg-config
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror || ( cat config.log; exit 1; )
- name: Build
run: make -k
- name: Distcheck
run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror"
build-macos-latest-pcp:
runs-on: macOS-latest
env:
CC: clang
CFLAGS: -O3 -g -flto
LDFLAGS: -O3 -g -flto
steps:
- uses: actions/checkout@v6
- name: Install Dependencies
run: |
pcp_version=7.0.3-1
brew install automake pkg-config
curl -f -L -O https://github.com/performancecopilot/pcp/releases/download/$(echo ${pcp_version} | sed 's/-.*$//')/pcp-${pcp_version}.dmg
hdiutil attach pcp-${pcp_version}.dmg
sudo installer -verbose -pkg /Volumes/pcp-${pcp_version}/pcp-${pcp_version}.pkg -target /
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --enable-pcp --enable-unicode || ( cat config.log; exit 1; )
- name: Build
run: make -k
build-dragonflybsd-latest-gcc:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Compile
uses: vmactions/dragonflybsd-vm@v1
with:
release: '6.4.2'
usesh: true
prepare: |
pkg install -y gmake autoconf automake ncurses git
git config --global --add safe.directory /home/runner/work/htop/htop
run: |
set -e
export LDFLAGS="-L/usr/local/lib"
export CFLAGS="-I/usr/local/include"
./autogen.sh
./configure --enable-unicode --enable-werror
gmake -k
build-freebsd-latest-clang:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Compile
uses: vmactions/freebsd-vm@v1
with:
release: '15.0'
usesh: true
prepare: |
pkg install -y gmake autoconf automake pkgconf git
git config --global --add safe.directory /home/runner/work/htop/htop
run: |
set -e
./autogen.sh
./configure --enable-unicode --enable-werror
gmake -k
build-netbsd-latest-gcc:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Compile
uses: vmactions/netbsd-vm@v1
with:
release: '10.1'
usesh: true
prepare: |
PATH="/usr/pkg/sbin:/usr/pkg/bin:$PATH"
PKG_PATH="https://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/10.1/All/"
export PATH PKG_PATH
/usr/sbin/pkg_add pkgin
pkgin -y install autoconf automake libtool ncurses pkg-config gmake git
git config --global --add safe.directory /home/runner/work/htop/htop
run: |
set -e
./autogen.sh
./configure --enable-unicode --enable-werror
gmake -k
build-openbsd-latest-clang:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Compile
uses: vmactions/openbsd-vm@v1
with:
release: '7.8'
usesh: true
prepare: |
pkg_add gmake git
git config --global --add safe.directory /home/runner/work/htop/htop
run: |
set -e
autoconf_version_full=$(pkg_info -Q autoconf |
LC_ALL=C sed 's/^autoconf-\([0-9]*\.[0-9]*\)\(p[.0-9]*\)\{0,1\}$/\1\2/p; d' |
LC_ALL=C sort -n -r -t . -k 1,1 -k 2,2 |
sed '1 q')
automake_version_full=$(pkg_info -Q automake |
LC_ALL=C sed 's/^automake-\([0-9]*\.[0-9]*\)\(\.[0-9]*\)\{0,1\}\(p[0-9]*\)\{0,1\}$/\1\2\3/p; d' |
LC_ALL=C sort -n -r -t . -k 1,1 -k 2,2 -k 3,3 |
sed '1 q')
pkg_add -v autoconf-${autoconf_version_full} automake-${automake_version_full}
export AUTOCONF_VERSION=$(echo ${autoconf_version_full} |
LC_ALL=C sed 's/^\([0-9]*\.[0-9]*\).*$/\1/')
# Must not include the third version field in $AUTOMAKE_VERSION
export AUTOMAKE_VERSION=$(echo ${automake_version_full} |
LC_ALL=C sed 's/^\([0-9]*\.[0-9]*\).*$/\1/')
./autogen.sh
./configure --enable-unicode --enable-werror
gmake -k
build-solaris-latest-gcc:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Compile
uses: vmactions/solaris-vm@v1
with:
release: '11.4'
usesh: true
prepare: |
pkg install gnu-make autoconf automake ncurses git gcc
git config --global --add safe.directory /home/runner/work/htop/htop
run: |
set -e
./autogen.sh
./configure --enable-unicode --enable-werror
gmake -k
lint-whitespace:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: check-whitespaces
run: git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
lint-pcp-config:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: check-pcp-style
run: ./check-pcp-style.sh
================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
name: "CodeQL"
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 1 * * 0'
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
security-events: write
env:
# Enable format attributes in ncurses headers
# Enable fortified memory/string handling
CPPFLAGS: -DGCC_PRINTF -DGCC_SCANF -D_FORTIFY_SOURCE=2
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: cpp
- name: Install Dependencies
run: sudo apt-get install --no-install-recommends libncursesw5-dev libhwloc-dev libnl-3-dev libnl-genl-3-dev libsensors-dev libcap-dev
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure --enable-werror --enable-openvz --enable-vserver --enable-ancient-vserver --enable-unicode --enable-hwloc --enable-delayacct --enable-sensors --enable-capabilities
- name: Build
run: make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
================================================
FILE: .github/workflows/coverity.yml
================================================
name: "Coverity"
on:
schedule:
- cron: '0 1 * * *'
jobs:
analyze:
name: Analyze
if: github.repository == 'htop-dev/htop'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Download Coverity
run: |
cd ..
wget -q https://scan.coverity.com/download/linux64 --post-data "token=${TOKEN}&project=htop.dev" -O coverity_tool.tgz
mkdir coverity
tar xzf coverity_tool.tgz --strip 1 -C coverity
echo "$(pwd)/coverity/bin" >> $GITHUB_PATH
env:
TOKEN: ${{ secrets.COVERITY_TOKEN }}
- name: Bootstrap
run: ./autogen.sh
- name: Configure
run: ./configure
- name: Build with Coverity
run: cov-build --dir cov-int make
- name: Submit the result to Coverity
run: |
tar czvf htop.tgz cov-int
curl \
--form token=${TOKEN} \
--form email=nathans@redhat.com \
--form file=@htop.tgz \
--form version=${GITHUB_SHA} \
https://scan.coverity.com/builds?project=htop.dev
env:
TOKEN: ${{ secrets.COVERITY_TOKEN }}
================================================
FILE: .github/workflows/htoprc
================================================
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
htop_version=3.3.0-dev
config_reader_min_version=3
fields=0 48 17 18 38 39 40 2 46 47 49 1
hide_kernel_threads=1
hide_userland_threads=0
hide_running_in_container=0
shadow_other_users=1
show_thread_names=1
show_program_path=1
highlight_base_name=1
highlight_deleted_exe=1
shadow_distribution_path_prefix=1
highlight_megabytes=1
highlight_threads=1
highlight_changes=1
highlight_changes_delay_secs=5
find_comm_in_cmdline=1
strip_exe_from_cmdline=1
show_merged_command=1
header_margin=1
screen_tabs=1
detailed_cpu_time=1
cpu_count_from_one=0
show_cpu_usage=1
show_cpu_frequency=1
show_cpu_temperature=1
degree_fahrenheit=0
update_process_names=1
account_guest_in_cpu_meter=1
color_scheme=0
enable_mouse=1
delay=15
hide_function_bar=0
header_layout=two_50_50
column_meters_0=LeftCPUs4 CPU Memory Swap MemorySwap Zram Clock Date DateTime ZFSARC ZFSCARC SELinux SystemdUser FileDescriptors
column_meter_modes_0=1 1 1 1 1 1 2 2 2 2 2 2 2 2
column_meters_1=RightCPUs4 Tasks LoadAverage Load Uptime Battery System HugePages Hostname Blank PressureStallCPUSome PressureStallIOSome PressureStallIOFull PressureStallIRQFull PressureStallMemorySome PressureStallMemoryFull DiskIO NetworkIO
column_meter_modes_1=1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2
tree_view=0
sort_key=46
tree_sort_key=0
sort_direction=-1
tree_sort_direction=1
tree_view_always_by_pid=0
all_branches_collapsed=0
screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command
.sort_key=PERCENT_CPU
.tree_sort_key=PID
.tree_view_always_by_pid=0
.tree_view=0
.sort_direction=-1
.tree_sort_direction=1
.all_branches_collapsed=0
screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command
.sort_key=IO_RATE
.tree_sort_key=PID
.tree_view_always_by_pid=0
.tree_view=0
.sort_direction=-1
.tree_sort_direction=1
.all_branches_collapsed=0
screen:Dump=PID SCHEDULERPOLICY SYSCR CGROUP CCGROUP OOM IO_PRIORITY PERCENT_CPU_DELAY CTXT SECATTR CWD AUTOGROUP_ID Command
.sort_key=PID
.tree_sort_key=PID
.tree_view_always_by_pid=0
.tree_view=0
.sort_direction=1
.tree_sort_direction=1
.all_branches_collapsed=0
================================================
FILE: .gitignore
================================================
# the binaries:
htop
pcp-htop
# all object files
*.o
# skip all backups
*.bak
*~
.*.sw?
# skip coverage files
*.gcda
*/*.gcda
*.gcno
*/*.gcno
*.h.gch
*/.dirstamp
# automake/autoconf related files
.deps/
Makefile
Makefile.in
INSTALL
aclocal.m4
autom4te.cache/
compile
conf*/
config.guess
config.h
config.h.in
config.log
config.status
config.cache
config.sub
configure
depcomp
htop.1
pcp-htop.5
install-sh
libtool
ltmain.sh
m4/
missing
stamp-h1
# files related to valgrind/callgrind
callgrind.out.*
# IDE workspace configurations
/.idea/
/.vscode/
# Language Servers
/.cache/clangd/
================================================
FILE: .travis.yml
================================================
language: c
compiler:
- clang
- gcc
os:
- freebsd
script:
- ./autogen.sh
- ./configure --enable-werror
- make -k
- make distcheck DISTCHECK_CONFIGURE_FLAGS=--enable-werror
- sudo make install
- make installcheck
================================================
FILE: AUTHORS
================================================
Originally authored by:
Hisham H. Muhammad
Currently maintained by the htop dev team:
Benny Baumann
Christian Göttsche
Daniel Lange
Nathan Scott
For the full list of contributors see:
git log --format="%aN" | sort -u
================================================
FILE: Action.c
================================================
/*
htop - Action.c
(C) 2015 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "config.h" // IWYU pragma: keep
#include "Action.h"
#include <assert.h>
#include <pwd.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "CRT.h"
#include "CategoriesPanel.h"
#include "CommandScreen.h"
#include "DynamicColumn.h"
#include "EnvScreen.h"
#include "FunctionBar.h"
#include "Hashtable.h"
#include "IncSet.h"
#include "InfoScreen.h"
#include "ListItem.h"
#include "Macros.h"
#include "MainPanel.h"
#include "MemoryMeter.h"
#include "OpenFilesScreen.h"
#include "Platform.h"
#include "Process.h"
#include "ProcessLocksScreen.h"
#include "ProvideCurses.h"
#include "Row.h"
#include "RowField.h"
#include "Scheduling.h"
#include "ScreenManager.h"
#include "SignalsPanel.h"
#include "Table.h"
#include "TraceScreen.h"
#include "UsersTable.h"
#include "Vector.h"
#include "XUtils.h"
#if (defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY))
#include "Affinity.h"
#include "AffinityPanel.h"
#endif
Object* Action_pickFromVector(State* st, Panel* list, int x, bool follow) {
MainPanel* mainPanel = st->mainPanel;
Header* header = st->header;
Machine* host = st->host;
int y = ((Panel*)mainPanel)->y;
ScreenManager* scr = ScreenManager_new(header, host, st, false);
scr->allowFocusChange = false;
ScreenManager_add(scr, list, x);
ScreenManager_add(scr, (Panel*)mainPanel, -1);
Panel* panelFocus;
int ch;
bool unfollow = false;
int row = follow ? MainPanel_selectedRow(mainPanel) : -1;
if (follow && host->activeTable->following == -1) {
host->activeTable->following = row;
unfollow = true;
}
ScreenManager_run(scr, &panelFocus, &ch, NULL);
if (unfollow) {
host->activeTable->following = -1;
}
ScreenManager_delete(scr);
Panel_move((Panel*)mainPanel, 0, y);
Panel_resize((Panel*)mainPanel, COLS, LINES - y - 1);
if (panelFocus == list && ch == 13) {
if (follow) {
const Row* selected = (const Row*)Panel_getSelected((Panel*)mainPanel);
if (selected && selected->id == row)
return Panel_getSelected(list);
beep();
} else {
return Panel_getSelected(list);
}
}
return NULL;
}
// ----------------------------------------
static void Action_runSetup(State* st) {
const Settings* settings = st->host->settings;
ScreenManager* scr = ScreenManager_new(st->header, st->host, st, true);
CategoriesPanel_new(scr, st->header, st->host);
ScreenManager_run(scr, NULL, NULL, "Setup");
ScreenManager_delete(scr);
if (settings->changed) {
CRT_setMouse(settings->enableMouse);
Header_writeBackToSettings(st->header);
}
}
static bool changePriority(MainPanel* panel, int delta) {
bool anyTagged;
bool ok = MainPanel_foreachRow(panel, Process_rowChangePriorityBy, (Arg) { .i = delta }, &anyTagged);
if (!ok)
beep();
return anyTagged;
}
static void addUserToVector(ht_key_t key, void* userCast, void* panelCast) {
const char* user = userCast;
Panel* panel = panelCast;
Panel_add(panel, (Object*) ListItem_new(user, key));
}
bool Action_setUserOnly(const char* userName, uid_t* userId) {
const struct passwd* user = getpwnam(userName);
if (user) {
*userId = user->pw_uid;
return true;
}
*userId = (uid_t)-1;
return false;
}
static void tagAllChildren(Panel* panel, Row* parent) {
parent->tag = true;
int parent_id = parent->id;
for (int i = 0; i < Panel_size(panel); i++) {
Row* row = (Row*) Panel_get(panel, i);
if (!row->tag && Row_isChildOf(row, parent_id)) {
tagAllChildren(panel, row);
}
}
}
static bool expandCollapse(Panel* panel) {
Row* row = (Row*) Panel_getSelected(panel);
if (!row)
return false;
row->showChildren = !row->showChildren;
return true;
}
static bool collapseIntoParent(Panel* panel) {
const Row* r = (Row*) Panel_getSelected(panel);
if (!r)
return false;
int parent_id = Row_getGroupOrParent(r);
for (int i = 0; i < Panel_size(panel); i++) {
Row* row = (Row*) Panel_get(panel, i);
if (row->id == parent_id) {
row->showChildren = false;
Panel_setSelected(panel, i);
return true;
}
}
return false;
}
Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey) {
ScreenSettings_setSortKey(settings->ss, (RowField) sortKey);
return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_UPDATE_PANELHDR | HTOP_KEEP_FOLLOWING;
}
// ----------------------------------------
static bool Action_writeableProcess(State* st) {
const Settings* settings = st->host->settings;
bool readonly = Settings_isReadonly() || settings->ss->dynamic;
return !readonly;
}
static bool Action_readableProcess(State* st) {
const Settings* settings = st->host->settings;
return !settings->ss->dynamic;
}
static Htop_Reaction actionSetSortColumn(State* st) {
Htop_Reaction reaction = HTOP_OK;
Panel* sortPanel = Panel_new(0, 0, 0, 0, Class(ListItem), true, FunctionBar_newEnterEsc("Sort ", "Cancel "));
Panel_setHeader(sortPanel, "Sort by");
Machine* host = st->host;
Settings* settings = host->settings;
const RowField* fields = settings->ss->fields;
Hashtable* dynamicColumns = settings->dynamicColumns;
for (int i = 0; fields[i]; i++) {
char* name = NULL;
if (fields[i] >= ROW_DYNAMIC_FIELDS) {
DynamicColumn* column = Hashtable_get(dynamicColumns, fields[i]);
if (!column)
continue;
name = xStrdup(column->caption ? column->caption : column->name);
} else {
name = String_trim(Process_fields[fields[i]].name);
}
Panel_add(sortPanel, (Object*) ListItem_new(name, fields[i]));
if (fields[i] == ScreenSettings_getActiveSortKey(settings->ss))
Panel_setSelected(sortPanel, i);
free(name);
}
const ListItem* field = (const ListItem*) Action_pickFromVector(st, sortPanel, 14, false);
if (field) {
reaction |= Action_setSortKey(settings, field->key);
}
Object_delete(sortPanel);
host->activeTable->needsSort = true;
return reaction | HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
}
static Htop_Reaction actionSortByPID(State* st) {
return Action_setSortKey(st->host->settings, PID);
}
static Htop_Reaction actionSortByMemory(State* st) {
return Action_setSortKey(st->host->settings, PERCENT_MEM);
}
static Htop_Reaction actionSortByCPU(State* st) {
return Action_setSortKey(st->host->settings, PERCENT_CPU);
}
static Htop_Reaction actionSortByTime(State* st) {
return Action_setSortKey(st->host->settings, TIME);
}
static Htop_Reaction actionToggleKernelThreads(State* st) {
Settings* settings = st->host->settings;
settings->hideKernelThreads = !settings->hideKernelThreads;
settings->lastUpdate++;
Machine_scanTables(st->host); // needed to not have a visible delay showing wrong data
return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING;
}
static Htop_Reaction actionToggleUserlandThreads(State* st) {
Settings* settings = st->host->settings;
settings->hideUserlandThreads = !settings->hideUserlandThreads;
settings->lastUpdate++;
Machine_scanTables(st->host); // needed to not have a visible delay showing wrong data
return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING;
}
static Htop_Reaction actionToggleRunningInContainer(State* st) {
Settings* settings = st->host->settings;
settings->hideRunningInContainer = !settings->hideRunningInContainer;
settings->lastUpdate++;
return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING;
}
static Htop_Reaction actionToggleProgramPath(State* st) {
Settings* settings = st->host->settings;
settings->showProgramPath = !settings->showProgramPath;
settings->lastUpdate++;
return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING;
}
static Htop_Reaction actionToggleMergedCommand(State* st) {
Settings* settings = st->host->settings;
settings->showMergedCommand = !settings->showMergedCommand;
settings->lastUpdate++;
return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING | HTOP_UPDATE_PANELHDR;
}
static Htop_Reaction actionToggleTreeView(State* st) {
Machine* host = st->host;
ScreenSettings* ss = host->settings->ss;
ss->treeView = !ss->treeView;
if (!ss->allBranchesCollapsed)
Table_expandTree(host->activeTable);
host->activeTable->needsSort = true;
return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
}
static Htop_Reaction actionToggleHideMeters(State* st) {
st->hideMeters = !st->hideMeters;
return HTOP_RESIZE | HTOP_KEEP_FOLLOWING;
}
static Htop_Reaction actionExpandOrCollapseAllBranches(State* st) {
Machine* host = st->host;
ScreenSettings* ss = host->settings->ss;
if (!ss->treeView) {
return HTOP_OK;
}
ss->allBranchesCollapsed = !ss->allBranchesCollapsed;
if (ss->allBranchesCollapsed)
Table_collapseAllBranches(host->activeTable);
else
Table_expandTree(host->activeTable);
return HTOP_REFRESH | HTOP_SAVE_SETTINGS;
}
static Htop_Reaction actionIncFilter(State* st) {
Machine* host = st->host;
IncSet* inc = (st->mainPanel)->inc;
IncSet_activate(inc, INC_FILTER, (Panel*)st->mainPanel);
host->activeTable->incFilter = IncSet_filter(inc);
return HTOP_REFRESH | HTOP_KEEP_FOLLOWING;
}
static Htop_Reaction actionIncSearch(State* st) {
IncSet_reset(st->mainPanel->inc, INC_SEARCH);
IncSet_activate(st->mainPanel->inc, INC_SEARCH, (Panel*)st->mainPanel);
return HTOP_REFRESH | HTOP_KEEP_FOLLOWING;
}
static Htop_Reaction actionHigherPriority(State* st) {
if (!Action_writeableProcess(st))
return HTOP_OK;
bool changed = changePriority(st->mainPanel, -1);
return changed ? HTOP_REFRESH : HTOP_OK;
}
static Htop_Reaction actionLowerPriority(State* st) {
if (!Action_writeableProcess(st))
return HTOP_OK;
bool changed = changePriority(st->mainPanel, 1);
return changed ? HTOP_REFRESH : HTOP_OK;
}
static Htop_Reaction actionInvertSortOrder(State* st) {
Machine* host = st->host;
ScreenSettings_invertSortOrder(host->settings->ss);
host->activeTable->needsSort = true;
return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING | HTOP_UPDATE_PANELHDR;
}
static Htop_Reaction actionExpandOrCollapse(State* st) {
if (!st->host->settings->ss->treeView)
return HTOP_OK;
bool changed = expandCollapse((Panel*)st->mainPanel);
return changed ? HTOP_RECALCULATE : HTOP_OK;
}
static Htop_Reaction actionCollapseIntoParent(State* st) {
if (!st->host->settings->ss->treeView) {
return HTOP_OK;
}
bool changed = collapseIntoParent((Panel*)st->mainPanel);
return changed ? HTOP_RECALCULATE : HTOP_OK;
}
static Htop_Reaction actionExpandCollapseOrSortColumn(State* st) {
return st->host->settings->ss->treeView ? actionExpandOrCollapse(st) : actionSetSortColumn(st);
}
static inline void setActiveScreen(Settings* settings, State* st, unsigned int ssIdx) {
assert(settings->ssIndex == ssIdx);
Machine* host = st->host;
settings->ss = settings->screens[ssIdx];
if (!settings->ss->table)
settings->ss->table = host->processTable;
host->activeTable = settings->ss->table;
// set correct functionBar - readonly if requested, and/or with non-process screens
bool readonly = Settings_isReadonly() || (host->activeTable != host->processTable);
MainPanel_setFunctionBar(st->mainPanel, readonly);
}
static Htop_Reaction actionNextScreen(State* st) {
Settings* settings = st->host->settings;
settings->ssIndex++;
if (settings->ssIndex == settings->nScreens) {
settings->ssIndex = 0;
}
setActiveScreen(settings, st, settings->ssIndex);
return HTOP_UPDATE_PANELHDR | HTOP_REFRESH | HTOP_REDRAW_BAR;
}
static Htop_Reaction actionPrevScreen(State* st) {
Settings* settings = st->host->settings;
if (settings->ssIndex == 0) {
settings->ssIndex = settings->nScreens - 1;
} else {
settings->ssIndex--;
}
setActiveScreen(settings, st, settings->ssIndex);
return HTOP_UPDATE_PANELHDR | HTOP_REFRESH | HTOP_REDRAW_BAR;
}
Htop_Reaction Action_setScreenTab(State* st, int x) {
Settings* settings = st->host->settings;
const int bracketWidth = (int)strlen("[]");
if (x < SCREEN_TAB_MARGIN_LEFT) {
return 0;
}
int rem = x - SCREEN_TAB_MARGIN_LEFT;
for (unsigned int i = 0; i < settings->nScreens; i++) {
const char* tab = settings->screens[i]->heading;
int width = rem >= bracketWidth ? (int)strnlen(tab, rem - bracketWidth + 1) : 0;
if (width >= rem - bracketWidth + 1) {
settings->ssIndex = i;
setActiveScreen(settings, st, i);
return HTOP_UPDATE_PANELHDR | HTOP_REFRESH | HTOP_REDRAW_BAR;
}
rem -= bracketWidth + width;
if (rem < SCREEN_TAB_COLUMN_GAP) {
return 0;
}
rem -= SCREEN_TAB_COLUMN_GAP;
}
return 0;
}
static Htop_Reaction actionQuit(ATTR_UNUSED State* st) {
return HTOP_QUIT;
}
static Htop_Reaction actionSetAffinity(State* st) {
if (!Action_writeableProcess(st))
return HTOP_OK;
Machine* host = st->host;
if (host->activeCPUs == 1)
return HTOP_OK;
#if (defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY))
const Row* row = (const Row*) Panel_getSelected((Panel*)st->mainPanel);
if (!row)
return HTOP_OK;
Affinity* affinity1 = Affinity_rowGet(row, host);
if (!affinity1)
return HTOP_OK;
int width;
Panel* affinityPanel = AffinityPanel_new(host, affinity1, &width);
Affinity_delete(affinity1);
const void* set = Action_pickFromVector(st, affinityPanel, width, true);
if (set) {
Affinity* affinity2 = AffinityPanel_getAffinity(affinityPanel, host);
bool ok = MainPanel_foreachRow(st->mainPanel, Affinity_rowSet, (Arg) { .v = affinity2 }, NULL);
if (!ok)
beep();
Affinity_delete(affinity2);
}
Object_delete(affinityPanel);
return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
#else
return HTOP_OK;
#endif
}
#ifdef SCHEDULER_SUPPORT
static Htop_Reaction actionSetSchedPolicy(State* st) {
if (!Action_writeableProcess(st))
return HTOP_KEEP_FOLLOWING;
static int preSelectedPolicy = SCHEDULINGPANEL_INITSELECTEDPOLICY;
static int preSelectedPriority = SCHEDULINGPANEL_INITSELECTEDPRIORITY;
Panel* schedPanel = Scheduling_newPolicyPanel(preSelectedPolicy);
const ListItem* policy;
for (;;) {
policy = (const ListItem*) Action_pickFromVector(st, schedPanel, 18, true);
if (!policy || policy->key != -1)
break;
Scheduling_togglePolicyPanelResetOnFork(schedPanel);
}
if (policy) {
preSelectedPolicy = policy->key;
Panel* prioPanel = Scheduling_newPriorityPanel(policy->key, preSelectedPriority);
if (prioPanel) {
const ListItem* prio = (const ListItem*) Action_pickFromVector(st, prioPanel, 14, true);
if (prio)
preSelectedPriority = prio->key;
Panel_delete((Object*) prioPanel);
}
SchedulingArg v = { .policy = preSelectedPolicy, .priority = preSelectedPriority };
bool ok = MainPanel_foreachRow(st->mainPanel, Scheduling_rowSetPolicy, (Arg) { .v = &v }, NULL);
if (!ok)
beep();
}
Panel_delete((Object*)schedPanel);
return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_KEEP_FOLLOWING;
}
#endif /* SCHEDULER_SUPPORT */
static Htop_Reaction actionKill(State* st) {
if (!Action_writeableProcess(st))
return HTOP_OK;
static int preSelectedSignal = SIGNALSPANEL_INITSELECTEDSIGNAL;
Panel* signalsPanel = SignalsPanel_new(preSelectedSignal);
const ListItem* sgn = (ListItem*) Action_pickFromVector(st, signalsPanel, 14, true);
if (sgn && sgn->key != 0) {
preSelectedSignal = sgn->key;
Panel_setHeader((Panel*)st->mainPanel, "Sending...");
Panel_draw((Panel*)st->mainPanel, false, true, true, State_hideFunctionBar(st));
refresh();
bool ok = MainPanel_foreachRow(st->mainPanel, Process_rowSendSignal, (Arg) { .i = sgn->key }, NULL);
if (!ok) {
beep();
}
napms(500);
}
Panel_delete((Object*)signalsPanel);
return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
}
static Htop_Reaction actionFilterByUser(State* st) {
Panel* usersPanel = Panel_new(0, 0, 0, 0, Class(ListItem), true, FunctionBar_newEnterEsc("Show ", "Cancel "));
Panel_setHeader(usersPanel, "Show processes of:");
Machine* host = st->host;
UsersTable_foreach(host->usersTable, addUserToVector, usersPanel);
Vector_insertionSort(usersPanel->items);
ListItem* allUsers = ListItem_new("All users", -1);
Panel_insert(usersPanel, 0, (Object*) allUsers);
const ListItem* picked = (ListItem*) Action_pickFromVector(st, usersPanel, 19, false);
if (picked) {
if (picked == allUsers) {
host->userId = (uid_t)-1;
} else {
Action_setUserOnly(ListItem_getRef(picked), &host->userId);
}
}
Panel_delete((Object*)usersPanel);
return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
}
Htop_Reaction Action_follow(State* st) {
st->host->activeTable->following = MainPanel_selectedRow(st->mainPanel);
Panel_setSelectionColor((Panel*)st->mainPanel, PANEL_SELECTION_FOLLOW);
return HTOP_KEEP_FOLLOWING;
}
static Htop_Reaction actionSetup(State* st) {
Action_runSetup(st);
return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR | HTOP_RESIZE;
}
static Htop_Reaction actionLsof(State* st) {
if (!Action_writeableProcess(st))
return HTOP_OK;
const Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel);
if (!p)
return HTOP_OK;
assert(Object_isA((const Object*) p, (const ObjectClass*) &Process_class));
OpenFilesScreen* ofs = OpenFilesScreen_new(p);
InfoScreen_run((InfoScreen*)ofs);
OpenFilesScreen_delete((Object*)ofs);
clear();
CRT_enableDelay();
return HTOP_REFRESH | HTOP_REDRAW_BAR;
}
static Htop_Reaction actionShowLocks(State* st) {
if (!Action_readableProcess(st))
return HTOP_OK;
const Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel);
if (!p)
return HTOP_OK;
assert(Object_isA((const Object*) p, (const ObjectClass*) &Process_class));
ProcessLocksScreen* pls = ProcessLocksScreen_new(p);
InfoScreen_run((InfoScreen*)pls);
ProcessLocksScreen_delete((Object*)pls);
clear();
CRT_enableDelay();
return HTOP_REFRESH | HTOP_REDRAW_BAR;
}
static Htop_Reaction actionStrace(State* st) {
if (!Action_writeableProcess(st))
return HTOP_OK;
const Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel);
if (!p)
return HTOP_OK;
assert(Object_isA((const Object*) p, (const ObjectClass*) &Process_class));
TraceScreen* ts = TraceScreen_new(p);
bool ok = TraceScreen_forkTracer(ts);
if (ok) {
InfoScreen_run((InfoScreen*)ts);
}
TraceScreen_delete((Object*)ts);
clear();
CRT_enableDelay();
return HTOP_REFRESH | HTOP_REDRAW_BAR;
}
static Htop_Reaction actionTag(State* st) {
Row* r = (Row*) Panel_getSelected((Panel*)st->mainPanel);
if (!r)
return HTOP_OK;
Row_toggleTag(r);
Panel_onKey((Panel*)st->mainPanel, KEY_DOWN);
return HTOP_OK;
}
static Htop_Reaction actionRedraw(ATTR_UNUSED State* st) {
clear();
// HTOP_RECALCULATE here to make Ctrl-L also refresh the data and not only redraw
return HTOP_RECALCULATE | HTOP_REFRESH | HTOP_REDRAW_BAR;
}
static Htop_Reaction actionTogglePauseUpdate(State* st) {
st->pauseUpdate = !st->pauseUpdate;
return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_KEEP_FOLLOWING;
}
static const struct {
const char* key;
bool roInactive;
const char* info;
} helpLeft[] = {
{ .key = " #: ", .roInactive = false, .info = "hide/show header meters" },
{ .key = " Tab: ", .roInactive = false, .info = "switch to next screen tab" },
{ .key = " Arrows: ", .roInactive = false, .info = "scroll process list" },
{ .key = " Digits: ", .roInactive = false, .info = "incremental PID search" },
{ .key = " F3 /: ", .roInactive = false, .info = "incremental name search" },
{ .key = " F4 \\: ", .roInactive = false, .info = "incremental name filtering" },
{ .key = " F5 t: ", .roInactive = false, .info = "tree view" },
{ .key = " p: ", .roInactive = false, .info = "toggle program path" },
{ .key = " m: ", .roInactive = false, .info = "toggle merged command" },
{ .key = " Z: ", .roInactive = false, .info = "pause/resume process updates" },
{ .key = " u: ", .roInactive = false, .info = "show processes of a single user" },
{ .key = " H: ", .roInactive = false, .info = "hide/show user process threads" },
{ .key = " K: ", .roInactive = false, .info = "hide/show kernel threads" },
{ .key = " O: ", .roInactive = false, .info = "hide/show processes in containers" },
{ .key = " F: ", .roInactive = false, .info = "cursor follows process" },
{ .key = " + - *: ", .roInactive = false, .info = "expand/collapse tree/toggle all" },
{ .key = "N P M T: ", .roInactive = false, .info = "sort by PID, CPU%, MEM% or TIME" },
{ .key = " I: ", .roInactive = false, .info = "invert sort order" },
{ .key = " F6 > .: ", .roInactive = false, .info = "select sort column" },
{ .key = NULL, .info = NULL }
};
static const struct {
const char* key;
bool roInactive;
const char* info;
} helpRight[] = {
{ .key = " S-Tab: ", .roInactive = false, .info = "switch to previous screen tab" },
{ .key = " Space: ", .roInactive = false, .info = "tag process" },
{ .key = " c: ", .roInactive = false, .info = "tag process and its children" },
{ .key = " U: ", .roInactive = false, .info = "untag all processes" },
{ .key = " F9 k: ", .roInactive = true, .info = "kill process/tagged processes" },
{ .key = " F7 ]: ", .roInactive = true, .info = "higher priority (root only)" },
{ .key = " F8 [: ", .roInactive = true, .info = "lower priority (+ nice)" },
#if (defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY))
{ .key = " a: ", .roInactive = true, .info = "set CPU affinity" },
#endif
{ .key = " e: ", .roInactive = false, .info = "show process environment" },
{ .key = " i: ", .roInactive = true, .info = "set IO priority" },
{ .key = " l: ", .roInactive = true, .info = "list open files with lsof" },
{ .key = " x: ", .roInactive = false, .info = "list file locks of process" },
{ .key = " s: ", .roInactive = true, .info = "trace syscalls with strace" },
{ .key = " w: ", .roInactive = false, .info = "wrap process command in multiple lines" },
#ifdef SCHEDULER_SUPPORT
{ .key = " Y: ", .roInactive = true, .info = "set scheduling policy" },
#endif
{ .key = " F2 C S: ", .roInactive = false, .info = "setup" },
{ .key = " F1 h ?: ", .roInactive = false, .info = "show this help screen" },
{ .key = " F10 q: ", .roInactive = false, .info = "quit" },
{ .key = NULL, .info = NULL }
};
static inline void addattrstr( int attr, const char* str) {
attrset(attr);
addstr(str);
}
static Htop_Reaction actionHelp(State* st) {
clear();
attrset(CRT_colors[HELP_BOLD]);
for (int i = 0; i < LINES - 1; i++)
mvhline(i, 0, ' ', COLS);
int line = 0;
mvaddstr(line++, 0, "htop " VERSION " - " COPYRIGHT);
mvaddstr(line++, 0, "Released under the GNU GPLv2+. See 'man' page for more info.");
attrset(CRT_colors[DEFAULT_COLOR]);
line++;
mvaddstr(line++, 0, "CPU usage bar: ");
#define addbartext(attr, prefix, text) \
do { \
addattrstr(CRT_colors[DEFAULT_COLOR], prefix); \
addattrstr(attr, text); \
} while(0)
addattrstr(CRT_colors[BAR_BORDER], "[");
addbartext(CRT_colors[CPU_NICE_TEXT], "", "low");
addbartext(CRT_colors[CPU_NORMAL], "/", "normal");
addbartext(CRT_colors[CPU_SYSTEM], "/", "kernel");
if (st->host->settings->detailedCPUTime) {
addbartext(CRT_colors[CPU_IRQ], "/", "irq");
addbartext(CRT_colors[CPU_SOFTIRQ], "/", "soft-irq");
addbartext(CRT_colors[CPU_STEAL], "/", "steal");
addbartext(CRT_colors[CPU_GUEST], "/", "guest");
addbartext(CRT_colors[CPU_IOWAIT], "/", "io-wait");
addbartext(CRT_colors[BAR_SHADOW], " ", "used%");
} else {
addbartext(CRT_colors[CPU_GUEST], "/", "virt");
addbartext(CRT_colors[BAR_SHADOW], " ", "used%");
}
addattrstr(CRT_colors[BAR_BORDER], "]");
attrset(CRT_colors[DEFAULT_COLOR]);
mvaddstr(line++, 0, "Memory bar: ");
addattrstr(CRT_colors[BAR_BORDER], "[");
// memory classes are OS-specific and provided in their <os>/Platform.c implementation
// ideal length of memory bar == 56 chars. Any length < 45 requires padding to 45.
// [0 1 2 3 4 5 ]
// [12345678901234567890123456789012345678901234567890123456]
// [ ^ 5 ]
// [class1/class2/class3/.../classN used/total]
int barTxtLen = 0;
for (unsigned int i = 0; i < Platform_numberOfMemoryClasses; i++) {
if (!st->host->settings->showCachedMemory && Platform_memoryClasses[i].countsAsCache)
continue; // skip reclaimable cache memory classes if "show cached memory" is not ticked
if (!Platform_memoryClasses[i].countsAsUsed && !Platform_memoryClasses[i].countsAsCache)
continue; // skip available memory class (special case for the Linux platform)
addbartext(CRT_colors[Platform_memoryClasses[i].color], (i == 0 ? "" : "/"), Platform_memoryClasses[i].label);
barTxtLen += (i == 0 ? 0 : 1) + strlen (Platform_memoryClasses[i].label);
}
for (int i = barTxtLen; i < 45; i++)
addattrstr(CRT_colors[BAR_SHADOW], " "); // pad to 45 chars if necessary
addbartext(CRT_colors[BAR_SHADOW], " ", "used");
addbartext(CRT_colors[BAR_SHADOW], "/", "total");
addattrstr(CRT_colors[BAR_BORDER], "]");
attrset(CRT_colors[DEFAULT_COLOR]);
mvaddstr(line++, 0, "Swap bar: ");
addattrstr(CRT_colors[BAR_BORDER], "[");
addbartext(CRT_colors[SWAP], "", "used");
#ifdef HTOP_LINUX
addbartext(CRT_colors[SWAP_CACHE], "/", "cache");
addbartext(CRT_colors[SWAP_FRONTSWAP], "/", "frontswap");
#else
addbartext(CRT_colors[BAR_SHADOW], " ", "");
#endif
addbartext(CRT_colors[BAR_SHADOW], " ", "used");
addbartext(CRT_colors[BAR_SHADOW], "/", "total");
addattrstr(CRT_colors[BAR_BORDER], "]");
line++;
#undef addbartext
attrset(CRT_colors[DEFAULT_COLOR]);
mvaddstr(line++, 0, "Type and layout of header meters are configurable in the setup screen.");
if (CRT_colorScheme == COLORSCHEME_MONOCHROME) {
mvaddstr(line, 0, "In monochrome, meters display as different chars, in order: |#*@$%&.");
}
line++;
#define addattrstatestr(attr, state, desc) \
do { \
addattrstr(attr, state); \
addattrstr(CRT_colors[DEFAULT_COLOR], ": " desc); \
} while(0)
mvaddstr(line, 0, "Process state: ");
addattrstatestr(CRT_colors[PROCESS_RUN_STATE], "R", "running; ");
addattrstatestr(CRT_colors[PROCESS_SHADOW], "S", "sleeping; ");
addattrstatestr(CRT_colors[PROCESS_RUN_STATE], "t", "traced/stopped; ");
addattrstatestr(CRT_colors[PROCESS_D_STATE], "Z", "zombie; ");
addattrstatestr(CRT_colors[PROCESS_D_STATE], "D", "disk sleep");
attrset(CRT_colors[DEFAULT_COLOR]);
#undef addattrstatestr
line += 2;
const bool readonly = Settings_isReadonly();
int item;
for (item = 0; helpLeft[item].key; item++) {
attrset((helpLeft[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[DEFAULT_COLOR]);
mvaddstr(line + item, 10, helpLeft[item].info);
attrset((helpLeft[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[HELP_BOLD]);
mvaddstr(line + item, 1, helpLeft[item].key);
if (String_eq(helpLeft[item].key, " H: ")) {
attrset((helpLeft[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[PROCESS_THREAD]);
mvaddstr(line + item, 33, "threads");
} else if (String_eq(helpLeft[item].key, " K: ")) {
attrset((helpLeft[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[PROCESS_THREAD]);
mvaddstr(line + item, 27, "threads");
}
}
int leftHelpItems = item;
for (item = 0; helpRight[item].key; item++) {
attrset((helpRight[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[HELP_BOLD]);
mvaddstr(line + item, 43, helpRight[item].key);
attrset((helpRight[item].roInactive && readonly) ? CRT_colors[HELP_SHADOW] : CRT_colors[DEFAULT_COLOR]);
mvaddstr(line + item, 52, helpRight[item].info);
}
line += MAXIMUM(leftHelpItems, item);
line++;
attrset(CRT_colors[HELP_BOLD]);
mvaddstr(line++, 0, "Press any key to return.");
attrset(CRT_colors[DEFAULT_COLOR]);
refresh();
CRT_readKey();
clear();
return HTOP_RECALCULATE | HTOP_REDRAW_BAR | HTOP_KEEP_FOLLOWING;
}
static Htop_Reaction actionUntagAll(State* st) {
for (int i = 0; i < Panel_size((Panel*)st->mainPanel); i++) {
Row* row = (Row*) Panel_get((Panel*)st->mainPanel, i);
row->tag = false;
}
return HTOP_REFRESH;
}
static Htop_Reaction actionTagAllChildren(State* st) {
Row* row = (Row*) Panel_getSelected((Panel*)st->mainPanel);
if (!row)
return HTOP_OK;
tagAllChildren((Panel*)st->mainPanel, row);
return HTOP_OK;
}
static Htop_Reaction actionShowEnvScreen(State* st) {
if (!Action_readableProcess(st))
return HTOP_OK;
Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel);
if (!p)
return HTOP_OK;
assert(Object_isA((const Object*) p, (const ObjectClass*) &Process_class));
EnvScreen* es = EnvScreen_new(p);
InfoScreen_run((InfoScreen*)es);
EnvScreen_delete((Object*)es);
clear();
CRT_enableDelay();
return HTOP_REFRESH | HTOP_REDRAW_BAR;
}
static Htop_Reaction actionShowCommandScreen(State* st) {
if (!Action_readableProcess(st))
return HTOP_OK;
Process* p = (Process*) Panel_getSelected((Panel*)st->mainPanel);
if (!p)
return HTOP_OK;
assert(Object_isA((const Object*) p, (const ObjectClass*) &Process_class));
CommandScreen* cmdScr = CommandScreen_new(p);
InfoScreen_run((InfoScreen*)cmdScr);
CommandScreen_delete((Object*)cmdScr);
clear();
CRT_enableDelay();
return HTOP_REFRESH | HTOP_REDRAW_BAR;
}
void Action_setBindings(Htop_Action* keys) {
keys[' '] = actionTag;
keys['#'] = actionToggleHideMeters;
keys['*'] = actionExpandOrCollapseAllBranches;
keys['+'] = actionExpandOrCollapse;
keys[','] = actionSetSortColumn;
keys['-'] = actionExpandOrCollapse;
keys['.'] = actionSetSortColumn;
keys['/'] = actionIncSearch;
keys['<'] = actionSetSortColumn;
keys['='] = actionExpandOrCollapse;
keys['>'] = actionSetSortColumn;
keys['?'] = actionHelp;
keys['C'] = actionSetup;
keys['F'] = Action_follow;
keys['H'] = actionToggleUserlandThreads;
keys['I'] = actionInvertSortOrder;
keys['K'] = actionToggleKernelThreads;
keys['M'] = actionSortByMemory;
keys['N'] = actionSortByPID;
keys['O'] = actionToggleRunningInContainer;
keys['P'] = actionSortByCPU;
keys['S'] = actionSetup;
keys['T'] = actionSortByTime;
keys['U'] = actionUntagAll;
#ifdef SCHEDULER_SUPPORT
keys['Y'] = actionSetSchedPolicy;
#endif
keys['Z'] = actionTogglePauseUpdate;
keys['['] = actionLowerPriority;
keys['\014'] = actionRedraw; // Ctrl+L
keys['\177'] = actionCollapseIntoParent;
keys['\\'] = actionIncFilter;
keys[']'] = actionHigherPriority;
keys['a'] = actionSetAffinity;
keys['c'] = actionTagAllChildren;
keys['e'] = actionShowEnvScreen;
keys['h'] = actionHelp;
keys['k'] = actionKill;
keys['l'] = actionLsof;
keys['m'] = actionToggleMergedCommand;
keys['p'] = actionToggleProgramPath;
keys['q'] = actionQuit;
keys['s'] = actionStrace;
keys['t'] = actionToggleTreeView;
keys['u'] = actionFilterByUser;
keys['w'] = actionShowCommandScreen;
keys['x'] = actionShowLocks;
keys[KEY_F(1)] = actionHelp;
keys[KEY_F(2)] = actionSetup;
keys[KEY_F(3)] = actionIncSearch;
keys[KEY_F(4)] = actionIncFilter;
keys[KEY_F(5)] = actionToggleTreeView;
keys[KEY_F(6)] = actionSetSortColumn;
keys[KEY_F(7)] = actionHigherPriority;
keys[KEY_F(8)] = actionLowerPriority;
keys[KEY_F(9)] = actionKill;
keys[KEY_F(10)] = actionQuit;
keys[KEY_F(18)] = actionExpandCollapseOrSortColumn;
keys[KEY_RECLICK] = actionExpandOrCollapse;
keys[KEY_SHIFT_TAB] = actionPrevScreen;
keys['\t'] = actionNextScreen;
}
================================================
FILE: Action.h
================================================
#ifndef HEADER_Action
#define HEADER_Action
/*
htop - Action.h
(C) 2015 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include <stdbool.h>
#include <sys/types.h>
#include "Header.h"
#include "Machine.h"
#include "Object.h"
#include "Panel.h"
#include "Process.h"
#include "Settings.h"
typedef enum {
HTOP_OK = 0x00,
HTOP_REFRESH = 0x01,
HTOP_RECALCULATE = 0x02 | HTOP_REFRESH,
HTOP_SAVE_SETTINGS = 0x04,
HTOP_KEEP_FOLLOWING = 0x08,
HTOP_QUIT = 0x10,
HTOP_REDRAW_BAR = 0x20,
HTOP_UPDATE_PANELHDR = 0x40 | HTOP_REFRESH,
HTOP_RESIZE = 0x80 | HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR,
} Htop_Reaction;
struct MainPanel_; // IWYU pragma: keep
typedef struct State_ {
Machine* host;
struct MainPanel_* mainPanel;
Header* header;
const char* failedUpdate; /* function bar diagnostic or NULL if no error */
bool pauseUpdate;
bool hideSelection;
bool hideMeters;
} State;
static inline bool State_hideFunctionBar(const State* st) {
const Settings* settings = st->host->settings;
return settings->hideFunctionBar == 2 || (settings->hideFunctionBar == 1 && st->hideSelection);
}
typedef Htop_Reaction (*Htop_Action)(State* st);
Object* Action_pickFromVector(State* st, Panel* list, int x, bool follow);
bool Action_setUserOnly(const char* userName, uid_t* userId);
Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey);
Htop_Reaction Action_setScreenTab(State* st, int x);
Htop_Reaction Action_follow(State* st);
void Action_setBindings(Htop_Action* keys);
#endif
================================================
FILE: Affinity.c
================================================
/*
htop - Affinity.c
(C) 2004-2011 Hisham H. Muhammad
(C) 2020 Red Hat, Inc. All Rights Reserved.
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "config.h" // IWYU pragma: keep
#include "Affinity.h"
#include <assert.h>
#include <stdlib.h>
#include "Process.h"
#include "XUtils.h"
#if defined(HAVE_LIBHWLOC)
#include <hwloc.h>
#include <hwloc/bitmap.h>
#ifdef __linux__
#define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_THREAD
#else
#define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_PROCESS
#endif
#elif defined(HAVE_AFFINITY)
#include <sched.h>
#endif
Affinity* Affinity_new(Machine* host) {
Affinity* this = xCalloc(1, sizeof(Affinity));
this->size = 8;
this->cpus = xCalloc(this->size, sizeof(unsigned int));
this->host = host;
return this;
}
void Affinity_delete(Affinity* this) {
free(this->cpus);
free(this);
}
void Affinity_add(Affinity* this, unsigned int id) {
if (this->used == this->size) {
this->size *= 2;
this->cpus = xRealloc(this->cpus, sizeof(unsigned int) * this->size);
}
this->cpus[this->used] = id;
this->used++;
}
#if defined(HAVE_LIBHWLOC)
static Affinity* Affinity_get(const Process* p, Machine* host) {
hwloc_cpuset_t cpuset = hwloc_bitmap_alloc();
bool ok = (hwloc_get_proc_cpubind(host->topology, Process_getPid(p), cpuset, HTOP_HWLOC_CPUBIND_FLAG) == 0);
Affinity* affinity = NULL;
if (ok) {
affinity = Affinity_new(host);
if (hwloc_bitmap_last(cpuset) == -1) {
for (unsigned int i = 0; i < host->existingCPUs; i++) {
Affinity_add(affinity, i);
}
} else {
int id;
hwloc_bitmap_foreach_begin(id, cpuset)
Affinity_add(affinity, (unsigned)id);
hwloc_bitmap_foreach_end();
}
}
hwloc_bitmap_free(cpuset);
return affinity;
}
static bool Affinity_set(Process* p, Arg arg) {
Affinity* this = arg.v;
hwloc_cpuset_t cpuset = hwloc_bitmap_alloc();
for (unsigned int i = 0; i < this->used; i++) {
hwloc_bitmap_set(cpuset, this->cpus[i]);
}
bool ok = (hwloc_set_proc_cpubind(this->host->topology, Process_getPid(p), cpuset, HTOP_HWLOC_CPUBIND_FLAG) == 0);
hwloc_bitmap_free(cpuset);
return ok;
}
#elif defined(HAVE_AFFINITY)
static Affinity* Affinity_get(const Process* p, Machine* host) {
cpu_set_t cpuset;
bool ok = (sched_getaffinity(Process_getPid(p), sizeof(cpu_set_t), &cpuset) == 0);
if (!ok)
return NULL;
Affinity* affinity = Affinity_new(host);
for (unsigned int i = 0; i < host->existingCPUs; i++) {
if (CPU_ISSET(i, &cpuset)) {
Affinity_add(affinity, i);
}
}
return affinity;
}
static bool Affinity_set(Process* p, Arg arg) {
Affinity* this = arg.v;
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
for (unsigned int i = 0; i < this->used; i++) {
CPU_SET(this->cpus[i], &cpuset);
}
bool ok = (sched_setaffinity(Process_getPid(p), sizeof(unsigned long), &cpuset) == 0);
return ok;
}
#endif
#if defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)
bool Affinity_rowSet(Row* row, Arg arg) {
Process* p = (Process*) row;
assert(Object_isA((const Object*) p, (const ObjectClass*) &Process_class));
return Affinity_set(p, arg);
}
Affinity* Affinity_rowGet(const Row* row, Machine* host) {
const Process* p = (const Process*) row;
assert(Object_isA((const Object*) p, (const ObjectClass*) &Process_class));
return Affinity_get(p, host);
}
#endif /* HAVE_LIBHWLOC || HAVE_AFFINITY */
================================================
FILE: Affinity.h
================================================
#ifndef HEADER_Affinity
#define HEADER_Affinity
/*
htop - Affinity.h
(C) 2004-2011 Hisham H. Muhammad
(C) 2020,2023 Red Hat, Inc. All Rights Reserved.
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "Machine.h"
#if defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)
#include <stdbool.h>
#include "Object.h"
#include "Row.h"
#endif
#if defined(HAVE_LIBHWLOC) && defined(HAVE_AFFINITY)
#error hwloc and affinity support are mutual exclusive.
#endif
typedef struct Affinity_ {
Machine* host;
unsigned int size;
unsigned int used;
unsigned int* cpus;
} Affinity;
Affinity* Affinity_new(Machine* host);
void Affinity_delete(Affinity* this);
void Affinity_add(Affinity* this, unsigned int id);
#if defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY)
Affinity* Affinity_rowGet(const Row* row, Machine* host);
bool Affinity_rowSet(Row* row, Arg arg);
#endif /* HAVE_LIBHWLOC || HAVE_AFFINITY */
#endif
================================================
FILE: AffinityPanel.c
================================================
/*
htop - AffinityPanel.c
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "config.h" // IWYU pragma: keep
#include "AffinityPanel.h"
#include <assert.h>
#include <limits.h> // IWYU pragma: keep
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "CRT.h"
#include "FunctionBar.h"
#include "Object.h"
#include "ProvideCurses.h"
#include "RichString.h"
#include "Settings.h"
#include "Vector.h"
#include "XUtils.h"
#ifdef HAVE_LIBHWLOC
#include <hwloc.h>
#include <hwloc/bitmap.h>
#endif
typedef struct MaskItem_ {
Object super;
char* text;
char* indent; /* used also as an condition whether this is a tree node */
int value; /* tri-state: 0 - off, 1 - some set, 2 - all set */
int sub_tree; /* tri-state: 0 - no sub-tree, 1 - open sub-tree, 2 - closed sub-tree */
Vector* children;
#ifdef HAVE_LIBHWLOC
bool ownCpuset;
hwloc_bitmap_t cpuset;
#else
int cpu;
#endif
} MaskItem;
static void MaskItem_delete(Object* cast) {
MaskItem* this = (MaskItem*) cast;
free(this->text);
free(this->indent);
Vector_delete(this->children);
#ifdef HAVE_LIBHWLOC
if (this->ownCpuset)
hwloc_bitmap_free(this->cpuset);
#endif
free(this);
}
static void MaskItem_display(const Object* cast, RichString* out) {
const MaskItem* this = (const MaskItem*)cast;
assert (this != NULL);
RichString_appendAscii(out, CRT_colors[CHECK_BOX], "[");
if (this->value == 2) {
RichString_appendAscii(out, CRT_colors[CHECK_MARK], "x");
} else if (this->value == 1) {
RichString_appendAscii(out, CRT_colors[CHECK_MARK], "o");
} else {
RichString_appendAscii(out, CRT_colors[CHECK_MARK], " ");
}
RichString_appendAscii(out, CRT_colors[CHECK_BOX], "]");
RichString_appendAscii(out, CRT_colors[CHECK_TEXT], " ");
if (this->indent) {
RichString_appendWide(out, CRT_colors[PROCESS_TREE], this->indent);
RichString_appendWide(out, CRT_colors[PROCESS_TREE],
this->sub_tree == 2
? CRT_treeStr[TREE_STR_OPEN]
: CRT_treeStr[TREE_STR_SHUT]);
RichString_appendAscii(out, CRT_colors[CHECK_TEXT], " ");
}
RichString_appendWide(out, CRT_colors[CHECK_TEXT], this->text);
}
static const ObjectClass MaskItem_class = {
.display = MaskItem_display,
.delete = MaskItem_delete
};
#ifdef HAVE_LIBHWLOC
static MaskItem* MaskItem_newMask(const char* text, const char* indent, hwloc_bitmap_t cpuset, bool owner) {
MaskItem* this = AllocThis(MaskItem);
this->text = xStrdup(text);
this->indent = xStrdup(indent); /* nonnull for tree node */
this->value = 0;
this->ownCpuset = owner;
this->cpuset = cpuset;
this->sub_tree = hwloc_bitmap_weight(cpuset) > 1 ? 1 : 0;
this->children = Vector_new(Class(MaskItem), true, VECTOR_DEFAULT_SIZE);
return this;
}
#endif
static MaskItem* MaskItem_newSingleton(const char* text, int cpu, bool isSet) {
MaskItem* this = AllocThis(MaskItem);
this->text = xStrdup(text);
this->indent = NULL; /* not a tree node */
this->sub_tree = 0;
this->children = Vector_new(Class(MaskItem), true, VECTOR_DEFAULT_SIZE);
#ifdef HAVE_LIBHWLOC
this->ownCpuset = true;
this->cpuset = hwloc_bitmap_alloc();
hwloc_bitmap_set(this->cpuset, cpu);
#else
this->cpu = cpu;
#endif
this->value = isSet ? 2 : 0;
return this;
}
typedef struct AffinityPanel_ {
Panel super;
Machine* host;
bool topoView;
Vector* cpuids;
unsigned width;
#ifdef HAVE_LIBHWLOC
MaskItem* topoRoot;
hwloc_const_cpuset_t allCpuset;
hwloc_bitmap_t workCpuset;
#endif
} AffinityPanel;
static void AffinityPanel_delete(Object* cast) {
AffinityPanel* this = (AffinityPanel*) cast;
Vector_delete(this->cpuids);
#ifdef HAVE_LIBHWLOC
hwloc_bitmap_free(this->workCpuset);
MaskItem_delete((Object*) this->topoRoot);
#endif
Panel_done(&this->super);
free(this);
}
#ifdef HAVE_LIBHWLOC
static void AffinityPanel_updateItem(AffinityPanel* this, MaskItem* item) {
Panel* super = &this->super;
item->value = hwloc_bitmap_isincluded(item->cpuset, this->workCpuset) ? 2 :
hwloc_bitmap_intersects(item->cpuset, this->workCpuset) ? 1 : 0;
Panel_add(super, (Object*) item);
}
static void AffinityPanel_updateTopo(AffinityPanel* this, MaskItem* item) {
AffinityPanel_updateItem(this, item);
if (item->sub_tree == 2)
return;
for (int i = 0; i < Vector_size(item->children); i++)
AffinityPanel_updateTopo(this, (MaskItem*) Vector_get(item->children, i));
}
#endif
static void AffinityPanel_update(AffinityPanel* this, bool keepSelected) {
Panel* super = &this->super;
FunctionBar_setLabel(super->currentBar, KEY_F(3), this->topoView ? "Collapse/Expand" : "");
int oldSelected = Panel_getSelectedIndex(super);
Panel_prune(super);
#ifdef HAVE_LIBHWLOC
if (this->topoView) {
AffinityPanel_updateTopo(this, this->topoRoot);
} else {
for (int i = 0; i < Vector_size(this->cpuids); i++) {
AffinityPanel_updateItem(this, (MaskItem*) Vector_get(this->cpuids, i));
}
}
#else
Panel_splice(super, this->cpuids);
#endif
if (keepSelected)
Panel_setSelected(super, oldSelected);
super->needsRedraw = true;
}
static HandlerResult AffinityPanel_eventHandler(Panel* super, int ch) {
AffinityPanel* this = (AffinityPanel*) super;
HandlerResult result = IGNORED;
MaskItem* selected = (MaskItem*) Panel_getSelected(super);
bool keepSelected = true;
switch (ch) {
case KEY_MOUSE:
case KEY_RECLICK:
case ' ':
if (!selected) {
return result;
}
#ifdef HAVE_LIBHWLOC
if (selected->value == 2) {
/* Item was selected, so remove this mask from the top cpuset. */
hwloc_bitmap_andnot(this->workCpuset, this->workCpuset, selected->cpuset);
selected->value = 0;
} else {
/* Item was not or only partial selected, so set all bits from this object
in the top cpuset. */
hwloc_bitmap_or(this->workCpuset, this->workCpuset, selected->cpuset);
selected->value = 2;
}
#else
selected->value = selected->value ? 0 : 2; /* toggle between 0 and 2 */
#endif
result = HANDLED;
break;
#ifdef HAVE_LIBHWLOC
case KEY_F(1):
hwloc_bitmap_copy(this->workCpuset, this->allCpuset);
result = HANDLED;
break;
case KEY_F(2):
this->topoView = !this->topoView;
keepSelected = false;
result = HANDLED;
break;
case KEY_F(3):
case '-':
case '+':
if (!selected) {
break;
}
if (selected->sub_tree) {
selected->sub_tree = 1 + !(selected->sub_tree - 1); /* toggle between 1 and 2 */
}
result = HANDLED;
break;
#endif
case 0x0a:
case 0x0d:
case KEY_ENTER:
result = BREAK_LOOP;
break;
}
if (HANDLED == result)
AffinityPanel_update(this, keepSelected);
return result;
}
#ifdef HAVE_LIBHWLOC
static MaskItem* AffinityPanel_addObject(AffinityPanel* this, hwloc_obj_t obj, unsigned indent, MaskItem* parent) {
const char* type_name = hwloc_obj_type_string(obj->type);
const char* index_prefix = "#";
unsigned depth = obj->depth;
unsigned index = obj->logical_index;
size_t off = 0, left = 10 * depth;
char buf[64], indent_buf[left + 1];
if (obj->type == HWLOC_OBJ_PU) {
index = Settings_cpuId(this->host->settings, obj->os_index);
type_name = "CPU";
index_prefix = "";
}
indent_buf[0] = '\0';
if (depth > 0) {
for (unsigned i = 1; i < depth; i++) {
xSnprintf(&indent_buf[off], left, "%s ", (indent & (1U << i)) ? CRT_treeStr[TREE_STR_VERT] : " ");
size_t len = strlen(&indent_buf[off]);
off += len;
left -= len;
}
xSnprintf(&indent_buf[off], left, "%s",
obj->next_sibling ? CRT_treeStr[TREE_STR_RTEE] : CRT_treeStr[TREE_STR_BEND]);
// Uncomment when further appending to indent_buf
//size_t len = strlen(&indent_buf[off]);
//off += len;
//left -= len;
}
xSnprintf(buf, sizeof(buf), "%s %s%u", type_name, index_prefix, index);
MaskItem* item = MaskItem_newMask(buf, indent_buf, obj->complete_cpuset, false);
if (parent)
Vector_add(parent->children, item);
if (item->sub_tree && parent && parent->sub_tree == 1) {
/* if obj is fully included or fully excluded, collapse the item */
hwloc_bitmap_t result = hwloc_bitmap_alloc();
hwloc_bitmap_and(result, obj->complete_cpuset, this->workCpuset);
int weight = hwloc_bitmap_weight(result);
hwloc_bitmap_free(result);
if (weight == 0 || weight == (hwloc_bitmap_weight(this->workCpuset) + hwloc_bitmap_weight(obj->complete_cpuset))) {
item->sub_tree = 2;
}
}
/* "[x] " + "|- " * depth + ("- ")?(if root node) + name */
unsigned int indent_width = 4 + 3 * depth + (2 * !depth);
assert(sizeof(buf) <= INT_MAX - indent_width);
unsigned int width = indent_width + (unsigned int)strlen(buf);
if (width > this->width) {
this->width = width;
}
return item;
}
static MaskItem* AffinityPanel_buildTopology(AffinityPanel* this, hwloc_obj_t obj, unsigned indent, MaskItem* parent) {
MaskItem* item = AffinityPanel_addObject(this, obj, indent, parent);
if (obj->next_sibling) {
indent |= (1U << obj->depth);
} else {
indent &= ~(1U << obj->depth);
}
for (unsigned i = 0; i < obj->arity; i++) {
AffinityPanel_buildTopology(this, obj->children[i], indent, item);
}
return parent == NULL ? item : NULL;
}
#endif
const PanelClass AffinityPanel_class = {
.super = {
.extends = Class(Panel),
.delete = AffinityPanel_delete
},
.eventHandler = AffinityPanel_eventHandler
};
static const char* const AffinityPanelFunctions[] = {
"Set ",
"Cancel ",
#ifdef HAVE_LIBHWLOC
"All",
"Topology",
" ",
#endif
NULL
};
static const char* const AffinityPanelKeys[] = {"Enter", "Esc", "F1", "F2", "F3"};
static const int AffinityPanelEvents[] = {13, 27, KEY_F(1), KEY_F(2), KEY_F(3)};
Panel* AffinityPanel_new(Machine* host, const Affinity* affinity, int* width) {
AffinityPanel* this = AllocThis(AffinityPanel);
Panel* super = &this->super;
Panel_init(super, 1, 1, 1, 1, Class(MaskItem), false, FunctionBar_new(AffinityPanelFunctions, AffinityPanelKeys, AffinityPanelEvents));
this->host = host;
/* defaults to 15, this also includes the gap between the panels,
* but this will be added by the caller */
this->width = 14;
this->cpuids = Vector_new(Class(MaskItem), true, VECTOR_DEFAULT_SIZE);
#ifdef HAVE_LIBHWLOC
this->topoView = host->settings->topologyAffinity;
#else
this->topoView = false;
#endif
#ifdef HAVE_LIBHWLOC
this->allCpuset = hwloc_topology_get_complete_cpuset(host->topology);
this->workCpuset = hwloc_bitmap_alloc();
#endif
Panel_setHeader(super, "Use CPUs:");
unsigned int curCpu = 0;
for (unsigned int i = 0; i < host->existingCPUs; i++) {
if (!Machine_isCPUonline(host, i))
continue;
char number[16];
xSnprintf(number, 9, "CPU %d", Settings_cpuId(host->settings, i));
unsigned int cpu_width = 4 + (unsigned int)strlen(number);
if (cpu_width > this->width) {
this->width = cpu_width;
}
bool isSet = false;
if (curCpu < affinity->used && affinity->cpus[curCpu] == i) {
#ifdef HAVE_LIBHWLOC
hwloc_bitmap_set(this->workCpuset, i);
#endif
isSet = true;
curCpu++;
}
MaskItem* cpuItem = MaskItem_newSingleton(number, i, isSet);
Vector_add(this->cpuids, (Object*) cpuItem);
}
#ifdef HAVE_LIBHWLOC
this->topoRoot = AffinityPanel_buildTopology(this, hwloc_get_root_obj(host->topology), 0, NULL);
#endif
if (width) {
*width = this->width;
}
AffinityPanel_update(this, false);
return super;
}
Affinity* AffinityPanel_getAffinity(Panel* super, Machine* host) {
const AffinityPanel* this = (AffinityPanel*) super;
Affinity* affinity = Affinity_new(host);
#ifdef HAVE_LIBHWLOC
int i;
hwloc_bitmap_foreach_begin(i, this->workCpuset)
Affinity_add(affinity, (unsigned)i);
hwloc_bitmap_foreach_end();
#else
for (int i = 0; i < Vector_size(this->cpuids); i++) {
const MaskItem* item = (const MaskItem*)Vector_get(this->cpuids, i);
if (item->value) {
Affinity_add(affinity, item->cpu);
}
}
#endif
return affinity;
}
================================================
FILE: AffinityPanel.h
================================================
#ifndef HEADER_AffinityPanel
#define HEADER_AffinityPanel
/*
htop - AffinityPanel.h
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "Affinity.h"
#include "Machine.h"
#include "Panel.h"
extern const PanelClass AffinityPanel_class;
Panel* AffinityPanel_new(Machine* host, const Affinity* affinity, int* width);
Affinity* AffinityPanel_getAffinity(Panel* super, Machine* host);
#endif
================================================
FILE: AvailableColumnsPanel.c
================================================
/*
htop - AvailableColumnsPanel.c
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "config.h" // IWYU pragma: keep
#include "AvailableColumnsPanel.h"
#include <assert.h>
#include <ctype.h>
#include <stdbool.h>
#include <stdlib.h>
#include "ColumnsPanel.h"
#include "DynamicColumn.h"
#include "FunctionBar.h"
#include "Hashtable.h"
#include "ListItem.h"
#include "Object.h"
#include "Platform.h"
#include "Process.h"
#include "ProvideCurses.h"
#include "RowField.h"
#include "XUtils.h"
static const char* const AvailableColumnsFunctions[] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done ", NULL};
static void AvailableColumnsPanel_delete(Object* object) {
AvailableColumnsPanel* this = (AvailableColumnsPanel*) object;
Panel_done(&this->super);
free(this);
}
static void AvailableColumnsPanel_insert(AvailableColumnsPanel* this, int at, int key) {
const char* name;
if (key >= ROW_DYNAMIC_FIELDS)
name = DynamicColumn_name(key);
else
name = Process_fields[key].name;
Panel_insert(this->columns, at, (Object*) ListItem_new(name, key));
}
static HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, int ch) {
AvailableColumnsPanel* this = (AvailableColumnsPanel*) super;
HandlerResult result = IGNORED;
switch (ch) {
case 13:
case KEY_ENTER:
case KEY_F(5): {
const ListItem* selected = (ListItem*) Panel_getSelected(super);
if (!selected)
break;
int at = Panel_getSelectedIndex(this->columns);
AvailableColumnsPanel_insert(this, at, selected->key);
Panel_setSelected(this->columns, at + 1);
ColumnsPanel_update(this->columns);
result = HANDLED;
break;
}
default:
if (0 < ch && ch < 255 && isgraph((unsigned char)ch))
result = Panel_selectByTyping(super, ch);
break;
}
return result;
}
const PanelClass AvailableColumnsPanel_class = {
.super = {
.extends = Class(Panel),
.delete = AvailableColumnsPanel_delete
},
.eventHandler = AvailableColumnsPanel_eventHandler
};
static void AvailableColumnsPanel_addDynamicColumn(ht_key_t key, void* value, void* data) {
const DynamicColumn* column = (const DynamicColumn*) value;
if (column->table) /* DynamicScreen, handled differently */
return;
AvailableColumnsPanel* this = (AvailableColumnsPanel*) data;
const char* title = column->heading ? column->heading : column->name;
const char* text = column->description ? column->description : column->caption;
char description[256];
if (text)
xSnprintf(description, sizeof(description), "%s - %s", title, text);
else
xSnprintf(description, sizeof(description), "%s", title);
Panel_add(&this->super, (Object*) ListItem_new(description, key));
}
// Handle DynamicColumns entries in the AvailableColumnsPanel
static void AvailableColumnsPanel_addDynamicColumns(AvailableColumnsPanel* this, Hashtable* dynamicColumns) {
assert(dynamicColumns);
Hashtable_foreach(dynamicColumns, AvailableColumnsPanel_addDynamicColumn, this);
}
// Handle remaining Platform Meter entries in the AvailableColumnsPanel
static void AvailableColumnsPanel_addPlatformColumns(AvailableColumnsPanel* this) {
for (int i = 1; i < LAST_PROCESSFIELD; i++) {
if (Process_fields[i].description) {
char description[256];
xSnprintf(description, sizeof(description), "%s - %s", Process_fields[i].name, Process_fields[i].description);
Panel_add(&this->super, (Object*) ListItem_new(description, i));
}
}
}
// Handle DynamicColumns entries associated with DynamicScreens
static void AvailableColumnsPanel_addDynamicScreens(AvailableColumnsPanel* this, const char* screen) {
Platform_addDynamicScreenAvailableColumns(&this->super, screen);
}
void AvailableColumnsPanel_fill(AvailableColumnsPanel* this, const char* dynamicScreen, Hashtable* dynamicColumns) {
Panel_prune(&this->super);
if (dynamicScreen) {
AvailableColumnsPanel_addDynamicScreens(this, dynamicScreen);
} else {
AvailableColumnsPanel_addPlatformColumns(this);
AvailableColumnsPanel_addDynamicColumns(this, dynamicColumns);
}
}
AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns, Hashtable* dynamicColumns) {
AvailableColumnsPanel* this = AllocThis(AvailableColumnsPanel);
Panel* super = &this->super;
FunctionBar* fuBar = FunctionBar_new(AvailableColumnsFunctions, NULL, NULL);
Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar);
Panel_setHeader(super, "Available Columns");
this->columns = columns;
AvailableColumnsPanel_fill(this, NULL, dynamicColumns);
return this;
}
================================================
FILE: AvailableColumnsPanel.h
================================================
#ifndef HEADER_AvailableColumnsPanel
#define HEADER_AvailableColumnsPanel
/*
htop - AvailableColumnsPanel.h
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "Hashtable.h"
#include "Panel.h"
typedef struct AvailableColumnsPanel_ {
Panel super;
Panel* columns;
} AvailableColumnsPanel;
extern const PanelClass AvailableColumnsPanel_class;
AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns, Hashtable* dynamicColumns);
void AvailableColumnsPanel_fill(AvailableColumnsPanel* this, const char* dynamicScreen, Hashtable* dynamicColumns);
#endif
================================================
FILE: AvailableMetersPanel.c
================================================
/*
htop - AvailableMetersPanel.c
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "config.h" // IWYU pragma: keep
#include "AvailableMetersPanel.h"
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include "CPUMeter.h"
#include "DynamicMeter.h"
#include "FunctionBar.h"
#include "Hashtable.h"
#include "Header.h"
#include "ListItem.h"
#include "Macros.h"
#include "Meter.h"
#include "MetersPanel.h"
#include "Object.h"
#include "Platform.h"
#include "ProvideCurses.h"
#include "Settings.h"
#include "XUtils.h"
static void AvailableMetersPanel_delete(Object* object) {
AvailableMetersPanel* this = (AvailableMetersPanel*) object;
free(this->meterPanels);
Panel_done(&this->super);
free(this);
}
static inline void AvailableMetersPanel_addMeter(Header* header, MetersPanel* panel, const MeterClass* type, unsigned int param, size_t column) {
const Meter* meter = Header_addMeterByClass(header, type, param, column);
Panel_add((Panel*)panel, (Object*) Meter_toListItem(meter, false));
Panel_setSelected((Panel*)panel, Panel_size((Panel*)panel) - 1);
MetersPanel_setMoving(panel, true);
}
static HandlerResult AvailableMetersPanel_eventHandler(Panel* super, int ch) {
AvailableMetersPanel* this = (AvailableMetersPanel*) super;
Header* header = this->header;
const ListItem* selected = (ListItem*) Panel_getSelected(super);
if (!selected)
return IGNORED;
unsigned int param = selected->key & 0xffff;
int type = selected->key >> 16;
HandlerResult result = IGNORED;
bool update = false;
switch (ch) {
case KEY_F(5):
case 'l':
case 'L':
AvailableMetersPanel_addMeter(header, this->meterPanels[0], Platform_meterTypes[type], param, 0);
result = HANDLED;
update = true;
break;
case 0x0a:
case 0x0d:
case KEY_ENTER:
case KEY_F(6):
case 'r':
case 'R':
AvailableMetersPanel_addMeter(header, this->meterPanels[this->columns - 1], Platform_meterTypes[type], param, this->columns - 1);
result = (KEY_LEFT << 16) | SYNTH_KEY;
update = true;
break;
}
if (update) {
Settings* settings = this->host->settings;
settings->changed = true;
settings->lastUpdate++;
Header_calculateHeight(header);
Header_updateData(header);
Header_draw(header);
ScreenManager_resize(this->scr);
}
return result;
}
const PanelClass AvailableMetersPanel_class = {
.super = {
.extends = Class(Panel),
.delete = AvailableMetersPanel_delete
},
.eventHandler = AvailableMetersPanel_eventHandler
};
// Handle (&CPUMeter_class) entries in the AvailableMetersPanel
static void AvailableMetersPanel_addCPUMeters(Panel* super, const MeterClass* type, const Machine* host) {
if (host->existingCPUs > 1) {
Panel_add(super, (Object*) ListItem_new("CPU average", 0));
for (unsigned int i = 1; i <= host->existingCPUs; i++) {
char buffer[50];
xSnprintf(buffer, sizeof(buffer), "%s %d", type->uiName, Settings_cpuId(host->settings, i - 1));
Panel_add(super, (Object*) ListItem_new(buffer, i));
}
} else {
Panel_add(super, (Object*) ListItem_new(type->uiName, 1));
}
}
typedef struct {
Panel* super;
unsigned int id;
unsigned int offset;
} DynamicIterator;
static void AvailableMetersPanel_addDynamicMeter(ATTR_UNUSED ht_key_t key, void* value, void* data) {
const DynamicMeter* meter = (const DynamicMeter*)value;
DynamicIterator* iter = (DynamicIterator*)data;
unsigned int identifier = (iter->offset << 16) | iter->id;
const char* label = meter->description ? meter->description : meter->caption;
if (!label)
label = meter->name; /* last fallback to name, guaranteed set */
Panel_add(iter->super, (Object*) ListItem_new(label, identifier));
iter->id++;
}
// Handle (&DynamicMeter_class) entries in the AvailableMetersPanel
static void AvailableMetersPanel_addDynamicMeters(Panel* super, const Settings* settings, unsigned int offset) {
DynamicIterator iter = { .super = super, .id = 1, .offset = offset };
Hashtable* dynamicMeters = settings->dynamicMeters;
assert(dynamicMeters != NULL);
Hashtable_foreach(dynamicMeters, AvailableMetersPanel_addDynamicMeter, &iter);
}
// Handle remaining Platform Meter entries in the AvailableMetersPanel
static void AvailableMetersPanel_addPlatformMeter(Panel* super, const MeterClass* type, unsigned int offset) {
const char* label = type->description ? type->description : type->uiName;
Panel_add(super, (Object*) ListItem_new(label, offset << 16));
}
AvailableMetersPanel* AvailableMetersPanel_new(Machine* host, Header* header, size_t columns, MetersPanel** meterPanels, ScreenManager* scr) {
AvailableMetersPanel* this = AllocThis(AvailableMetersPanel);
Panel* super = &this->super;
FunctionBar* fuBar = FunctionBar_newEnterEsc("Add ", "Done ");
Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar);
this->host = host;
this->header = header;
this->columns = columns;
this->meterPanels = meterPanels;
this->scr = scr;
Panel_setHeader(super, "Available meters");
// Platform_meterTypes[0] should be always (&CPUMeter_class) which we will
// handle separately in the code below. Likewise, identifiers for Dynamic
// Meters are handled separately - similar to CPUs, this allows generation
// of multiple different Meters (also using 'param' to distinguish them).
for (unsigned int i = 1; Platform_meterTypes[i]; i++) {
const MeterClass* type = Platform_meterTypes[i];
assert(type != &CPUMeter_class);
if (type == &DynamicMeter_class)
AvailableMetersPanel_addDynamicMeters(super, host->settings, i);
else
AvailableMetersPanel_addPlatformMeter(super, type, i);
}
AvailableMetersPanel_addCPUMeters(super, &CPUMeter_class, host);
return this;
}
================================================
FILE: AvailableMetersPanel.h
================================================
#ifndef HEADER_AvailableMetersPanel
#define HEADER_AvailableMetersPanel
/*
htop - AvailableMetersPanel.h
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include <stddef.h>
#include "Header.h"
#include "Machine.h"
#include "MetersPanel.h"
#include "Panel.h"
#include "ScreenManager.h"
typedef struct AvailableMetersPanel_ {
Panel super;
ScreenManager* scr;
Machine* host;
Header* header;
size_t columns;
MetersPanel** meterPanels;
} AvailableMetersPanel;
extern const PanelClass AvailableMetersPanel_class;
AvailableMetersPanel* AvailableMetersPanel_new(Machine* host, Header* header, size_t columns, MetersPanel** meterPanels, ScreenManager* scr);
#endif
================================================
FILE: BatteryMeter.c
================================================
/*
htop - BatteryMeter.c
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
*/
#include "config.h" // IWYU pragma: keep
#include "BatteryMeter.h"
#include <math.h>
#include "CRT.h"
#include "Macros.h"
#include "Object.h"
#include "Platform.h"
#include "XUtils.h"
static const int BatteryMeter_attributes[] = {
BATTERY
};
static void BatteryMeter_updateValues(Meter* this) {
ACPresence isOnAC;
double percent;
Platform_getBattery(&percent, &isOnAC);
if (!isNonnegative(percent)) {
this->values[0] = NAN;
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "N/A");
return;
}
this->values[0] = percent;
const char* text;
switch (isOnAC) {
case AC_PRESENT:
text = this->mode == TEXT_METERMODE ? " (Running on A/C)" : "(A/C)";
break;
case AC_ABSENT:
text = this->mode == TEXT_METERMODE ? " (Running on battery)" : "(bat)";
break;
case AC_ERROR:
default:
text = "";
break;
}
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%.1f%%%s", percent, text);
}
const MeterClass BatteryMeter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete
},
.updateValues = BatteryMeter_updateValues,
.defaultMode = TEXT_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.maxItems = 1,
.isPercentChart = true,
.total = 100.0,
.attributes = BatteryMeter_attributes,
.name = "Battery",
.uiName = "Battery",
.caption = "Battery: "
};
================================================
FILE: BatteryMeter.h
================================================
#ifndef HEADER_BatteryMeter
#define HEADER_BatteryMeter
/*
htop - BatteryMeter.h
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
*/
#include "Meter.h"
typedef enum ACPresence_ {
AC_ABSENT,
AC_PRESENT,
AC_ERROR
} ACPresence;
extern const MeterClass BatteryMeter_class;
#endif
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# `htop` Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
<htop-maintainers@groups.io>.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
================================================
FILE: CONTRIBUTING.md
================================================
Contributing Guide
==================
Thank you so much for taking the time to contribute to htop!
Be Kind
-------
We strive for htop to be a welcoming and safe project for all contributors.
Refer to our [code of conduct](CODE_OF_CONDUCT.md) for details.
Issue Tracker
-------------
Bug reports should be posted in the [Github issue
tracker](https://github.com/htop-dev/htop/issues).
Bug reports are extremely important since it's impossible for us to test
htop in every possible system, distribution and scenario. Your feedback
is what keeps the tool stable and always improving - thank you!
Please label Github issues that are feature requests with a `feature request`
label. If you can't do this yourself, don't worry, the friendly folk from the
core team update labels as part of their regular reviews.
Style Guide
-----------
To make working with the code easier a set of guidelines have evolved in
the past that new contributions should try to follow. While they are not set
in stone and always up for changes should the need arise they still provide
a first orientation to go by when contributing to this repository.
The details of the coding style as well as what to take care about with your
contributions can be found in our [style guide](docs/styleguide.md).
Pull Requests
-------------
Code contributions are most welcome! Just [fork the
repo](https://github.com/htop-dev/htop) and send a [pull
request](https://github.com/htop-dev/htop/pulls). Help is especially
appreciated for support of platforms other than Linux. If proposing new
features, please be mindful that htop is a system tool that needs to keep a
small footprint and perform well on systems under stress -- so unfortunately
we can't accept every new feature proposed, as we need to keep the tool slim
and maintainable. Great ideas backed by a PR are always carefully considered
for inclusion though! Also, PRs containing bug fixes and portability tweaks
are always included, please send those in!
Use of AI
---------
You are welcome to use whatever tools work best for you, which includes use
of AI tools to assist with developing htop. AI tools have proven invaluable
as learning aids for new contributors, helped to identify problematic code,
and have been used to fill cross-platform knowledge gaps.
With great power comes great responsibility. Please ensure you review and
understand any changes made by tools you use before opening pull requests.
Be aware that AI tools may generate content which is an exact copy of code
from another project - only propose code for inclusion in htop that meets
the copyright and licensing requirements of the project.
To assist the maintainers please always acknowledge any use of AI tools as
part of your work. Use of `Co-authored-by:` clauses is highly recommended.
================================================
FILE: COPYING
================================================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
================================================
FILE: CPUMeter.c
================================================
/*
htop - CPUMeter.c
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "config.h" // IWYU pragma: keep
#include "CPUMeter.h"
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "CRT.h"
#include "Machine.h"
#include "Macros.h"
#include "Object.h"
#include "Platform.h"
#include "RichString.h"
#include "Settings.h"
#include "XUtils.h"
static const int CPUMeter_attributes[] = {
CPU_NICE,
CPU_NORMAL,
CPU_SYSTEM,
CPU_IRQ,
CPU_SOFTIRQ,
CPU_STEAL,
CPU_GUEST,
CPU_IOWAIT
};
static const int CPUMeter_attributes_summary[] = {
CPU_NICE,
CPU_NORMAL,
CPU_SYSTEM,
CPU_GUEST
};
typedef struct CPUMeterData_ {
unsigned int cpus;
Meter** meters;
} CPUMeterData;
static void CPUMeter_init(Meter* this) {
unsigned int cpu = this->param;
const Machine* host = this->host;
if (cpu == 0) {
Meter_setCaption(this, "Avg");
} else if (host->activeCPUs > 1) {
char caption[10];
xSnprintf(caption, sizeof(caption), "%3u", Settings_cpuId(host->settings, cpu - 1));
Meter_setCaption(this, caption);
}
}
// Custom uiName runtime logic to include the param (processor)
static void CPUMeter_getUiName(const Meter* this, char* buffer, size_t length) {
assert(length > 0);
if (this->param > 0)
xSnprintf(buffer, length, "%s %u", Meter_uiName(this), this->param);
else
xSnprintf(buffer, length, "%s", Meter_uiName(this));
}
static void CPUMeter_updateValues(Meter* this) {
memset(this->values, 0, sizeof(double) * CPU_METER_ITEMCOUNT);
const Machine* host = this->host;
const Settings* settings = host->settings;
if (settings->detailedCPUTime) {
this->curAttributes = CPUMeter_attributes;
} else {
this->curAttributes = CPUMeter_attributes_summary;
}
unsigned int cpu = this->param;
if (cpu > host->existingCPUs) {
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "absent");
return;
}
double percent = Platform_setCPUValues(this, cpu);
if (!isNonnegative(percent)) {
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "offline");
return;
}
char cpuUsageBuffer[8] = { 0 };
char cpuFrequencyBuffer[16] = { 0 };
char cpuTemperatureBuffer[16] = { 0 };
if (settings->showCPUUsage) {
xSnprintf(cpuUsageBuffer, sizeof(cpuUsageBuffer), "%.1f%%", percent);
}
if (settings->showCPUFrequency) {
double cpuFrequency = this->values[CPU_METER_FREQUENCY];
if (isNonnegative(cpuFrequency)) {
xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "%4uMHz", (unsigned)cpuFrequency);
} else {
xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "N/A");
}
}
#ifdef BUILD_WITH_CPU_TEMP
if (settings->showCPUTemperature) {
double cpuTemperature = this->values[CPU_METER_TEMPERATURE];
if (isNaN(cpuTemperature))
xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "N/A");
else if (settings->degreeFahrenheit)
xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "%3d%sF", (int)(cpuTemperature * 9 / 5 + 32), CRT_degreeSign);
else
xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "%d%sC", (int)cpuTemperature, CRT_degreeSign);
}
#endif
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%s%s%s%s%s",
cpuUsageBuffer,
(cpuUsageBuffer[0] && (cpuFrequencyBuffer[0] || cpuTemperatureBuffer[0])) ? " " : "",
cpuFrequencyBuffer,
(cpuFrequencyBuffer[0] && cpuTemperatureBuffer[0]) ? " " : "",
cpuTemperatureBuffer);
}
static void CPUMeter_display(const Object* cast, RichString* out) {
char buffer[50];
int len;
const Meter* this = (const Meter*)cast;
const Machine* host = this->host;
const Settings* settings = host->settings;
if (this->param > host->existingCPUs) {
RichString_appendAscii(out, CRT_colors[METER_SHADOW], " absent");
return;
}
if (this->curItems == 0) {
RichString_appendAscii(out, CRT_colors[METER_SHADOW], " offline");
return;
}
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NORMAL]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], ":");
RichString_appendnAscii(out, CRT_colors[CPU_NORMAL], buffer, len);
if (settings->detailedCPUTime) {
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_KERNEL]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], "sy:");
RichString_appendnAscii(out, CRT_colors[CPU_SYSTEM], buffer, len);
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NICE]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], "ni:");
RichString_appendnAscii(out, CRT_colors[CPU_NICE_TEXT], buffer, len);
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_IRQ]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], "hi:");
RichString_appendnAscii(out, CRT_colors[CPU_IRQ], buffer, len);
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_SOFTIRQ]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], "si:");
RichString_appendnAscii(out, CRT_colors[CPU_SOFTIRQ], buffer, len);
if (isNonnegative(this->values[CPU_METER_STEAL])) {
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_STEAL]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], "st:");
RichString_appendnAscii(out, CRT_colors[CPU_STEAL], buffer, len);
}
if (isNonnegative(this->values[CPU_METER_GUEST])) {
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_GUEST]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], "gu:");
RichString_appendnAscii(out, CRT_colors[CPU_GUEST], buffer, len);
}
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_IOWAIT]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], "wa:");
RichString_appendnAscii(out, CRT_colors[CPU_IOWAIT], buffer, len);
} else {
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_KERNEL]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], "sys:");
RichString_appendnAscii(out, CRT_colors[CPU_SYSTEM], buffer, len);
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_NICE]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], "low:");
RichString_appendnAscii(out, CRT_colors[CPU_NICE_TEXT], buffer, len);
if (isNonnegative(this->values[CPU_METER_IRQ])) {
len = xSnprintf(buffer, sizeof(buffer), "%5.1f%% ", this->values[CPU_METER_IRQ]);
RichString_appendAscii(out, CRT_colors[METER_TEXT], "vir:");
RichString_appendnAscii(out, CRT_colors[CPU_GUEST], buffer, len);
}
}
if (settings->showCPUFrequency) {
char cpuFrequencyBuffer[10];
double cpuFrequency = this->values[CPU_METER_FREQUENCY];
if (isNonnegative(cpuFrequency)) {
len = xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "%4uMHz ", (unsigned)cpuFrequency);
} else {
len = xSnprintf(cpuFrequencyBuffer, sizeof(cpuFrequencyBuffer), "N/A ");
}
RichString_appendAscii(out, CRT_colors[METER_TEXT], "freq: ");
RichString_appendnWide(out, CRT_colors[METER_VALUE], cpuFrequencyBuffer, len);
}
#ifdef BUILD_WITH_CPU_TEMP
if (settings->showCPUTemperature) {
char cpuTemperatureBuffer[10];
double cpuTemperature = this->values[CPU_METER_TEMPERATURE];
if (isNaN(cpuTemperature)) {
len = xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "N/A");
} else if (settings->degreeFahrenheit) {
len = xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "%5.1f%sF", cpuTemperature * 9 / 5 + 32, CRT_degreeSign);
} else {
len = xSnprintf(cpuTemperatureBuffer, sizeof(cpuTemperatureBuffer), "%5.1f%sC", cpuTemperature, CRT_degreeSign);
}
RichString_appendAscii(out, CRT_colors[METER_TEXT], "temp:");
RichString_appendnWide(out, CRT_colors[METER_VALUE], cpuTemperatureBuffer, len);
}
#endif
}
static void AllCPUsMeter_getRange(const Meter* this, int* start, int* count) {
unsigned int cpus = this->host->existingCPUs;
switch (Meter_name(this)[0]) {
default:
case 'A': // All
*start = 0;
*count = cpus;
break;
case 'L': // First Half
*start = 0;
*count = (cpus + 1) / 2;
break;
case 'R': // Second Half
*start = (cpus + 1) / 2;
*count = cpus - *start;
break;
}
}
static void AllCPUsMeter_updateValues(Meter* this) {
CPUMeterData* data = this->meterData;
Meter** meters = data->meters;
int start, count;
AllCPUsMeter_getRange(this, &start, &count);
for (int i = 0; i < count; i++)
Meter_updateValues(meters[i]);
}
static void CPUMeterCommonInit(Meter* this) {
int start, count;
AllCPUsMeter_getRange(this, &start, &count);
CPUMeterData* data = this->meterData;
if (!data) {
data = xCalloc(1, sizeof(CPUMeterData));
data->cpus = this->host->existingCPUs;
data->meters = count ? xCalloc(count, sizeof(Meter*)) : NULL;
this->meterData = data;
}
Meter** meters = data->meters;
for (int i = 0; i < count; i++) {
if (!meters[i])
meters[i] = Meter_new(this->host, start + i + 1, (const MeterClass*) Class(CPUMeter));
Meter_init(meters[i]);
}
}
static void CPUMeterCommonUpdateMode(Meter* this, MeterModeId mode, int ncol) {
CPUMeterData* data = this->meterData;
Meter** meters = data->meters;
this->mode = mode;
int start, count;
AllCPUsMeter_getRange(this, &start, &count);
if (!count) {
this->h = 1;
return;
}
for (int i = 0; i < count; i++) {
Meter_setMode(meters[i], mode);
}
int h = meters[0]->h;
assert(h > 0);
this->h = h * ((count + ncol - 1) / ncol);
}
static void AllCPUsMeter_done(Meter* this) {
CPUMeterData* data = this->meterData;
Meter** meters = data->meters;
int start, count;
AllCPUsMeter_getRange(this, &start, &count);
for (int i = 0; i < count; i++)
Meter_delete((Object*)meters[i]);
free(data->meters);
free(data);
}
static void SingleColCPUsMeter_updateMode(Meter* this, MeterModeId mode) {
CPUMeterCommonUpdateMode(this, mode, 1);
}
static void DualColCPUsMeter_updateMode(Meter* this, MeterModeId mode) {
CPUMeterCommonUpdateMode(this, mode, 2);
}
static void QuadColCPUsMeter_updateMode(Meter* this, MeterModeId mode) {
CPUMeterCommonUpdateMode(this, mode, 4);
}
static void OctoColCPUsMeter_updateMode(Meter* this, MeterModeId mode) {
CPUMeterCommonUpdateMode(this, mode, 8);
}
static void CPUMeterCommonDraw(Meter* this, int x, int y, int w, int ncol) {
CPUMeterData* data = this->meterData;
Meter** meters = data->meters;
int start, count;
AllCPUsMeter_getRange(this, &start, &count);
int colwidth = w / ncol;
int diff = w % ncol;
int nrows = (count + ncol - 1) / ncol;
for (int i = 0; i < count; i++) {
int d = (i / nrows) > diff ? diff : (i / nrows); // dynamic spacer
int xpos = x + ((i / nrows) * colwidth) + d;
int ypos = y + ((i % nrows) * meters[0]->h);
meters[i]->draw(meters[i], xpos, ypos, colwidth);
}
}
static void DualColCPUsMeter_draw(Meter* this, int x, int y, int w) {
CPUMeterCommonDraw(this, x, y, w, 2);
}
static void QuadColCPUsMeter_draw(Meter* this, int x, int y, int w) {
CPUMeterCommonDraw(this, x, y, w, 4);
}
static void OctoColCPUsMeter_draw(Meter* this, int x, int y, int w) {
CPUMeterCommonDraw(this, x, y, w, 8);
}
static void SingleColCPUsMeter_draw(Meter* this, int x, int y, int w) {
CPUMeterData* data = this->meterData;
Meter** meters = data->meters;
int start, count;
AllCPUsMeter_getRange(this, &start, &count);
for (int i = 0; i < count; i++) {
meters[i]->draw(meters[i], x, y, w);
y += meters[i]->h;
}
}
const MeterClass CPUMeter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = CPUMeter_updateValues,
.getUiName = CPUMeter_getUiName,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.maxItems = CPU_METER_ITEMCOUNT,
.isPercentChart = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "CPU",
.uiName = "CPU",
.caption = "CPU",
.init = CPUMeter_init
};
const MeterClass AllCPUsMeter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "AllCPUs",
.uiName = "CPUs (1/1)",
.description = "CPUs (1/1): all CPUs",
.caption = "CPU",
.draw = SingleColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = SingleColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass AllCPUs2Meter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "AllCPUs2",
.uiName = "CPUs (1&2/2)",
.description = "CPUs (1&2/2): all CPUs in 2 shorter columns",
.caption = "CPU",
.draw = DualColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = DualColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass LeftCPUsMeter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "LeftCPUs",
.uiName = "CPUs (1/2)",
.description = "CPUs (1/2): first half of list",
.caption = "CPU",
.draw = SingleColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = SingleColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass RightCPUsMeter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "RightCPUs",
.uiName = "CPUs (2/2)",
.description = "CPUs (2/2): second half of list",
.caption = "CPU",
.draw = SingleColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = SingleColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass LeftCPUs2Meter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "LeftCPUs2",
.uiName = "CPUs (1&2/4)",
.description = "CPUs (1&2/4): first half in 2 shorter columns",
.caption = "CPU",
.draw = DualColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = DualColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass RightCPUs2Meter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "RightCPUs2",
.uiName = "CPUs (3&4/4)",
.description = "CPUs (3&4/4): second half in 2 shorter columns",
.caption = "CPU",
.draw = DualColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = DualColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass AllCPUs4Meter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "AllCPUs4",
.uiName = "CPUs (1&2&3&4/4)",
.description = "CPUs (1&2&3&4/4): all CPUs in 4 shorter columns",
.caption = "CPU",
.draw = QuadColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = QuadColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass LeftCPUs4Meter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "LeftCPUs4",
.uiName = "CPUs (1-4/8)",
.description = "CPUs (1-4/8): first half in 4 shorter columns",
.caption = "CPU",
.draw = QuadColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = QuadColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass RightCPUs4Meter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "RightCPUs4",
.uiName = "CPUs (5-8/8)",
.description = "CPUs (5-8/8): second half in 4 shorter columns",
.caption = "CPU",
.draw = QuadColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = QuadColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass AllCPUs8Meter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "AllCPUs8",
.uiName = "CPUs (1-8/8)",
.description = "CPUs (1-8/8): all CPUs in 8 shorter columns",
.caption = "CPU",
.draw = OctoColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = OctoColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass LeftCPUs8Meter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "LeftCPUs8",
.uiName = "CPUs (1-8/16)",
.description = "CPUs (1-8/16): first half in 8 shorter columns",
.caption = "CPU",
.draw = OctoColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = OctoColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
const MeterClass RightCPUs8Meter_class = {
.super = {
.extends = Class(Meter),
.delete = Meter_delete,
.display = CPUMeter_display
},
.updateValues = AllCPUsMeter_updateValues,
.defaultMode = BAR_METERMODE,
.supportedModes = METERMODE_DEFAULT_SUPPORTED,
.isMultiColumn = true,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "RightCPUs8",
.uiName = "CPUs (9-16/16)",
.description = "CPUs (9-16/16): second half in 8 shorter columns",
.caption = "CPU",
.draw = OctoColCPUsMeter_draw,
.init = CPUMeterCommonInit,
.updateMode = OctoColCPUsMeter_updateMode,
.done = AllCPUsMeter_done
};
================================================
FILE: CPUMeter.h
================================================
#ifndef HEADER_CPUMeter
#define HEADER_CPUMeter
/*
htop - CPUMeter.h
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "Meter.h"
typedef enum {
CPU_METER_NICE = 0,
CPU_METER_NORMAL = 1,
CPU_METER_KERNEL = 2,
CPU_METER_IRQ = 3,
CPU_METER_SOFTIRQ = 4,
CPU_METER_STEAL = 5,
CPU_METER_GUEST = 6,
CPU_METER_IOWAIT = 7,
CPU_METER_FREQUENCY = 8,
CPU_METER_TEMPERATURE = 9,
CPU_METER_ITEMCOUNT = 10, // number of entries in this enum
} CPUMeterValues;
extern const MeterClass CPUMeter_class;
extern const MeterClass AllCPUsMeter_class;
extern const MeterClass AllCPUs2Meter_class;
extern const MeterClass LeftCPUsMeter_class;
extern const MeterClass RightCPUsMeter_class;
extern const MeterClass LeftCPUs2Meter_class;
extern const MeterClass RightCPUs2Meter_class;
extern const MeterClass AllCPUs4Meter_class;
extern const MeterClass LeftCPUs4Meter_class;
extern const MeterClass RightCPUs4Meter_class;
extern const MeterClass AllCPUs8Meter_class;
extern const MeterClass LeftCPUs8Meter_class;
extern const MeterClass RightCPUs8Meter_class;
#endif
================================================
FILE: CRT.c
================================================
/*
htop - CRT.c
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include "config.h" // IWYU pragma: keep
#include "CRT.h"
#include <errno.h>
#include <fcntl.h>
#include <langinfo.h>
#include <limits.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h> // IWYU pragma: keep
#include "CommandLine.h"
#include "ProvideCurses.h"
#include "ProvideTerm.h"
#include "XUtils.h"
#if !defined(NDEBUG) && defined(HAVE_MEMFD_CREATE)
#include <sys/mman.h>
#endif
#if defined(HAVE_LIBUNWIND_H) && defined(HAVE_LOCAL_UNWIND)
# define PRINT_BACKTRACE
# define UNW_LOCAL_ONLY
# include <libunwind.h>
# if defined(HAVE_DLADDR)
# include <dlfcn.h>
# endif
#elif defined(HAVE_EXECINFO_H) && defined(BACKTRACE_RETURN_TYPE)
# define PRINT_BACKTRACE
# include <execinfo.h>
#endif
#define ColorIndex(i,j) ((7-(i))*8+(j))
#define ColorPair(i,j) COLOR_PAIR(ColorIndex(i,j))
#define Black COLOR_BLACK
#define Red COLOR_RED
#define Green COLOR_GREEN
#define Yellow COLOR_YELLOW
#define Blue COLOR_BLUE
#define Magenta COLOR_MAGENTA
#define Cyan COLOR_CYAN
#define White COLOR_WHITE
#define ColorPairGrayBlack ColorPair(Magenta,Magenta)
#define ColorIndexGrayBlack ColorIndex(Magenta,Magenta)
#define ColorPairWhiteDefault ColorPair(Red, Red)
#define ColorIndexWhiteDefault ColorIndex(Red, Red)
static const char* const CRT_treeStrAscii[LAST_TREE_STR] = {
[TREE_STR_VERT] = "|",
[TREE_STR_RTEE] = "`",
[TREE_STR_BEND] = "`",
[TREE_STR_TEND] = ",",
[TREE_STR_OPEN] = "+",
[TREE_STR_SHUT] = "-",
[TREE_STR_ASC] = "+",
[TREE_STR_DESC] = "-",
};
#ifdef HAVE_LIBNCURSESW
static const char* const CRT_treeStrUtf8[LAST_TREE_STR] = {
[TREE_STR_VERT] = "\xe2\x94\x82", // │
[TREE_STR_RTEE] = "\xe2\x94\x9c", // ├
[TREE_STR_BEND] = "\xe2\x94\x94", // └
[TREE_STR_TEND] = "\xe2\x94\x8c", // ┌
[TREE_STR_OPEN] = "+", // +, TODO use 🮯 'BOX DRAWINGS LIGHT HORIZONTAL
// WITH VERTICAL STROKE' (U+1FBAF, "\xf0\x9f\xae\xaf") when
// Unicode 13 is common
[TREE_STR_SHUT] = "\xe2\x94\x80", // ─
[TREE_STR_ASC] = "\xe2\x96\xb3", // △
[TREE_STR_DESC] = "\xe2\x96\xbd", // ▽
};
bool CRT_utf8 = false;
#endif
const char* const* CRT_treeStr = CRT_treeStrAscii;
static const Settings* CRT_settings;
#ifdef HAVE_LIBNCURSESW
# if MB_LEN_MAX >= 3 // Minimum required to support UTF-8 BMP subset
char CRT_degreeSign[MB_LEN_MAX * 2] = "\xc2\xb0";
# else
char CRT_degreeSign[MB_LEN_MAX * 2] = "";
# endif
#else
char CRT_degreeSign[] = "";
#endif
static void initDegreeSign(void) {
#ifdef HAVE_LIBNCURSESW
# if MB_LEN_MAX >= 3
if (CRT_utf8)
return;
# endif
// this might fail if the current locale does not support wide characters
int r = snprintf(CRT_degreeSign, sizeof(CRT_degreeSign), "%lc", 176);
if (r <= 0 || (size_t)r >= sizeof(CRT_degreeSign))
CRT_degreeSign[0] = '\0';
#endif
// No-op
return;
}
const int* CRT_colors;
static int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
[COLORSCHEME_DEFAULT] = {
[RESET_COLOR] = ColorPair(White, Black),
[DEFAULT_COLOR] = ColorPair(White, Black),
[FUNCTION_BAR] = ColorPair(Black, Cyan),
[FUNCTION_KEY] = ColorPair(White, Black),
[PANEL_HEADER_FOCUS] = ColorPair(Black, Green),
[PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green),
[PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan),
[PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow),
[PANEL_SELECTION_UNFOCUS] = ColorPair(Black, White),
[FAILED_SEARCH] = ColorPair(Red, Cyan),
[FAILED_READ] = A_BOLD | ColorPair(Red, Black),
[PAUSED] = A_BOLD | ColorPair(Yellow, Cyan),
[UPTIME] = A_BOLD | ColorPair(Cyan, Black),
[BATTERY] = A_BOLD | ColorPair(Cyan, Black),
[LARGE_NUMBER] = A_BOLD | ColorPair(Red, Black),
[METER_SHADOW] = A_BOLD | ColorPairGrayBlack,
[METER_TEXT] = ColorPair(Cyan, Black),
[METER_VALUE] = A_BOLD | ColorPair(Cyan, Black),
[METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Black),
[METER_VALUE_IOREAD] = ColorPair(Green, Black),
[METER_VALUE_IOWRITE] = A_BOLD | ColorPair(Blue, Black),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(White, Black),
[METER_VALUE_OK] = ColorPair(Green, Black),
[METER_VALUE_WARN] = A_BOLD | ColorPair(Yellow, Black),
[LED_COLOR] = ColorPair(Green, Black),
[TASKS_RUNNING] = A_BOLD | ColorPair(Green, Black),
[PROCESS] = A_NORMAL,
[PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack,
[PROCESS_TAG] = A_BOLD | ColorPair(Yellow, Black),
[PROCESS_MEGABYTES] = ColorPair(Cyan, Black),
[PROCESS_GIGABYTES] = ColorPair(Green, Black),
[PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan, Black),
[PROCESS_TREE] = ColorPair(Cyan, Black),
[PROCESS_RUN_STATE] = ColorPair(Green, Black),
[PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Black),
[PROCESS_HIGH_PRIORITY] = ColorPair(Red, Black),
[PROCESS_LOW_PRIORITY] = ColorPair(Green, Black),
[PROCESS_NEW] = ColorPair(Black, Green),
[PROCESS_TOMB] = ColorPair(Black, Red),
[PROCESS_THREAD] = ColorPair(Green, Black),
[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green, Black),
[PROCESS_COMM] = ColorPair(Magenta, Black),
[PROCESS_THREAD_COMM] = A_BOLD | ColorPair(Blue, Black),
[PROCESS_PRIV] = ColorPair(Magenta, Black),
[BAR_BORDER] = A_BOLD,
[BAR_SHADOW] = A_BOLD | ColorPairGrayBlack,
[SWAP] = ColorPair(Red, Black),
[SWAP_CACHE] = ColorPair(Yellow, Black),
[SWAP_FRONTSWAP] = A_BOLD | ColorPairGrayBlack,
[GRAPH_1] = A_BOLD | ColorPair(Cyan, Black),
[GRAPH_2] = ColorPair(Cyan, Black),
[MEMORY_1] = ColorPair(Green, Black),
[MEMORY_2] = ColorPair(Magenta, Black),
[MEMORY_3] = A_BOLD | ColorPairGrayBlack,
[MEMORY_4] = A_BOLD | ColorPair(Blue, Black),
[MEMORY_5] = ColorPair(Yellow, Black),
[MEMORY_6] = ColorPair(Cyan, Black),
[HUGEPAGE_1] = ColorPair(Green, Black),
[HUGEPAGE_2] = ColorPair(Yellow, Black),
[HUGEPAGE_3] = ColorPair(Red, Black),
[HUGEPAGE_4] = A_BOLD | ColorPair(Blue, Black),
[LOAD_AVERAGE_FIFTEEN] = ColorPair(Cyan, Black),
[LOAD_AVERAGE_FIVE] = A_BOLD | ColorPair(Cyan, Black),
[LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White, Black),
[LOAD] = A_BOLD,
[HELP_BOLD] = A_BOLD | ColorPair(Cyan, Black),
[HELP_SHADOW] = A_BOLD | ColorPairGrayBlack,
[CLOCK] = A_BOLD,
[DATE] = A_BOLD,
[DATETIME] = A_BOLD,
[CHECK_BOX] = ColorPair(Cyan, Black),
[CHECK_MARK] = A_BOLD,
[CHECK_TEXT] = A_NORMAL,
[HOSTNAME] = A_BOLD,
[CPU_NICE] = A_BOLD | ColorPair(Blue, Black),
[CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue, Black),
[CPU_NORMAL] = ColorPair(Green, Black),
[CPU_SYSTEM] = ColorPair(Red, Black),
[CPU_IOWAIT] = A_BOLD | ColorPairGrayBlack,
[CPU_IRQ] = ColorPair(Yellow, Black),
[CPU_SOFTIRQ] = ColorPair(Magenta, Black),
[CPU_STEAL] = ColorPair(Cyan, Black),
[CPU_GUEST] = ColorPair(Cyan, Black),
[GPU_ENGINE_1] = ColorPair(Green, Black),
[GPU_ENGINE_2] = ColorPair(Yellow, Black),
[GPU_ENGINE_3] = ColorPair(Red, Black),
[GPU_ENGINE_4] = A_BOLD | ColorPair(Blue, Black),
[GPU_RESIDUE] = ColorPair(Magenta, Black),
[PANEL_EDIT] = ColorPair(White, Blue),
[SCREENS_OTH_BORDER] = ColorPair(Blue, Blue),
[SCREENS_OTH_TEXT] = ColorPair(Black, Blue),
[SCREENS_CUR_BORDER] = ColorPair(Green, Green),
[SCREENS_CUR_TEXT] = ColorPair(Black, Green),
[PRESSURE_STALL_THREEHUNDRED] = ColorPair(Cyan, Black),
[PRESSURE_STALL_SIXTY] = A_BOLD | ColorPair(Cyan, Black),
[PRESSURE_STALL_TEN] = A_BOLD | ColorPair(White, Black),
[FILE_DESCRIPTOR_USED] = ColorPair(Green, Black),
[FILE_DESCRIPTOR_MAX] = A_BOLD | ColorPair(Blue, Black),
[ZFS_MFU] = A_BOLD | ColorPair(Blue, Black),
[ZFS_MRU] = ColorPair(Yellow, Black),
[ZFS_ANON] = ColorPair(Magenta, Black),
[ZFS_HEADER] = ColorPair(Cyan, Black),
[ZFS_OTHER] = ColorPair(Magenta, Black),
[ZFS_COMPRESSED] = A_BOLD | ColorPair(Blue, Black),
[ZFS_RATIO] = ColorPair(Magenta, Black),
[ZRAM_COMPRESSED] = A_BOLD | ColorPair(Blue, Black),
[ZRAM_UNCOMPRESSED] = ColorPair(Yellow, Black),
[DYNAMIC_GRAY] = ColorPairGrayBlack,
[DYNAMIC_DARKGRAY] = A_BOLD | ColorPairGrayBlack,
[DYNAMIC_RED] = ColorPair(Red, Black),
[DYNAMIC_GREEN] = ColorPair(Green, Black),
[DYNAMIC_BLUE] = A_BOLD | ColorPair(Blue, Black),
[DYNAMIC_CYAN] = ColorPair(Cyan, Black),
[DYNAMIC_MAGENTA] = ColorPair(Magenta, Black),
[DYNAMIC_YELLOW] = ColorPair(Yellow, Black),
[DYNAMIC_WHITE] = ColorPair(White, Black),
},
[COLORSCHEME_MONOCHROME] = {
[RESET_COLOR] = A_NORMAL,
[DEFAULT_COLOR] = A_NORMAL,
[FUNCTION_BAR] = A_REVERSE,
[FUNCTION_KEY] = A_NORMAL,
[PANEL_HEADER_FOCUS] = A_REVERSE,
[PANEL_HEADER_UNFOCUS] = A_REVERSE,
[PANEL_SELECTION_FOCUS] = A_REVERSE,
[PANEL_SELECTION_FOLLOW] = A_REVERSE,
[PANEL_SELECTION_UNFOCUS] = A_BOLD,
[FAILED_SEARCH] = A_REVERSE | A_BOLD,
[FAILED_READ] = A_BOLD,
[PAUSED] = A_BOLD | A_REVERSE,
[UPTIME] = A_BOLD,
[BATTERY] = A_BOLD,
[LARGE_NUMBER] = A_BOLD,
[METER_SHADOW] = A_DIM,
[METER_TEXT] = A_NORMAL,
[METER_VALUE] = A_BOLD,
[METER_VALUE_ERROR] = A_BOLD,
[METER_VALUE_IOREAD] = A_NORMAL,
[METER_VALUE_IOWRITE] = A_NORMAL,
[METER_VALUE_NOTICE] = A_BOLD,
[METER_VALUE_OK] = A_NORMAL,
[METER_VALUE_WARN] = A_BOLD,
[LED_COLOR] = A_NORMAL,
[TASKS_RUNNING] = A_BOLD,
[PROCESS] = A_NORMAL,
[PROCESS_SHADOW] = A_DIM,
[PROCESS_TAG] = A_BOLD,
[PROCESS_MEGABYTES] = A_BOLD,
[PROCESS_GIGABYTES] = A_BOLD,
[PROCESS_BASENAME] = A_BOLD,
[PROCESS_TREE] = A_BOLD,
[PROCESS_RUN_STATE] = A_BOLD,
[PROCESS_D_STATE] = A_BOLD,
[PROCESS_HIGH_PRIORITY] = A_BOLD,
[PROCESS_LOW_PRIORITY] = A_DIM,
[PROCESS_NEW] = A_BOLD,
[PROCESS_TOMB] = A_DIM,
[PROCESS_THREAD] = A_BOLD,
[PROCESS_THREAD_BASENAME] = A_REVERSE,
[PROCESS_COMM] = A_BOLD,
[PROCESS_THREAD_COMM] = A_REVERSE,
[PROCESS_PRIV] = A_BOLD,
[BAR_BORDER] = A_BOLD,
[BAR_SHADOW] = A_DIM,
[SWAP] = A_BOLD,
[SWAP_CACHE] = A_NORMAL,
[SWAP_FRONTSWAP] = A_DIM,
[GRAPH_1] = A_BOLD,
[GRAPH_2] = A_NORMAL,
[MEMORY_1] = A_BOLD,
[MEMORY_2] = A_NORMAL,
[MEMORY_3] = A_NORMAL,
[MEMORY_4] = A_NORMAL,
[MEMORY_5] = A_DIM,
[MEMORY_6] = A_NORMAL,
[HUGEPAGE_1] = A_BOLD,
[HUGEPAGE_2] = A_NORMAL,
[HUGEPAGE_3] = A_REVERSE | A_BOLD,
[HUGEPAGE_4] = A_REVERSE,
[LOAD_AVERAGE_FIFTEEN] = A_DIM,
[LOAD_AVERAGE_FIVE] = A_NORMAL,
[LOAD_AVERAGE_ONE] = A_BOLD,
[LOAD] = A_BOLD,
[HELP_BOLD] = A_BOLD,
[HELP_SHADOW] = A_DIM,
[CLOCK] = A_BOLD,
[DATE] = A_BOLD,
[DATETIME] = A_BOLD,
[CHECK_BOX] = A_BOLD,
[CHECK_MARK] = A_NORMAL,
[CHECK_TEXT] = A_NORMAL,
[HOSTNAME] = A_BOLD,
[CPU_NICE] = A_NORMAL,
[CPU_NICE_TEXT] = A_NORMAL,
[CPU_NORMAL] = A_BOLD,
[CPU_SYSTEM] = A_BOLD,
[CPU_IOWAIT] = A_NORMAL,
[CPU_IRQ] = A_BOLD,
[CPU_SOFTIRQ] = A_BOLD,
[CPU_STEAL] = A_DIM,
[CPU_GUEST] = A_DIM,
[GPU_ENGINE_1] = A_BOLD,
[GPU_ENGINE_2] = A_NORMAL,
[GPU_ENGINE_3] = A_REVERSE | A_BOLD,
[GPU_ENGINE_4] = A_REVERSE,
[GPU_RESIDUE] = A_BOLD,
[PANEL_EDIT] = A_BOLD,
[SCREENS_OTH_BORDER] = A_DIM,
[SCREENS_OTH_TEXT] = A_DIM,
[SCREENS_CUR_BORDER] = A_REVERSE,
[SCREENS_CUR_TEXT] = A_REVERSE,
[PRESSURE_STALL_THREEHUNDRED] = A_DIM,
[PRESSURE_STALL_SIXTY] = A_NORMAL,
[PRESSURE_STALL_TEN] = A_BOLD,
[FILE_DESCRIPTOR_USED] = A_BOLD,
[FILE_DESCRIPTOR_MAX] = A_BOLD,
[ZFS_MFU] = A_NORMAL,
[ZFS_MRU] = A_NORMAL,
[ZFS_ANON] = A_DIM,
[ZFS_HEADER] = A_BOLD,
[ZFS_OTHER] = A_DIM,
[ZFS_COMPRESSED] = A_BOLD,
[ZFS_RATIO] = A_BOLD,
[ZRAM_COMPRESSED] = A_NORMAL,
[ZRAM_UNCOMPRESSED] = A_NORMAL,
[DYNAMIC_GRAY] = A_DIM,
[DYNAMIC_DARKGRAY] = A_DIM,
[DYNAMIC_RED] = A_BOLD,
[DYNAMIC_GREEN] = A_NORMAL,
[DYNAMIC_BLUE] = A_NORMAL,
[DYNAMIC_CYAN] = A_BOLD,
[DYNAMIC_MAGENTA] = A_NORMAL,
[DYNAMIC_YELLOW] = A_NORMAL,
[DYNAMIC_WHITE] = A_BOLD,
},
[COLORSCHEME_BLACKONWHITE] = {
[RESET_COLOR] = ColorPair(Black, White),
[DEFAULT_COLOR] = ColorPair(Black, White),
[FUNCTION_BAR] = ColorPair(Black, Cyan),
[FUNCTION_KEY] = ColorPair(Black, White),
[PANEL_HEADER_FOCUS] = ColorPair(Black, Green),
[PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green),
[PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan),
[PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow),
[PANEL_SELECTION_UNFOCUS] = ColorPair(Blue, White),
[FAILED_SEARCH] = ColorPair(Red, Cyan),
[FAILED_READ] = ColorPair(Red, White),
[PAUSED] = A_BOLD | ColorPair(Yellow, Cyan),
[UPTIME] = ColorPair(Yellow, White),
[BATTERY] = ColorPair(Yellow, White),
[LARGE_NUMBER] = ColorPair(Red, White),
[METER_SHADOW] = ColorPair(Blue, White),
[METER_TEXT] = ColorPair(Blue, White),
[METER_VALUE] = ColorPair(Black, White),
[METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, White),
[METER_VALUE_IOREAD] = ColorPair(Green, White),
[METER_VALUE_IOWRITE] = ColorPair(Yellow, White),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow, White),
[METER_VALUE_OK] = ColorPair(Green, White),
[METER_VALUE_WARN] = A_BOLD | ColorPair(Yellow, White),
[LED_COLOR] = ColorPair(Green, White),
[TASKS_RUNNING] = ColorPair(Green, White),
[PROCESS] = ColorPair(Black, White),
[PROCESS_SHADOW] = A_BOLD | ColorPair(Black, White),
[PROCESS_TAG] = ColorPair(White, Blue),
[PROCESS_MEGABYTES] = ColorPair(Blue, White),
[PROCESS_GIGABYTES] = ColorPair(Green, White),
[PROCESS_BASENAME] = ColorPair(Blue, White),
[PROCESS_TREE] = ColorPair(Green, White),
[PROCESS_RUN_STATE] = ColorPair(Green, White),
[PROCESS_D_STATE] = A_BOLD | ColorPair(Red, White),
[PROCESS_HIGH_PRIORITY] = ColorPair(Red, White),
[PROCESS_LOW_PRIORITY] = ColorPair(Green, White),
[PROCESS_NEW] = ColorPair(White, Green),
[PROCESS_TOMB] = ColorPair(White, Red),
[PROCESS_THREAD] = ColorPair(Blue, White),
[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue, White),
[PROCESS_COMM] = ColorPair(Magenta, White),
[PROCESS_THREAD_COMM] = ColorPair(Green, White),
[PROCESS_PRIV] = ColorPair(Magenta, White),
[BAR_BORDER] = ColorPair(Blue, White),
[BAR_SHADOW] = ColorPair(Black, White),
[SWAP] = ColorPair(Red, White),
[SWAP_CACHE] = ColorPair(Yellow, White),
[SWAP_FRONTSWAP] = A_BOLD | ColorPair(Black, White),
[GRAPH_1] = A_BOLD | ColorPair(Blue, White),
[GRAPH_2] = ColorPair(Blue, White),
[MEMORY_1] = ColorPair(Green, White),
[MEMORY_2] = ColorPair(Cyan, White),
[MEMORY_3] = ColorPair(Yellow, White),
[MEMORY_4] = ColorPair(Magenta, White),
[MEMORY_5] = A_BOLD | ColorPair(Black, White),
[MEMORY_6] = ColorPair(Red, White),
[HUGEPAGE_1] = ColorPair(Green, White),
[HUGEPAGE_2] = ColorPair(Yellow, White),
[HUGEPAGE_3] = ColorPair(Red, White),
[HUGEPAGE_4] = ColorPair(Blue, White),
[LOAD_AVERAGE_FIFTEEN] = ColorPair(Black, White),
[LOAD_AVERAGE_FIVE] = ColorPair(Black, White),
[LOAD_AVERAGE_ONE] = ColorPair(Black, White),
[LOAD] = ColorPair(Black, White),
[HELP_BOLD] = ColorPair(Blue, White),
[HELP_SHADOW] = A_BOLD | ColorPair(Black, White),
[CLOCK] = ColorPair(Black, White),
[DATE] = ColorPair(Black, White),
[DATETIME] = ColorPair(Black, White),
[CHECK_BOX] = ColorPair(Blue, White),
[CHECK_MARK] = ColorPair(Black, White),
[CHECK_TEXT] = ColorPair(Black, White),
[HOSTNAME] = ColorPair(Black, White),
[CPU_NICE] = ColorPair(Cyan, White),
[CPU_NICE_TEXT] = ColorPair(Cyan, White),
[CPU_NORMAL] = ColorPair(Green, White),
[CPU_SYSTEM] = ColorPair(Red, White),
[CPU_IOWAIT] = A_BOLD | ColorPair(Black, White),
[CPU_IRQ] = ColorPair(Blue, White),
[CPU_SOFTIRQ] = ColorPair(Blue, White),
[CPU_STEAL] = ColorPair(Cyan, White),
[CPU_GUEST] = ColorPair(Cyan, White),
[GPU_ENGINE_1] = ColorPair(Green, White),
[GPU_ENGINE_2] = ColorPair(Yellow, White),
[GPU_ENGINE_3] = ColorPair(Red, White),
[GPU_ENGINE_4] = ColorPair(Blue, White),
[GPU_RESIDUE] = ColorPair(Magenta, White),
[PANEL_EDIT] = ColorPair(White, Blue),
[SCREENS_OTH_BORDER] = A_BOLD | ColorPair(Black, White),
[SCREENS_OTH_TEXT] = A_BOLD | ColorPair(Black, White),
[SCREENS_CUR_BORDER] = ColorPair(Green, Green),
[SCREENS_CUR_TEXT] = ColorPair(Black, Green),
[PRESSURE_STALL_THREEHUNDRED] = ColorPair(Black, White),
[PRESSURE_STALL_SIXTY] = ColorPair(Black, White),
[PRESSURE_STALL_TEN] = ColorPair(Black, White),
[FILE_DESCRIPTOR_USED] = ColorPair(Green, White),
[FILE_DESCRIPTOR_MAX] = ColorPair(Blue, White),
[ZFS_MFU] = ColorPair(Cyan, White),
[ZFS_MRU] = ColorPair(Yellow, White),
[ZFS_ANON] = ColorPair(Magenta, White),
[ZFS_HEADER] = ColorPair(Yellow, White),
[ZFS_OTHER] = ColorPair(Magenta, White),
[ZFS_COMPRESSED] = ColorPair(Cyan, White),
[ZFS_RATIO] = ColorPair(Magenta, White),
[ZRAM_COMPRESSED] = ColorPair(Cyan, White),
[ZRAM_UNCOMPRESSED] = ColorPair(Yellow, White),
[DYNAMIC_GRAY] = ColorPair(Black, White),
[DYNAMIC_DARKGRAY] = A_BOLD | ColorPair(Black, White),
[DYNAMIC_RED] = ColorPair(Red, White),
[DYNAMIC_GREEN] = ColorPair(Green, White),
[DYNAMIC_BLUE] = ColorPair(Blue, White),
[DYNAMIC_CYAN] = ColorPair(Yellow, White),
[DYNAMIC_MAGENTA] = ColorPair(Magenta, White),
[DYNAMIC_YELLOW] = ColorPair(Yellow, White),
[DYNAMIC_WHITE] = A_BOLD | ColorPair(Black, White),
},
[COLORSCHEME_LIGHTTERMINAL] = {
[RESET_COLOR] = ColorPair(Black, Black),
[DEFAULT_COLOR] = ColorPair(Black, Black),
[FUNCTION_BAR] = ColorPair(Black, Cyan),
[FUNCTION_KEY] = ColorPair(Black, Black),
[PANEL_HEADER_FOCUS] = ColorPair(Black, Green),
[PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green),
[PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan),
[PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow),
[PANEL_SELECTION_UNFOCUS] = ColorPair(Blue, Black),
[FAILED_SEARCH] = ColorPair(Red, Cyan),
[FAILED_READ] = ColorPair(Red, Black),
[PAUSED] = A_BOLD | ColorPair(Yellow, Cyan),
[UPTIME] = ColorPair(Yellow, Black),
[BATTERY] = ColorPair(Yellow, Black),
[LARGE_NUMBER] = ColorPair(Red, Black),
[METER_SHADOW] = A_BOLD | ColorPairGrayBlack,
[METER_TEXT] = ColorPair(Blue, Black),
[METER_VALUE] = ColorPair(Black, Black),
[METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Black),
[METER_VALUE_IOREAD] = ColorPair(Green, Black),
[METER_VALUE_IOWRITE] = ColorPair(Yellow, Black),
[METER_VALUE_NOTICE] = A_BOLD | ColorPairWhiteDefault,
[METER_VALUE_OK] = ColorPair(Green, Black),
[METER_VALUE_WARN] = A_BOLD | ColorPair(Yellow, Black),
[LED_COLOR] = ColorPair(Green, Black),
[TASKS_RUNNING] = ColorPair(Green, Black),
[PROCESS] = ColorPair(Black, Black),
[PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack,
[PROCESS_TAG] = ColorPair(White, Blue),
[PROCESS_MEGABYTES] = ColorPair(Blue, Black),
[PROCESS_GIGABYTES] = ColorPair(Green, Black),
[PROCESS_BASENAME] = ColorPair(Green, Black),
[PROCESS_TREE] = ColorPair(Blue, Black),
[PROCESS_RUN_STATE] = ColorPair(Green, Black),
[PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Black),
[PROCESS_HIGH_PRIORITY] = ColorPair(Red, Black),
[PROCESS_LOW_PRIORITY] = ColorPair(Green, Black),
[PROCESS_NEW] = ColorPair(Black, Green),
[PROCESS_TOMB] = ColorPair(Black, Red),
[PROCESS_THREAD] = ColorPair(Blue, Black),
[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue, Black),
[PROCESS_COMM] = ColorPair(Magenta, Black),
[PROCESS_THREAD_COMM] = ColorPair(Yellow, Black),
[PROCESS_PRIV] = ColorPair(Magenta, Black),
[BAR_BORDER] = ColorPair(Blue, Black),
[BAR_SHADOW] = ColorPairGrayBlack,
[SWAP] = ColorPair(Red, Black),
[SWAP_CACHE] = ColorPair(Yellow, Black),
[SWAP_FRONTSWAP] = ColorPairGrayBlack,
[GRAPH_1] = A_BOLD | ColorPair(Cyan, Black),
[GRAPH_2] = ColorPair(Cyan, Black),
[MEMORY_1] = ColorPair(Green, Black),
[MEMORY_2] = ColorPair(Cyan, Black),
[MEMORY_3] = ColorPair(Yellow, Black),
[MEMORY_4] = ColorPair(Magenta, Black),
[MEMORY_5] = ColorPairGrayBlack,
[MEMORY_6] = ColorPair(Blue, Black),
[HUGEPAGE_1] = ColorPair(Green, Black),
[HUGEPAGE_2] = ColorPair(Yellow, Black),
[HUGEPAGE_3] = ColorPair(Red, Black),
[HUGEPAGE_4] = ColorPair(Blue, Black),
[LOAD_AVERAGE_FIFTEEN] = ColorPair(Black, Black),
[LOAD_AVERAGE_FIVE] = ColorPair(Black, Black),
[LOAD_AVERAGE_ONE] = ColorPair(Black, Black),
[LOAD] = ColorPairWhiteDefault,
[HELP_BOLD] = ColorPair(Blue, Black),
[HELP_SHADOW] = A_BOLD | ColorPairGrayBlack,
[CLOCK] = ColorPairWhiteDefault,
[DATE] = ColorPairWhiteDefault,
[DATETIME] = ColorPairWhiteDefault,
[CHECK_BOX] = ColorPair(Blue, Black),
[CHECK_MARK] = ColorPair(Black, Black),
[CHECK_TEXT] = ColorPair(Black, Black),
[HOSTNAME] = ColorPairWhiteDefault,
[CPU_NICE] = ColorPair(Cyan, Black),
[CPU_NICE_TEXT] = ColorPair(Cyan, Black),
[CPU_NORMAL] = ColorPair(Green, Black),
[CPU_SYSTEM] = ColorPair(Red, Black),
[CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black),
[CPU_IRQ] = A_BOLD | ColorPair(Blue, Black),
[CPU_SOFTIRQ] = ColorPair(Blue, Black),
[CPU_STEAL] = ColorPair(Black, Black),
[CPU_GUEST] = ColorPair(Black, Black),
[GPU_ENGINE_1] = ColorPair(Green, Black),
[GPU_ENGINE_2] = ColorPair(Yellow, Black),
[GPU_ENGINE_3] = ColorPair(Red, Black),
[GPU_ENGINE_4] = ColorPair(Blue, Black),
[GPU_RESIDUE] = ColorPair(Magenta, Black),
[PANEL_EDIT] = ColorPair(White, Blue),
[SCREENS_OTH_BORDER] = ColorPair(Blue, Black),
[SCREENS_OTH_TEXT] = ColorPair(Blue, Black),
[SCREENS_CUR_BORDER] = ColorPair(Green, Green),
[SCREENS_CUR_TEXT] = ColorPair(Black, Green),
[PRESSURE_STALL_THREEHUNDRED] = ColorPair(Black, Black),
[PRESSURE_STALL_SIXTY] = ColorPair(Black, Black),
[PRESSURE_STALL_TEN] = ColorPair(Black, Black),
[FILE_DESCRIPTOR_USED] = ColorPair(Green, Black),
[FILE_DESCRIPTOR_MAX] = A_BOLD | ColorPair(Blue, Black),
[ZFS_MFU] = ColorPair(Cyan, Black),
[ZFS_MRU] = ColorPair(Yellow, Black),
[ZFS_ANON] = A_BOLD | ColorPair(Magenta, Black),
[ZFS_HEADER] = ColorPair(Black, Black),
[ZFS_OTHER] = A_BOLD | ColorPair(Magenta, Black),
[ZFS_COMPRESSED] = ColorPair(Cyan, Black),
[ZFS_RATIO] = A_BOLD | ColorPair(Magenta, Black),
[ZRAM_COMPRESSED] = ColorPair(Cyan, Black),
[ZRAM_UNCOMPRESSED] = ColorPair(Yellow, Black),
[DYNAMIC_GRAY] = ColorPairGrayBlack,
[DYNAMIC_DARKGRAY] = A_BOLD | ColorPairGrayBlack,
[DYNAMIC_RED] = ColorPair(Red, Black),
[DYNAMIC_GREEN] = ColorPair(Green, Black),
[DYNAMIC_BLUE] = ColorPair(Blue, Black),
[DYNAMIC_CYAN] = ColorPair(Cyan, Black),
[DYNAMIC_MAGENTA] = ColorPair(Magenta, Black),
[DYNAMIC_YELLOW] = ColorPair(Yellow, Black),
[DYNAMIC_WHITE] = ColorPairWhiteDefault,
},
[COLORSCHEME_MIDNIGHT] = {
[RESET_COLOR] = ColorPair(White, Blue),
[DEFAULT_COLOR] = ColorPair(White, Blue),
[FUNCTION_BAR] = ColorPair(Black, Cyan),
[FUNCTION_KEY] = A_NORMAL,
[PANEL_HEADER_FOCUS] = ColorPair(Black, Cyan),
[PANEL_HEADER_UNFOCUS] = ColorPair(Black, Cyan),
[PANEL_SELECTION_FOCUS] = ColorPair(Black, White),
[PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow),
[PANEL_SELECTION_UNFOCUS] = A_BOLD | ColorPair(Yellow, Blue),
[FAILED_SEARCH] = ColorPair(Red, Cyan),
[FAILED_READ] = A_BOLD | ColorPair(Red, Blue),
[PAUSED] = A_BOLD | ColorPair(Yellow, Cyan),
[UPTIME] = A_BOLD | ColorPair(Yellow, Blue),
[BATTERY] = A_BOLD | ColorPair(Yellow, Blue),
[LARGE_NUMBER] = A_BOLD | ColorPair(Red, Blue),
[METER_SHADOW] = ColorPair(Cyan, Blue),
[METER_TEXT] = ColorPair(Cyan, Blue),
[METER_VALUE] = A_BOLD | ColorPair(Cyan, Blue),
[METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Blue),
[METER_VALUE_IOREAD] = ColorPair(Green, Blue),
[METER_VALUE_IOWRITE] = ColorPair(Black, Blue),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(White, Blue),
[METER_VALUE_OK] = ColorPair(Green, Blue),
[METER_VALUE_WARN] = A_BOLD | ColorPair(Yellow, Black),
[LED_COLOR] = ColorPair(Green, Blue),
[TASKS_RUNNING] = A_BOLD | ColorPair(Green, Blue),
[PROCESS] = ColorPair(White, Blue),
[PROCESS_SHADOW] = A_BOLD | ColorPair(Black, Blue),
[PROCESS_TAG] = A_BOLD | ColorPair(Yellow, Blue),
[PROCESS_MEGABYTES] = ColorPair(Cyan, Blue),
[PROCESS_GIGABYTES] = ColorPair(Green, Blue),
[PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan, Blue),
[PROCESS_TREE] = ColorPair(Cyan, Blue),
[PROCESS_RUN_STATE] = ColorPair(Green, Blue),
[PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Blue),
[PROCESS_HIGH_PRIORITY] = ColorPair(Red, Blue),
[PROCESS_LOW_PRIORITY] = ColorPair(Green, Blue),
[PROCESS_NEW] = ColorPair(Blue, Green),
[PROCESS_TOMB] = ColorPair(Blue, Red),
[PROCESS_THREAD] = ColorPair(Green, Blue),
[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green, Blue),
[PROCESS_COMM] = ColorPair(Magenta, Blue),
[PROCESS_THREAD_COMM] = ColorPair(Black, Blue),
[PROCESS_PRIV] = ColorPair(Magenta, Blue),
[BAR_BORDER] = A_BOLD | ColorPair(Yellow, Blue),
[BAR_SHADOW] = ColorPair(Cyan, Blue),
[SWAP] = ColorPair(Red, Blue),
[SWAP_CACHE] = A_BOLD | ColorPair(Yellow, Blue),
[SWAP_FRONTSWAP] = A_BOLD | ColorPair(Black, Blue),
[GRAPH_1] = A_BOLD | ColorPair(Cyan, Blue),
[GRAPH_2] = ColorPair(Cyan, Blue),
[MEMORY_1] = A_BOLD | ColorPair(Green, Blue),
[MEMORY_2] = A_BOLD | ColorPair(Cyan, Blue),
[MEMORY_3] = A_BOLD | ColorPair(Yellow, Blue),
[MEMORY_4] = A_BOLD | ColorPair(Magenta, Blue),
[MEMORY_5] = A_BOLD | ColorPair(Black, Blue),
[MEMORY_6] = ColorPair(Cyan, Blue),
[HUGEPAGE_1] = A_BOLD | ColorPair(Green, Blue),
[HUGEPAGE_2] = A_BOLD | ColorPair(Yellow, Blue),
[HUGEPAGE_3] = A_BOLD | ColorPair(Red, Blue),
[HUGEPAGE_4] = A_BOLD | ColorPair(White, Blue),
[LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black, Blue),
[LOAD_AVERAGE_FIVE] = A_NORMAL | ColorPair(White, Blue),
[LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White, Blue),
[LOAD] = A_BOLD | ColorPair(White, Blue),
[HELP_BOLD] = A_BOLD | ColorPair(Cyan, Blue),
[HELP_SHADOW] = A_BOLD | ColorPair(Black, Blue),
[CLOCK] = ColorPair(White, Blue),
[DATE] = ColorPair(White, Blue),
[DATETIME] = ColorPair(White, Blue),
[CHECK_BOX] = ColorPair(Cyan, Blue),
[CHECK_MARK] = A_BOLD | ColorPair(White, Blue),
[CHECK_TEXT] = A_NORMAL | ColorPair(White, Blue),
[HOSTNAME] = ColorPair(White, Blue),
[CPU_NICE] = A_BOLD | ColorPair(Cyan, Blue),
[CPU_NICE_TEXT] = A_BOLD | ColorPair(Cyan, Blue),
[CPU_NORMAL] = A_BOLD | ColorPair(Green, Blue),
[CPU_SYSTEM] = A_BOLD | ColorPair(Red, Blue),
[CPU_IOWAIT] = A_BOLD | ColorPair(Black, Blue),
[CPU_IRQ] = A_BOLD | ColorPair(Black, Blue),
[CPU_SOFTIRQ] = ColorPair(Black, Blue),
[CPU_STEAL] = ColorPair(White, Blue),
[CPU_GUEST] = ColorPair(White, Blue),
[GPU_ENGINE_1] = A_BOLD | ColorPair(Green, Blue),
[GPU_ENGINE_2] = A_BOLD | ColorPair(Yellow, Blue),
[GPU_ENGINE_3] = A_BOLD | ColorPair(Red, Blue),
[GPU_ENGINE_4] = A_BOLD | ColorPair(White, Blue),
[GPU_RESIDUE] = A_BOLD | ColorPair(Magenta, Blue),
[PANEL_EDIT] = ColorPair(White, Blue),
[SCREENS_OTH_BORDER] = A_BOLD | ColorPair(Yellow, Blue),
[SCREENS_OTH_TEXT] = ColorPair(Cyan, Blue),
[SCREENS_CUR_BORDER] = ColorPair(Cyan, Cyan),
[SCREENS_CUR_TEXT] = ColorPair(Black, Cyan),
[PRESSURE_STALL_THREEHUNDRED] = A_BOLD | ColorPair(Black, Blue),
[PRESSURE_STALL_SIXTY] = A_NORMAL | ColorPair(White, Blue),
[PRESSURE_STALL_TEN] = A_BOLD | ColorPair(White, Blue),
[FILE_DESCRIPTOR_USED] = A_BOLD | ColorPair(Green, Blue),
[FILE_DESCRIPTOR_MAX] = A_BOLD | ColorPair(Red, Blue),
[ZFS_MFU] = A_BOLD | ColorPair(White, Blue),
[ZFS_MRU] = A_BOLD | ColorPair(Yellow, Blue),
[ZFS_ANON] = A_BOLD | ColorPair(Magenta, Blue),
[ZFS_HEADER] = A_BOLD | ColorPair(Yellow, Blue),
[ZFS_OTHER] = A_BOLD | ColorPair(Magenta, Blue),
[ZFS_COMPRESSED] = A_BOLD | ColorPair(White, Blue),
[ZFS_RATIO] = A_BOLD | ColorPair(Magenta, Blue),
[ZRAM_COMPRESSED] = ColorPair(Cyan, Blue),
[ZRAM_UNCOMPRESSED] = ColorPair(Yellow, Blue),
[DYNAMIC_GRAY] = ColorPairGrayBlack,
[DYNAMIC_DARKGRAY] = A_BOLD | ColorPairGrayBlack,
[DYNAMIC_RED] = ColorPair(Red, Blue),
[DYNAMIC_GREEN] = ColorPair(Green, Blue),
[DYNAMIC_BLUE] = ColorPair(Black, Blue),
[DYNAMIC_CYAN] = ColorPair(Cyan, Blue),
[DYNAMIC_MAGENTA] = ColorPair(Magenta, Blue),
[DYNAMIC_YELLOW] = ColorPair(Yellow, Blue),
[DYNAMIC_WHITE] = ColorPair(White, Blue),
},
[COLORSCHEME_BLACKNIGHT] = {
[RESET_COLOR] = ColorPair(Cyan, Black),
[DEFAULT_COLOR] = ColorPair(Cyan, Black),
[FUNCTION_BAR] = ColorPair(Black, Green),
[FUNCTION_KEY] = ColorPair(Cyan, Black),
[PANEL_HEADER_FOCUS] = ColorPair(Black, Green),
[PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green),
[PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan),
[PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow),
[PANEL_SELECTION_UNFOCUS] = ColorPair(Black, White),
[FAILED_SEARCH] = ColorPair(Red, Green),
[FAILED_READ] = A_BOLD | ColorPair(Red, Black),
[PAUSED] = A_BOLD | ColorPair(Yellow, Green),
[UPTIME] = ColorPair(Green, Black),
[BATTERY] = ColorPair(Green, Black),
[LARGE_NUMBER] = A_BOLD | ColorPair(Red, Black),
[METER_SHADOW] = A_BOLD | ColorPairGrayBlack,
[METER_TEXT] = ColorPair(Cyan, Black),
[METER_VALUE] = ColorPair(Green, Black),
[METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Black),
[METER_VALUE_IOREAD] = ColorPair(Green, Black),
[METER_VALUE_IOWRITE] = ColorPair(Blue, Black),
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(White, Black),
[METER_VALUE_OK] = ColorPair(Green, Black),
[METER_VALUE_WARN] = A_BOLD | ColorPair(Yellow, Black),
[LED_COLOR] = ColorPair(Green, Black),
[TASKS_RUNNING] = A_BOLD | ColorPair(Green, Black),
[PROCESS] = ColorPair(Cyan, Black),
[PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack,
[PROCESS_TAG] = A_BOLD | ColorPair(Yellow, Black),
[PROCESS_MEGABYTES] = A_BOLD | ColorPair(Green, Black),
[PROCESS_GIGABYTES] = A_BOLD | ColorPair(Yellow, Black),
[PROCESS_BASENAME] = A_BOLD | ColorPair(Green, Black),
[PROCESS_TREE] = ColorPair(Cyan, Black),
[PROCESS_THREAD] = ColorPair(Green, Black),
[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue, Black),
[PROCESS_COMM] = ColorPair(Magenta, Black),
[PROCESS_THREAD_COMM] = ColorPair(Yellow, Black),
[PROCESS_RUN_STATE] = ColorPair(Green, Black),
[PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Black),
[PROCESS_HIGH_PRIORITY] = ColorPair(Red, Black),
[PROCESS_LOW_PRIORITY] = ColorPair(Green, Black),
[PROCESS_NEW] = ColorPair(Black, Green),
[PROCESS_TOMB] = ColorPair(Black, Red),
[PROCESS_PRIV] = ColorPair(Magenta, Black),
[BAR_BORDER] = A_BOLD | ColorPair(Green, Black),
[BAR_SHADOW] = ColorPair(Cyan, Black),
[SWAP] = ColorPair(Red, Black),
[SWAP_CACHE] = ColorPair(Yellow, Black),
[SWAP_FRONTSWAP] = ColorPair(Yellow, Black),
[GRAPH_1] = A_BOLD | ColorPair(Green, Black),
[GRAPH_2] = ColorPair(Green, Black),
[MEMORY_1] = ColorPair(Green, Black),
[MEMORY_2] = ColorPair(Blue, Black),
[MEMORY_3] = ColorPair(Yellow, Black),
[MEMORY_4] = ColorPair(Magenta, Black),
[MEMORY_5] = ColorPair(Yellow, Black),
[MEMORY_6] = ColorPair(Cyan, Black),
[HUGEPAGE_1] = ColorPair(Green, Black),
[HUGEPAGE_2] = ColorPair(Yellow, Black),
[HUGEPAGE_3] = ColorPair(Red, Black),
[HUGEPAGE_4] = ColorPair(Blue, Black),
[LOAD_AVERAGE_FIFTEEN] = ColorPair(Green, Black),
[LOAD_AVERAGE_FIVE] = ColorPair(Green, Black),
[LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(Green, Black),
[LOAD] = A_BOLD,
[HELP_BOLD] = A_BOLD | ColorPair(Cyan, Black),
[HELP_SHADOW] = A_BOLD | ColorPairGrayBlack,
[CLOCK] = ColorPair(Green, Black),
[CHECK_BOX] = ColorPair(Green, Black),
[CHECK_MARK] = A_BOLD | ColorPair(Green, Black),
[CHECK_TEXT] = ColorPair(Cyan, Black),
[HOSTNAME] = ColorPair(Green, Black),
[CPU_NICE] = ColorPair(Blue, Black),
[CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue, Black),
[CPU_NORMAL] = ColorPair(Green, Black),
[CPU_SYSTEM] = ColorPair(Red, Black),
[CPU_IOWAIT] = ColorPair(Yellow, Black),
[CPU_IRQ] = A_BOLD | ColorPair(Blue, Black),
[CPU_SOFTIRQ] = ColorPair(Blue, Black),
[CPU_STEAL] = ColorPair(Cyan, Black),
[CPU_GUEST] = ColorPair(Cyan, Black),
[GPU_ENGINE_1] = ColorPair(Green, Black),
[GPU_ENGINE_2] = ColorPair(Yellow, Black),
[GPU_ENGINE_3] = ColorPair(Red, Black),
[GPU_ENGINE_4] = ColorPair(Blue, Black),
[GPU_RESIDUE] = ColorPair(Magenta, Black),
[PANEL_EDIT] = ColorPair(White, Cyan),
[SCREENS_OTH_BORDER] = ColorPair(White, Black),
[SCREENS_OTH_TEXT] = ColorPair(Cyan, Black),
[SCREENS_CUR_BORDER] = A_BOLD | ColorPair(White, Black),
[SCREENS_CUR_TEXT] = A_BOLD | ColorPair(Green, Black),
[PRESSURE_STALL_THREEHUNDRED] = ColorPair(Green, Black),
[PRESSURE_STALL_SIXTY] = ColorPair(Green, Black),
[PRESSURE_STALL_TEN] = A_BOLD | ColorPair(Green, Black),
[FILE_DESCRIPTOR_USED] = ColorPair(Green, Black),
[FILE_DESCRIPTOR_MAX] = A_BOLD | ColorPair(Blue, Black),
[ZFS_MFU] = ColorPair(Blue, Black),
[ZFS_MRU] = ColorPair(Yellow, Black),
[ZFS_ANON] = ColorPair(Magenta, Black),
[ZFS_HEADER] = ColorPair(Yellow, Black),
[ZFS_OTHER] = ColorPair(Magenta, Black),
[ZFS_COMPRESSED] = ColorPair(Blue, Black),
[ZFS_RATIO] = ColorPair(Magenta, Black),
[ZRAM_COMPRESSED] = ColorPair(Blue, Black),
[ZRAM_UNCOMPRESSED] = ColorPair(Yellow, Black),
[DYNAMIC_GRAY] = ColorPairGrayBlack,
[DYNAMIC_DARKGRAY] = A_BOLD | ColorPairGrayBlack,
[DYNAMIC_RED] = ColorPair(Red, Black),
[DYNAMIC_GREEN] = ColorPair(Green, Black),
[DYNAMIC_BLUE] = ColorPair(Blue, Black),
[DYNAMIC_CYAN] = ColorPair(Cyan, Black),
[DYNAMIC_MAGENTA] = ColorPair(Magenta, Black),
[DYNAMIC_YELLOW] = ColorPair(Yellow, Black),
[DYNAMIC_WHITE] = ColorPair(White, Black),
},
[COLORSCHEME_BROKENGRAY] = { 0 }, // dynamically generated.
[COLORSCHEME_NORD] = {
[RESET_COLOR] = A_NORMAL,
[DEFAULT_COLOR] = A_NORMAL,
[FUNCTION_BAR] = ColorPair(Black, Cyan),
[FUNCTION_KEY] = A_NORMAL,
[PANEL_HEADER_FOCUS] = ColorPair(Black, Cyan),
[PANEL_HEADER_UNFOCUS] = ColorPair(Black, Cyan),
[PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan),
[PANEL_SELECTION_FOLLOW] = A_REVERSE,
[PANEL_SELECTION_UNFOCUS] = A_BOLD,
[FAILED_SEARCH] = A_REVERSE | A_BOLD | ColorPair(Yellow, Black),
[FAILED_READ] = A_BOLD | ColorPair(Yellow, Black),
[PAUSED] = A_BOLD | ColorPair(Black, Cyan),
[UPTIME] = A_BOLD,
[BATTERY] = A_BOLD,
[LARGE_NUMBER] = A_BOLD | ColorPair(Yellow, Black),
[METER_SHADOW] = A_BOLD | ColorPairGrayBlack,
[METER_TEXT] = A_NORMAL,
[METER_VALUE] = A_BOLD,
[METER_VALUE_ERROR] = A_BOLD,
[METER_VALUE_IOREAD] = A_NORMAL,
[METER_VALUE_IOWRITE] = A_NORMAL,
[METER_VALUE_NOTICE] = A_BOLD | ColorPair(Cyan, Black),
[METER_VALUE_OK] = A_NORMAL,
[METER_VALUE_WARN] = A_BOLD,
[LED_COLOR] = A_NORMAL,
[TASKS_RUNNING] = A_BOLD,
[PROCESS] = A_NORMAL,
[PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack,
[PROCESS_TAG] = A_BOLD | ColorPair(Cyan, Black),
[PROCESS_MEGABYTES] = A_BOLD | ColorPair(White, Black),
[PROCESS_GIGABYTES] = A_BOLD | ColorPair(Cyan, Black),
[PROCESS_BASENAME] = A_BOLD,
[PROCESS_TREE] = A_BOLD,
[PROCESS_RUN_STATE] = A_BOLD,
[PROCESS_D_STATE] = A_BOLD | ColorPair(Yellow, Black),
[PROCESS_HIGH_PRIORITY] = A_BOLD,
[PROCESS_LOW_PRIORITY] = A_BOLD | ColorPairGrayBlack,
[PROCESS_NEW] = A_BOLD,
[PROCESS_TOMB] = A_BOLD | ColorPairGrayBlack,
[PROCESS_PRIV] = A_BOLD | ColorPair(Cyan, Black),
[BAR_BORDER] = A_BOLD,
[BAR_SHADOW] = A_BOLD | ColorPairGrayBlack,
[SWAP] = A_BOLD,
[SWAP_CACHE] = A_NORMAL,
[SWAP_FRONTSWAP] = A_BOLD | ColorPairGrayBlack,
[GRAPH_1] = A_BOLD,
[GRAPH_2] = A_NORMAL,
[MEMORY_1] = A_BOLD | ColorPair(Yellow, Black),
[MEMORY_2] = A_NORMAL,
[MEMORY_3] = A_NORMAL,
[MEMORY_4] = A_NORMAL,
[MEMORY_5] = A_BOLD | ColorPairGrayBlack,
[MEMORY_6] = A_NORMAL,
[HUGEPAGE_1] = A_BOLD,
[HUGEPAGE_2] = A_NORMAL,
[HUGEPAGE_3] = A_BOLD | ColorPair(Cyan, Black),
[HUGEPAGE_4] = A_BOLD | ColorPair(Cyan, Black),
[LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPairGrayBlack,
[LOAD_AVERAGE_FIVE] = A_NORMAL,
[LOAD_AVERAGE_ONE] = A_BOLD,
[LOAD] = A_BOLD,
[HELP_BOLD] = A_BOLD,
[HELP_SHADOW] = A_BOLD | ColorPairGrayBlack,
[CLOCK] = A_BOLD,
[DATE] = A_BOLD,
[DATETIME] = A_BOLD,
[CHECK_BOX] = A_BOLD,
[CHECK_MARK] = A_NORMAL,
[CHECK_TEXT] = A_NORMAL,
[HOSTNAME] = A_BOLD | ColorPair(Cyan, Black),
[CPU_NICE] = A_NORMAL,
[CPU_NICE_TEXT] = A_NORMAL,
[CPU_NORMAL] = A_BOLD,
[CPU_SYSTEM] = A_BOLD | ColorPair(Yellow, Black),
[CPU_IOWAIT] = A_NORMAL,
[CPU_IRQ] = A_BOLD,
[CPU_SOFTIRQ] = A_BOLD,
[CPU_STEAL] = A_BOLD | ColorPairGrayBlack,
[CPU_GUEST] = A_BOLD | ColorPairGrayBlack,
[GPU_ENGINE_1] = A_BOLD,
[GPU_ENGINE_2] = A_NORMAL,
[GPU_ENGINE_3] = A_BOLD | ColorPair(Cyan, Black),
[GPU_ENGINE_4] = A_BOLD | ColorPair(Cyan, Black),
[GPU_RESIDUE] = A_BOLD,
[PANEL_EDIT] = A_BOLD,
[SCREENS_OTH_BORDER] = A_BOLD | ColorPairGrayBlack,
[SCREENS_OTH_TEXT] = A_BOLD | ColorPairGrayBlack,
[SCREENS_CUR_BORDER] = ColorPair(Black, Cyan),
[SCREENS_CUR_TEXT] = ColorPair(Black, Cyan),
[PRESSURE_STALL_THREEHUNDRED] = A_BOLD | ColorPairGrayBlack,
[PRESSURE_STALL_SIXTY] = A_NORMAL,
[PRESSURE_STALL_TEN] = A_BOLD,
[FILE_DESCRIPTOR_USED] = A_BOLD,
[FILE_DESCRIPTOR_MAX] = A_BOLD | ColorPair(Yellow, Black),
[ZFS_MFU] = A_NORMAL,
[ZFS_MRU] = A_NORMAL,
[ZFS_ANON] = A_BOLD | ColorPairGrayBlack,
[ZFS_HEADER] = A_BOLD,
[ZFS_OTHER] = A_BOLD | ColorPairGrayBlack,
[ZFS_COMPRESSED] = A_BOLD,
[ZFS_RATIO] = A_BOLD,
[ZRAM_COMPRESSED] = A_NORMAL,
[ZRAM_UNCOMPRESSED] = A_NORMAL,
[DYNAMIC_GRAY] = A_BOLD | ColorPairGrayBlack,
[DYNAMIC_DARKGRAY] = A_BOLD | ColorPairGrayBlack,
[DYNAMIC_RED] = A_BOLD | ColorPair(Yellow, Black),
[DYNAMIC_GREEN] = A_BOLD,
[DYNAMIC_BLUE] = A_BOLD | ColorPair(Cyan, Black),
[DYNAMIC_CYAN] = A_BOLD | ColorPair(Cyan, Black),
[DYNAMIC_MAGENTA] = A_BOLD,
[DYNAMIC_YELLOW] = A_BOLD | ColorPair(Yellow, Black),
[DYNAMIC_WHITE] = A_BOLD,
},
};
static bool CRT_retainScreenOnExit = false;
int CRT_scrollHAmount = 5;
int CRT_scrollWheelVAmount = 10;
ColorScheme CRT_colorScheme = COLORSCHEME_DEFAULT;
ATTR_NORETURN
static void CRT_handleSIGTERM(int sgn) {
CRT_done();
if (!CRT_settings->changed)
_exit(0);
const char* signal_str = strsignal(sgn);
if (!signal_str)
signal_str = "unknown reason";
char err_buf[512];
snprintf(err_buf, sizeof(err_buf),
"A signal %d (%s) was received, exiting without persisting settings to htoprc.\n",
sgn, signal_str);
full_write_str(STDERR_FILENO, err_buf);
_exit(0);
}
#ifndef NDEBUG
static int stderrRedirectNewFd = -1;
static int stderrRedirectBackupFd = -1;
static int createStderrCacheFile(void) {
#if defined(HAVE_MEMFD_CREATE)
return memfd_create("htop.stderr-redirect", 0);
#elif defined(O_TMPFILE)
return open("/tmp", O_TMPFILE | O_CREAT | O_EXCL | O_RDWR, S_IRUSR | S_IWUSR);
#else
char tmpName[] = "htop.stderr-redirectXXXXXX";
mode_t curUmask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
int r = mkstemp(tmpName);
umask(curUmask);
if (r < 0)
return r;
(void) unlink(tmpName);
return r;
#endif /* HAVE_MEMFD_CREATE */
}
static void redirectStderr(void) {
stderrRedirectNewFd = createStderrCacheFile();
if (stderrRedirectNewFd < 0) {
/* ignore failure */
return;
}
stderrRedirectBackupFd = dup(STDERR_FILENO);
dup2(stderrRedirectNewFd, STDERR_FILENO);
}
static void dumpStderr(void) {
if (stderrRedirectNewFd < 0)
return;
fsync(STDERR_FILENO);
dup2(stderrRedirectBackupFd, STDERR_FILENO);
close(stderrRedirectBackupFd);
stderrRedirectBackupFd = -1;
lseek(stderrRedirectNewFd, 0, SEEK_SET);
bool header = false;
char buffer[8192];
for (;;) {
errno = 0;
ssize_t res = read(stderrRedirectNewFd, buffer, sizeof(buffer));
if (res < 0) {
if (errno == EINTR)
continue;
break;
}
if (res == 0) {
break;
}
if (res > 0) {
if (!header) {
full_write_str(STDERR_FILENO, ">>>>>>>>>> stderr output >>>>>>>>>>\n");
header = true;
}
full_write(STDERR_FILENO, buffer, res);
}
}
if (header)
full_write_str(STDERR_FILENO, "\n<<<<<<<<<< stderr output <<<<<<<<<<\n");
close(stderrRedirectNewFd);
stderrRedirectNewFd = -1;
}
void CRT_debug_impl(const char* file, size_t lineno, const char* func, const char* fmt, ...) {
va_list args;
fprintf(stderr, "[%s:%zu (%s)]: ", file, lineno, func);
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
fprintf(stderr, "\n");
}
#else /* !NDEBUG */
static void redirectStderr(void) {
}
static void dumpStderr(void) {
}
#endif /* !NDEBUG */
static struct sigaction old_sig_handler[32];
static void CRT_installSignalHandlers(void) {
struct sigaction act;
sigemptyset(&act.sa_mask);
act.sa_flags = (int)SA_RESETHAND | SA_NODEFER;
act.sa_handler = CRT_handleSIGSEGV;
sigaction(SIGSEGV, &act, &old_sig_handler[SIGSEGV]);
sigaction(SIGFPE, &act, &old_sig_handler[SIGFPE]);
sigaction(SIGILL, &act, &old_sig_handler[SIGILL]);
sigaction(SIGBUS, &act, &old_sig_handler[SIGBUS]);
#ifndef HTOP_PCP
sigaction(SIGPIPE, &act, &old_sig_handler[SIGPIPE]);
#else
signal(SIGPIPE, SIG_IGN);
#endif
sigaction(SIGSYS, &act, &old_sig_handler[SIGSYS]);
sigaction(SIGABRT, &act, &old_sig_handler[SIGABRT]);
signal(SIGCHLD, SIG_DFL);
signal(SIGINT, CRT_handleSIGTERM);
signal(SIGTERM, CRT_handleSIGTERM);
signal(SIGQUIT, CRT_handleSIGTERM);
signal(SIGUSR1, SIG_IGN);
signal(SIGUSR2, SIG_IGN);
}
void CRT_resetSignalHandlers(void) {
sigaction(SIGSEGV, &old_sig_handler[SIGSEGV], NULL);
sigaction(SIGFPE, &old_sig_handler[SIGFPE], NULL);
sigaction(SIGILL, &old_sig_handler[SIGILL], NULL);
sigaction(SIGBUS, &old_sig_handler[SIGBUS], NULL);
sigaction(SIGPIPE, &old_sig_handler[SIGPIPE], NULL);
sigaction(SIGSYS, &old_sig_handler[SIGSYS], NULL);
sigaction(SIGABRT, &old_sig_handler[SIGABRT], NULL);
signal(SIGINT, SIG_DFL);
signal(SIGTERM, SIG_DFL);
signal(SIGQUIT, SIG_DFL);
signal(SIGUSR1, SIG_DFL);
signal(SIGUSR2, SIG_DFL);
}
#ifdef HAVE_GETMOUSE
void CRT_setMouse(bool enabled) {
if (enabled) {
#if NCURSES_MOUSE_VERSION > 1
mousemask(BUTTON1_RELEASED | BUTTON3_RELEASED | BUTTON4_PRESSED | BUTTON5_PRESSED, NULL);
#else
mousemask(BUTTON1_RELEASED | BUTTON3_RELEASED, NULL);
#endif
} else {
mousemask(0, NULL);
}
}
#endif
static bool terminalSupportsDefinedKeys(const char* termType) {
if (!termType) {
return false;
}
#define IS_END_OR_DASH(ch) ((ch) == '-' || (ch) == '\0')
switch (termType[0]) {
case 'a':
if (String_eq(termType, "alacritty")) {
return true;
}
break;
case 'f':
if (String_eq(termType, "foot")) {
return true;
}
break;
case 's':
if (termType[1] == 't' && IS_END_OR_DASH(termType[2])) {
return true;
}
if (String_startsWith(termType, "screen") && IS_END_OR_DASH(termType[6])) {
return true;
}
break;
case 't':
if (String_startsWith(termType, "tmux") && IS_END_OR_DASH(termType[4])) {
return true;
}
break;
case 'v':
if (String_eq(termType, "vt220")) {
return true;
}
break;
case 'x':
if (String_startsWith(termType, "xterm") && IS_END_OR_DASH(termType[5])) {
return true;
}
break;
}
return false;
}
void CRT_init(const Settings* settings, bool allowUnicode, bool retainScreenOnExit) {
initscr();
if (retainScreenOnExit) {
CRT_retainScreenOnExit = true;
refresh();
tputs(exit_ca_mode, 0, putchar);
tputs(clear_screen, 0, putchar);
fflush(stdout);
enter_ca_mode = 0;
exit_ca_mode = 0;
}
redirectStderr();
noecho();
CRT_settings = settings;
for (int i = 0; i < LAST_COLORELEMENT; i++) {
unsigned int color = CRT_colorSchemes[COLORSCHEME_DEFAULT][i];
CRT_colorSchemes[COLORSCHEME_BROKENGRAY][i] = color == (A_BOLD | ColorPairGrayBlack) ? ColorPair(White, Black) : color;
}
halfdelay(settings->delay);
nonl();
intrflush(stdscr, false);
keypad(stdscr, true);
#ifdef HAVE_GETMOUSE
mouseinterval(0);
#endif
curs_set(0);
if (has_colors()) {
start_color();
}
const char* termType = getenv("TERM");
if (termType && String_eq(termType, "linux")) {
CRT_scrollHAmount = 20;
} else {
CRT_scrollHAmount = 5;
}
if (terminalSupportsDefinedKeys(termType)) {
#ifdef HTOP_NETBSD
#define define_key(s_, k_) define_key((char*)s_, k_)
IGNORE_WCASTQUAL_BEGIN
#endif
define_key("\033[H", KEY_HOME);
define_key("\033[F", KEY_END);
define_key("\033[7~", KEY_HOME);
define_key("\033[8~", KEY_END);
define_key("\033OP", KEY_F(1));
define_key("\033OQ", KEY_F(2));
define_key("\033OR", KEY_F(3));
define_key("\033OS", KEY_F(4));
define_key("\033O2R", KEY_F(15));
define_key("\033[11~", KEY_F(1));
define_key("\033[12~", KEY_F(2));
define_key("\033[13~", KEY_F(3));
define_key("\033[14~", KEY_F(4));
define_key("\033[14;2~", KEY_F(15));
define_key("\033[17;2~", KEY_F(18));
define_key("\033[Z", KEY_SHIFT_TAB);
char sequence[3] = "\033a";
for (char c = 'a'; c <= 'z'; c++) {
sequence[1] = c;
define_key(sequence, KEY_ALT('A' + (c - 'a')));
}
define_key("\033[I", KEY_FOCUS_IN);
define_key("\033[O", KEY_FOCUS_OUT);
#ifdef HTOP_NETBSD
IGNORE_WCASTQUAL_END
#undef define_key
#endif
}
if (termType && (String_startsWith(termType, "rxvt"))) {
define_key("\033[Z", KEY_SHIFT_TAB);
}
CRT_installSignalHandlers();
use_default_colors();
CRT_setColors(has_colors() ? settings->colorScheme : COLORSCHEME_MONOCHROME);
#ifdef HAVE_LIBNCURSESW
if (allowUnicode && String_eq(nl_langinfo(CODESET), "UTF-8")) {
CRT_utf8 = true;
} else {
CRT_utf8 = false;
}
#else
(void) allowUnicode;
#endif
CRT_treeStr =
#ifdef HAVE_LIBNCURSESW
CRT_utf8 ? CRT_treeStrUtf8 :
#endif
CRT_treeStrAscii;
CRT_setMouse(settings->enableMouse);
initDegreeSign();
}
void CRT_done(void) {
int resetColor = CRT_colors ? CRT_colors[RESET_COLOR] : CRT_colorSchemes[COLORSCHEME_DEFAULT][RESET_COLOR];
attron(resetColor);
mvhline(LINES - 1, 0, ' ', COLS);
attroff(resetColor);
refresh();
if (CRT_retainScreenOnExit) {
mvcur(-1, -1, LINES - 1, 0);
}
curs_set(1);
endwin();
dumpStderr();
}
void CRT_fatalError(const char* note) {
const char* sysMsg = strerror(errno);
CRT_done();
fprintf(stderr, "%s: %s\n", note, sysMsg);
exit(2);
}
int CRT_readKey(void) {
nocbreak();
cbreak();
nodelay(stdscr, FALSE);
int ret = getch();
halfdelay(CRT_settings->delay);
return ret;
}
void CRT_disableDelay(void) {
nocbreak();
cbreak();
nodelay(stdscr, TRUE);
}
void CRT_enableDelay(void) {
halfdelay(CRT_settings->delay);
}
void CRT_setColors(int colorScheme) {
if (colorScheme >= LAST_COLORSCHEME || colorScheme < 0) {
colorScheme = COLORSCHEME_DEFAULT;
}
CRT_colorScheme = colorScheme;
for (short int i = 0; i < 8; i++) {
for (short int j = 0; j < 8; j++) {
if (ColorIndex(i, j) != ColorIndexGrayBlack && ColorIndex(i, j) != ColorIndexWhiteDefault) {
short int bg = (colorScheme != COLORSCHEME_BLACKNIGHT) && (j == 0) ? -1 : j;
init_pair(ColorIndex(i, j), i, bg);
}
}
}
short int grayBlackFg = COLORS > 8 ? 8 : 0;
short int grayBlackBg = (colorScheme != COLORSCHEME_BLACKNIGHT) ? -1 : 0;
init_pair(ColorIndexGrayBlack, grayBlackFg, grayBlackBg);
init_pair(ColorIndexWhiteDefault, White, -1);
CRT_colors = CRT_colorSchemes[colorScheme];
}
#ifdef PRINT_BACKTRACE
static void print_backtrace(void) {
#if defined(HAVE_LIBUNWIND_H) && defined(HAVE_LOCAL_UNWIND)
unw_context_t context;
unw_getcontext(&context);
unw_cursor_t cursor;
unw_init_local(&cursor, &context);
unsigned int item = 0;
char err_buf[1024];
while (unw_step(&cursor) > 0) {
unw_word_t pc;
unw_get_reg(&cursor, UNW_REG_IP, &pc);
if (pc == 0)
break;
char symbolName[256] = "?";
unw_word_t offset = 0;
unw_get_proc_name(&cursor, symbolName, sizeof(symbolName), &offset);
unw_proc_info_t pip;
pip.unwind_info = 0;
const char* fname = "?";
const void* ptr = 0;
if (unw_get_proc_info(&cursor, &pip) == 0) {
ptr = (const void*)(pip.start_ip + offset);
#ifdef HAVE_DLADDR
Dl_info dlinfo;
if (dladdr(ptr, &dlinfo) && dlinfo.dli_fname && *dlinfo.dli_fname)
fname = dlinfo.dli_fname;
#endif
}
const bool is_signal_frame = unw_is_signal_frame(&cursor) > 0;
const char* frame = is_signal_frame ? " {signal frame}" : "";
snprintf(err_buf, sizeof(err_buf), "%2u: %#14lx %s (%s+%#lx) [%p]%s\n", item++, pc, fname, symbolName, offset, ptr, frame);
full_write_str(STDERR_FILENO, err_buf);
}
#elif defined(HAVE_EXECINFO_H) && defined(BACKTRACE_RETURN_TYPE)
void* backtraceArray[256];
BACKTRACE_RETURN_TYPE nptrs = backtrace(backtraceArray, ARRAYSIZE(backtraceArray));
if (nptrs > 0) {
backtrace_symbols_fd(backtraceArray, nptrs, STDERR_FILENO);
} else {
full_write_str(STDERR_FILENO,
"[No backtrace information available from libc]\n"
);
}
#else
#error No implementation for print_backtrace()!
#endif
}
#endif
void CRT_handleSIGSEGV(int signal) {
CRT_done();
char err_buf[512];
snprintf(err_buf, sizeof(err_buf), "\n\n"
"FATAL PROGRAM ERROR DETECTED\n"
"============================\n"
"Please check at https://htop.dev/issues whether this issue has already been reported.\n"
"If no similar issue has been reported before, please create a new issue with the following information:\n"
" - Your %s version: '"VERSION"'\n"
" - Your OS and kernel version (uname -a)\n"
" - Your distribution and release (lsb_release -a)\n"
" - Likely steps to reproduce (How did it happen?)\n",
program
);
full_write_str(STDERR_FILENO, err_buf);
#ifdef PRINT_BACKTRACE
full_write_str(STDERR_FILENO, " - Backtrace of the issue (see below)\n");
#endif
full_write_str(STDERR_FILENO,
"\n"
);
const char* signal_str = strsignal(signal);
if (!signal_str) {
signal_str = "unknown reason";
}
snprintf(err_buf, sizeof(err_buf),
"Error information:\n"
"------------------\n"
"A signal %d (%s) was received.\n"
"\n",
signal, signal_str
);
full_write_str(STDERR_FILENO, err_buf);
full_write_str(STDERR_FILENO,
"Setting information:\n"
"--------------------\n");
Settings_write(CRT_settings, true);
full_write_str(STDERR_FILENO, "\n\n");
#ifdef PRINT_BACKTRACE
full_write_str(STDERR_FILENO,
"Backtrace information:\n"
"----------------------\n"
);
print_backtrace();
snprintf(err_buf, sizeof(err_buf),
"\n"
"To make the above information more practical to work with, "
"please also provide a disassembly of your %s binary. "
"This can usually be done by running the following command:\n"
"\n",
program
);
full_write_str(STDERR_FILENO, err_buf);
#ifdef HTOP_DARWIN
snprintf(err_buf, sizeof(err_buf), " otool -tvV `which %s` > ~/%s.otool\n", program, program);
#else
snprintf(err_buf, sizeof(err_buf), " objdump -d -S -w `which %s` > ~/%s.objdump\n", program, program);
#endif
full_write_str(STDERR_FILENO, err_buf);
full_write_str(STDERR_FILENO,
"\n"
"Please include the generated file in your report.\n"
);
#endif
snprintf(err_buf, sizeof(err_buf),
"Running this program with debug symbols or inside a debugger may provide further insights.\n"
"\n"
"Thank you for helping to improve %s!\n"
"\n",
program
);
full_write_str(STDERR_FILENO, err_buf);
/* Call old sigsegv handler; may be default exit or third party one (e.g. ASAN) */
if (sigaction(signal, &old_sig_handler[signal], NULL) < 0) {
/* This avoids an infinite loop in case the handler could not be reset. */
full_write_str(STDERR_FILENO,
"!!! Chained handler could not be restored. Forcing exit.\n"
);
_exit(1);
}
/* Trigger the previous signal handler. */
raise(signal);
// Always terminate, even if installed handler returns
full_write_str(STDERR_FILENO,
"!!! Chained handler did not exit. Forcing exit.\n"
);
_exit(1);
}
================================================
FILE: CRT.h
================================================
#ifndef HEADER_CRT
#define HEADER_CRT
/*
htop - CRT.h
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
#include <stdbool.h>
#include "Macros.h"
#include "ProvideCurses.h"
#include "Settings.h"
#define SCREEN_TAB_MARGIN_LEFT 2
#define SCREEN_TAB_COLUMN_GAP 1
typedef enum TreeStr_ {
TREE_STR_VERT,
TREE_STR_RTEE,
TREE_STR_BEND,
TREE_STR_TEND,
TREE_STR_OPEN,
TREE_STR_SHUT,
TREE_STR_ASC,
TREE_STR_DESC,
LAST_TREE_STR
} TreeStr;
typedef enum ColorScheme_ {
COLORSCHEME_DEFAULT,
COLORSCHEME_MONOCHROME,
COLORSCHEME_BLACKONWHITE,
COLORSCHEME_LIGHTTERMINAL,
COLORSCHEME_MIDNIGHT,
COLORSCHEME_BLACKNIGHT,
COLORSCHEME_BROKENGRAY,
COLORSCHEME_NORD,
LAST_COLORSCHEME
} ColorScheme;
typedef enum ColorElements_ {
RESET_COLOR,
DEFAULT_COLOR,
FUNCTION_BAR,
FUNCTION_KEY,
FAILED_SEARCH,
FAILED_READ,
PAUSED,
PANEL_HEADER_FOCUS,
PANEL_HEADER_UNFOCUS,
PANEL_SELECTION_FOCUS,
PANEL_SELECTION_FOLLOW,
PANEL_SELECTION_UNFOCUS,
LARGE_NUMBER,
METER_SHADOW,
METER_TEXT,
METER_VALUE,
METER_VALUE_ERROR,
METER_VALUE_IOREAD,
METER_VALUE_IOWRITE,
METER_VALUE_NOTICE,
METER_VALUE_OK,
METER_VALUE_WARN,
LED_COLOR,
UPTIME,
BATTERY,
TASKS_RUNNING,
SWAP,
SWAP_CACHE,
SWAP_FRONTSWAP,
PROCESS,
PROCESS_SHADOW,
PROCESS_TAG,
PROCESS_MEGABYTES,
PROCESS_GIGABYTES,
PROCESS_TREE,
PROCESS_RUN_STATE,
PROCESS_D_STATE,
PROCESS_BASENAME,
PROCESS_HIGH_PRIORITY,
gitextract_iydbaqnr/
├── .editorconfig
├── .github/
│ ├── FUNDING.yml
│ ├── dependabot.yml
│ └── workflows/
│ ├── build_release.yml
│ ├── ci.yml
│ ├── codeql-analysis.yml
│ ├── coverity.yml
│ └── htoprc
├── .gitignore
├── .travis.yml
├── AUTHORS
├── Action.c
├── Action.h
├── Affinity.c
├── Affinity.h
├── AffinityPanel.c
├── AffinityPanel.h
├── AvailableColumnsPanel.c
├── AvailableColumnsPanel.h
├── AvailableMetersPanel.c
├── AvailableMetersPanel.h
├── BatteryMeter.c
├── BatteryMeter.h
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── COPYING
├── CPUMeter.c
├── CPUMeter.h
├── CRT.c
├── CRT.h
├── CategoriesPanel.c
├── CategoriesPanel.h
├── ChangeLog
├── ClockMeter.c
├── ClockMeter.h
├── ColorsPanel.c
├── ColorsPanel.h
├── ColumnsPanel.c
├── ColumnsPanel.h
├── CommandLine.c
├── CommandLine.h
├── CommandScreen.c
├── CommandScreen.h
├── DateTimeMeter.c
├── DateTimeMeter.h
├── Debug.h
├── DiskIOMeter.c
├── DiskIOMeter.h
├── DisplayOptionsPanel.c
├── DisplayOptionsPanel.h
├── DynamicColumn.c
├── DynamicColumn.h
├── DynamicMeter.c
├── DynamicMeter.h
├── DynamicScreen.c
├── DynamicScreen.h
├── EnvScreen.c
├── EnvScreen.h
├── FileDescriptorMeter.c
├── FileDescriptorMeter.h
├── FunctionBar.c
├── FunctionBar.h
├── GPUMeter.c
├── GPUMeter.h
├── Hashtable.c
├── Hashtable.h
├── Header.c
├── Header.h
├── HeaderLayout.h
├── HeaderOptionsPanel.c
├── HeaderOptionsPanel.h
├── HostnameMeter.c
├── HostnameMeter.h
├── IncSet.c
├── IncSet.h
├── InfoScreen.c
├── InfoScreen.h
├── ListItem.c
├── ListItem.h
├── LoadAverageMeter.c
├── LoadAverageMeter.h
├── Machine.c
├── Machine.h
├── Macros.h
├── MainPanel.c
├── MainPanel.h
├── Makefile.am
├── MemoryMeter.c
├── MemoryMeter.h
├── MemorySwapMeter.c
├── MemorySwapMeter.h
├── Meter.c
├── Meter.h
├── MeterMode.h
├── MetersPanel.c
├── MetersPanel.h
├── NEWS
├── NetworkIOMeter.c
├── NetworkIOMeter.h
├── Object.c
├── Object.h
├── OpenFilesScreen.c
├── OpenFilesScreen.h
├── OptionItem.c
├── OptionItem.h
├── Panel.c
├── Panel.h
├── Process.c
├── Process.h
├── ProcessLocksScreen.c
├── ProcessLocksScreen.h
├── ProcessTable.c
├── ProcessTable.h
├── ProvideCurses.h
├── ProvideTerm.h
├── README.md
├── RichString.c
├── RichString.h
├── Row.c
├── Row.h
├── RowField.h
├── Scheduling.c
├── Scheduling.h
├── ScreenManager.c
├── ScreenManager.h
├── ScreenTabsPanel.c
├── ScreenTabsPanel.h
├── ScreensPanel.c
├── ScreensPanel.h
├── Settings.c
├── Settings.h
├── SignalsPanel.c
├── SignalsPanel.h
├── SwapMeter.c
├── SwapMeter.h
├── SysArchMeter.c
├── SysArchMeter.h
├── TESTPLAN
├── Table.c
├── Table.h
├── TasksMeter.c
├── TasksMeter.h
├── TraceScreen.c
├── TraceScreen.h
├── UptimeMeter.c
├── UptimeMeter.h
├── UsersTable.c
├── UsersTable.h
├── Vector.c
├── Vector.h
├── XUtils.c
├── XUtils.h
├── autogen.sh
├── check-pcp-style.sh
├── configure.ac
├── darwin/
│ ├── DarwinMachine.c
│ ├── DarwinMachine.h
│ ├── DarwinProcess.c
│ ├── DarwinProcess.h
│ ├── DarwinProcessTable.c
│ ├── DarwinProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ ├── PlatformHelpers.c
│ ├── PlatformHelpers.h
│ └── ProcessField.h
├── docs/
│ ├── ai-contributions-policy.md
│ └── styleguide.md
├── dragonflybsd/
│ ├── DragonFlyBSDMachine.c
│ ├── DragonFlyBSDMachine.h
│ ├── DragonFlyBSDProcess.c
│ ├── DragonFlyBSDProcess.h
│ ├── DragonFlyBSDProcessTable.c
│ ├── DragonFlyBSDProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ └── ProcessField.h
├── freebsd/
│ ├── FreeBSDMachine.c
│ ├── FreeBSDMachine.h
│ ├── FreeBSDProcess.c
│ ├── FreeBSDProcess.h
│ ├── FreeBSDProcessTable.c
│ ├── FreeBSDProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ └── ProcessField.h
├── generic/
│ ├── fdstat_sysctl.c
│ ├── fdstat_sysctl.h
│ ├── gettime.c
│ ├── gettime.h
│ ├── hostname.c
│ ├── hostname.h
│ ├── openzfs_sysctl.c
│ ├── openzfs_sysctl.h
│ ├── uname.c
│ └── uname.h
├── htop.1.in
├── htop.c
├── htop.desktop
├── iwyu/
│ ├── htop.imp
│ └── run_iwyu.sh
├── linux/
│ ├── CGroupUtils.c
│ ├── CGroupUtils.h
│ ├── Compat.c
│ ├── Compat.h
│ ├── GPU.c
│ ├── GPU.h
│ ├── HugePageMeter.c
│ ├── HugePageMeter.h
│ ├── IOPriority.h
│ ├── IOPriorityPanel.c
│ ├── IOPriorityPanel.h
│ ├── LibNl.c
│ ├── LibNl.h
│ ├── LibSensors.c
│ ├── LibSensors.h
│ ├── LinuxMachine.c
│ ├── LinuxMachine.h
│ ├── LinuxProcess.c
│ ├── LinuxProcess.h
│ ├── LinuxProcessTable.c
│ ├── LinuxProcessTable.h
│ ├── OpenRCMeter.c
│ ├── OpenRCMeter.h
│ ├── Platform.c
│ ├── Platform.h
│ ├── PressureStallMeter.c
│ ├── PressureStallMeter.h
│ ├── ProcessField.h
│ ├── SELinuxMeter.c
│ ├── SELinuxMeter.h
│ ├── SystemdMeter.c
│ ├── SystemdMeter.h
│ ├── ZramMeter.c
│ ├── ZramMeter.h
│ ├── ZramStats.h
│ └── ZswapStats.h
├── netbsd/
│ ├── NetBSDMachine.c
│ ├── NetBSDMachine.h
│ ├── NetBSDProcess.c
│ ├── NetBSDProcess.h
│ ├── NetBSDProcessTable.c
│ ├── NetBSDProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ ├── ProcessField.h
│ └── README.md
├── openbsd/
│ ├── OpenBSDMachine.c
│ ├── OpenBSDMachine.h
│ ├── OpenBSDProcess.c
│ ├── OpenBSDProcess.h
│ ├── OpenBSDProcessTable.c
│ ├── OpenBSDProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ └── ProcessField.h
├── pcp/
│ ├── InDomTable.c
│ ├── InDomTable.h
│ ├── Instance.c
│ ├── Instance.h
│ ├── Metric.c
│ ├── Metric.h
│ ├── PCPDynamicColumn.c
│ ├── PCPDynamicColumn.h
│ ├── PCPDynamicMeter.c
│ ├── PCPDynamicMeter.h
│ ├── PCPDynamicScreen.c
│ ├── PCPDynamicScreen.h
│ ├── PCPMachine.c
│ ├── PCPMachine.h
│ ├── PCPProcess.c
│ ├── PCPProcess.h
│ ├── PCPProcessTable.c
│ ├── PCPProcessTable.h
│ ├── Platform.c
│ ├── Platform.h
│ ├── ProcessField.h
│ ├── columns/
│ │ ├── container
│ │ ├── delayacct
│ │ ├── fdcount
│ │ ├── gpu_memory
│ │ ├── guest
│ │ ├── memory
│ │ ├── sched
│ │ ├── swap
│ │ ├── tcp
│ │ ├── udp
│ │ └── wchan
│ ├── meters/
│ │ ├── entropy
│ │ ├── freespace
│ │ ├── gpu
│ │ ├── ipc
│ │ ├── locks
│ │ ├── memcache
│ │ ├── mysql
│ │ ├── postfix
│ │ ├── redis
│ │ └── tcp
│ └── screens/
│ ├── biosnoop
│ ├── cgroups
│ ├── cgroupsio
│ ├── cgroupsmem
│ ├── devices
│ ├── execsnoop
│ ├── exitsnoop
│ ├── filesystems
│ └── opensnoop
├── pcp-htop.5.in
├── pcp-htop.c
├── scripts/
│ ├── htop_suppressions.valgrind
│ └── run_valgrind.sh
├── solaris/
│ ├── Platform.c
│ ├── Platform.h
│ ├── ProcessField.h
│ ├── SolarisMachine.c
│ ├── SolarisMachine.h
│ ├── SolarisProcess.c
│ ├── SolarisProcess.h
│ ├── SolarisProcessTable.c
│ └── SolarisProcessTable.h
├── test_spec.lua
├── unsupported/
│ ├── Platform.c
│ ├── Platform.h
│ ├── ProcessField.h
│ ├── UnsupportedMachine.c
│ ├── UnsupportedMachine.h
│ ├── UnsupportedProcess.c
│ ├── UnsupportedProcess.h
│ ├── UnsupportedProcessTable.c
│ └── UnsupportedProcessTable.h
└── zfs/
├── ZfsArcMeter.c
├── ZfsArcMeter.h
├── ZfsArcStats.h
├── ZfsCompressedArcMeter.c
└── ZfsCompressedArcMeter.h
SYMBOL INDEX (1659 symbols across 234 files)
FILE: Action.c
function Object (line 53) | Object* Action_pickFromVector(State* st, Panel* list, int x, bool follow) {
function Action_runSetup (line 95) | static void Action_runSetup(State* st) {
function changePriority (line 107) | static bool changePriority(MainPanel* panel, int delta) {
function addUserToVector (line 115) | static void addUserToVector(ht_key_t key, void* userCast, void* panelCas...
function Action_setUserOnly (line 121) | bool Action_setUserOnly(const char* userName, uid_t* userId) {
function tagAllChildren (line 131) | static void tagAllChildren(Panel* panel, Row* parent) {
function expandCollapse (line 142) | static bool expandCollapse(Panel* panel) {
function collapseIntoParent (line 151) | static bool collapseIntoParent(Panel* panel) {
function Htop_Reaction (line 168) | Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey) {
function Action_writeableProcess (line 175) | static bool Action_writeableProcess(State* st) {
function Action_readableProcess (line 181) | static bool Action_readableProcess(State* st) {
function Htop_Reaction (line 186) | static Htop_Reaction actionSetSortColumn(State* st) {
function Htop_Reaction (line 221) | static Htop_Reaction actionSortByPID(State* st) {
function Htop_Reaction (line 225) | static Htop_Reaction actionSortByMemory(State* st) {
function Htop_Reaction (line 229) | static Htop_Reaction actionSortByCPU(State* st) {
function Htop_Reaction (line 233) | static Htop_Reaction actionSortByTime(State* st) {
function Htop_Reaction (line 237) | static Htop_Reaction actionToggleKernelThreads(State* st) {
function Htop_Reaction (line 247) | static Htop_Reaction actionToggleUserlandThreads(State* st) {
function Htop_Reaction (line 257) | static Htop_Reaction actionToggleRunningInContainer(State* st) {
function Htop_Reaction (line 265) | static Htop_Reaction actionToggleProgramPath(State* st) {
function Htop_Reaction (line 273) | static Htop_Reaction actionToggleMergedCommand(State* st) {
function Htop_Reaction (line 281) | static Htop_Reaction actionToggleTreeView(State* st) {
function Htop_Reaction (line 294) | static Htop_Reaction actionToggleHideMeters(State* st) {
function Htop_Reaction (line 299) | static Htop_Reaction actionExpandOrCollapseAllBranches(State* st) {
function Htop_Reaction (line 313) | static Htop_Reaction actionIncFilter(State* st) {
function Htop_Reaction (line 321) | static Htop_Reaction actionIncSearch(State* st) {
function Htop_Reaction (line 327) | static Htop_Reaction actionHigherPriority(State* st) {
function Htop_Reaction (line 335) | static Htop_Reaction actionLowerPriority(State* st) {
function Htop_Reaction (line 343) | static Htop_Reaction actionInvertSortOrder(State* st) {
function Htop_Reaction (line 350) | static Htop_Reaction actionExpandOrCollapse(State* st) {
function Htop_Reaction (line 358) | static Htop_Reaction actionCollapseIntoParent(State* st) {
function Htop_Reaction (line 366) | static Htop_Reaction actionExpandCollapseOrSortColumn(State* st) {
function setActiveScreen (line 370) | static inline void setActiveScreen(Settings* settings, State* st, unsign...
function Htop_Reaction (line 384) | static Htop_Reaction actionNextScreen(State* st) {
function Htop_Reaction (line 394) | static Htop_Reaction actionPrevScreen(State* st) {
function Htop_Reaction (line 405) | Htop_Reaction Action_setScreenTab(State* st, int x) {
function Htop_Reaction (line 433) | static Htop_Reaction actionQuit(ATTR_UNUSED State* st) {
function Htop_Reaction (line 437) | static Htop_Reaction actionSetAffinity(State* st) {
function Htop_Reaction (line 474) | static Htop_Reaction actionSetSchedPolicy(State* st) {
function Htop_Reaction (line 518) | static Htop_Reaction actionKill(State* st) {
function Htop_Reaction (line 542) | static Htop_Reaction actionFilterByUser(State* st) {
function Htop_Reaction (line 562) | Htop_Reaction Action_follow(State* st) {
function Htop_Reaction (line 568) | static Htop_Reaction actionSetup(State* st) {
function Htop_Reaction (line 573) | static Htop_Reaction actionLsof(State* st) {
function Htop_Reaction (line 591) | static Htop_Reaction actionShowLocks(State* st) {
function Htop_Reaction (line 609) | static Htop_Reaction actionStrace(State* st) {
function Htop_Reaction (line 630) | static Htop_Reaction actionTag(State* st) {
function Htop_Reaction (line 640) | static Htop_Reaction actionRedraw(ATTR_UNUSED State* st) {
function Htop_Reaction (line 646) | static Htop_Reaction actionTogglePauseUpdate(State* st) {
function addattrstr (line 708) | static inline void addattrstr( int attr, const char* str) {
function Htop_Reaction (line 713) | static Htop_Reaction actionHelp(State* st) {
function Htop_Reaction (line 856) | static Htop_Reaction actionUntagAll(State* st) {
function Htop_Reaction (line 864) | static Htop_Reaction actionTagAllChildren(State* st) {
function Htop_Reaction (line 873) | static Htop_Reaction actionShowEnvScreen(State* st) {
function Htop_Reaction (line 891) | static Htop_Reaction actionShowCommandScreen(State* st) {
function Action_setBindings (line 909) | void Action_setBindings(Htop_Action* keys) {
FILE: Action.h
type Htop_Reaction (line 21) | typedef enum {
type MainPanel_ (line 33) | struct MainPanel_
type State (line 35) | typedef struct State_ {
function State_hideFunctionBar (line 45) | static inline bool State_hideFunctionBar(const State* st) {
type Htop_Reaction (line 50) | typedef Htop_Reaction (*Htop_Action)(State* st);
FILE: Affinity.c
function Affinity (line 32) | Affinity* Affinity_new(Machine* host) {
function Affinity_delete (line 40) | void Affinity_delete(Affinity* this) {
function Affinity_add (line 45) | void Affinity_add(Affinity* this, unsigned int id) {
function Affinity (line 56) | static Affinity* Affinity_get(const Process* p, Machine* host) {
function Affinity_set (line 77) | static bool Affinity_set(Process* p, Arg arg) {
function Affinity (line 90) | static Affinity* Affinity_get(const Process* p, Machine* host) {
function Affinity_set (line 105) | static bool Affinity_set(Process* p, Arg arg) {
function Affinity_rowSet (line 120) | bool Affinity_rowSet(Row* row, Arg arg) {
function Affinity (line 126) | Affinity* Affinity_rowGet(const Row* row, Machine* host) {
FILE: Affinity.h
type Affinity (line 26) | typedef struct Affinity_ {
FILE: AffinityPanel.c
type MaskItem (line 33) | typedef struct MaskItem_ {
function MaskItem_delete (line 48) | static void MaskItem_delete(Object* cast) {
function MaskItem_display (line 60) | static void MaskItem_display(const Object* cast, RichString* out) {
function MaskItem (line 91) | static MaskItem* MaskItem_newMask(const char* text, const char* indent, ...
function MaskItem (line 105) | static MaskItem* MaskItem_newSingleton(const char* text, int cpu, bool i...
type AffinityPanel (line 124) | typedef struct AffinityPanel_ {
function AffinityPanel_delete (line 138) | static void AffinityPanel_delete(Object* cast) {
function AffinityPanel_updateItem (line 151) | static void AffinityPanel_updateItem(AffinityPanel* this, MaskItem* item) {
function AffinityPanel_updateTopo (line 160) | static void AffinityPanel_updateTopo(AffinityPanel* this, MaskItem* item) {
function AffinityPanel_update (line 172) | static void AffinityPanel_update(AffinityPanel* this, bool keepSelected) {
function HandlerResult (line 198) | static HandlerResult AffinityPanel_eventHandler(Panel* super, int ch) {
function MaskItem (line 277) | static MaskItem* AffinityPanel_addObject(AffinityPanel* this, hwloc_obj_...
function MaskItem (line 335) | static MaskItem* AffinityPanel_buildTopology(AffinityPanel* this, hwloc_...
function Panel (line 373) | Panel* AffinityPanel_new(Machine* host, const Affinity* affinity, int* w...
function Affinity (line 437) | Affinity* AffinityPanel_getAffinity(Panel* super, Machine* host) {
FILE: AvailableColumnsPanel.c
function AvailableColumnsPanel_delete (line 32) | static void AvailableColumnsPanel_delete(Object* object) {
function AvailableColumnsPanel_insert (line 38) | static void AvailableColumnsPanel_insert(AvailableColumnsPanel* this, in...
function HandlerResult (line 47) | static HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, in...
function AvailableColumnsPanel_addDynamicColumn (line 82) | static void AvailableColumnsPanel_addDynamicColumn(ht_key_t key, void* v...
function AvailableColumnsPanel_addDynamicColumns (line 98) | static void AvailableColumnsPanel_addDynamicColumns(AvailableColumnsPane...
function AvailableColumnsPanel_addPlatformColumns (line 104) | static void AvailableColumnsPanel_addPlatformColumns(AvailableColumnsPan...
function AvailableColumnsPanel_addDynamicScreens (line 115) | static void AvailableColumnsPanel_addDynamicScreens(AvailableColumnsPane...
function AvailableColumnsPanel_fill (line 119) | void AvailableColumnsPanel_fill(AvailableColumnsPanel* this, const char*...
function AvailableColumnsPanel (line 129) | AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns, Hashtab...
FILE: AvailableColumnsPanel.h
type AvailableColumnsPanel (line 14) | typedef struct AvailableColumnsPanel_ {
FILE: AvailableMetersPanel.c
function AvailableMetersPanel_delete (line 32) | static void AvailableMetersPanel_delete(Object* object) {
function AvailableMetersPanel_addMeter (line 39) | static inline void AvailableMetersPanel_addMeter(Header* header, MetersP...
function HandlerResult (line 46) | static HandlerResult AvailableMetersPanel_eventHandler(Panel* super, int...
function AvailableMetersPanel_addCPUMeters (line 101) | static void AvailableMetersPanel_addCPUMeters(Panel* super, const MeterC...
type DynamicIterator (line 114) | typedef struct {
function AvailableMetersPanel_addDynamicMeter (line 120) | static void AvailableMetersPanel_addDynamicMeter(ATTR_UNUSED ht_key_t ke...
function AvailableMetersPanel_addDynamicMeters (line 132) | static void AvailableMetersPanel_addDynamicMeters(Panel* super, const Se...
function AvailableMetersPanel_addPlatformMeter (line 140) | static void AvailableMetersPanel_addPlatformMeter(Panel* super, const Me...
function AvailableMetersPanel (line 145) | AvailableMetersPanel* AvailableMetersPanel_new(Machine* host, Header* he...
FILE: AvailableMetersPanel.h
type AvailableMetersPanel (line 19) | typedef struct AvailableMetersPanel_ {
FILE: BatteryMeter.c
function BatteryMeter_updateValues (line 27) | static void BatteryMeter_updateValues(Meter* this) {
FILE: BatteryMeter.h
type ACPresence (line 15) | typedef enum ACPresence_ {
FILE: CPUMeter.c
type CPUMeterData (line 46) | typedef struct CPUMeterData_ {
function CPUMeter_init (line 51) | static void CPUMeter_init(Meter* this) {
function CPUMeter_getUiName (line 64) | static void CPUMeter_getUiName(const Meter* this, char* buffer, size_t l...
function CPUMeter_updateValues (line 73) | static void CPUMeter_updateValues(Meter* this) {
function CPUMeter_display (line 133) | static void CPUMeter_display(const Object* cast, RichString* out) {
function AllCPUsMeter_getRange (line 222) | static void AllCPUsMeter_getRange(const Meter* this, int* start, int* co...
function AllCPUsMeter_updateValues (line 241) | static void AllCPUsMeter_updateValues(Meter* this) {
function CPUMeterCommonInit (line 250) | static void CPUMeterCommonInit(Meter* this) {
function CPUMeterCommonUpdateMode (line 271) | static void CPUMeterCommonUpdateMode(Meter* this, MeterModeId mode, int ...
function AllCPUsMeter_done (line 289) | static void AllCPUsMeter_done(Meter* this) {
function SingleColCPUsMeter_updateMode (line 300) | static void SingleColCPUsMeter_updateMode(Meter* this, MeterModeId mode) {
function DualColCPUsMeter_updateMode (line 304) | static void DualColCPUsMeter_updateMode(Meter* this, MeterModeId mode) {
function QuadColCPUsMeter_updateMode (line 308) | static void QuadColCPUsMeter_updateMode(Meter* this, MeterModeId mode) {
function OctoColCPUsMeter_updateMode (line 312) | static void OctoColCPUsMeter_updateMode(Meter* this, MeterModeId mode) {
function CPUMeterCommonDraw (line 316) | static void CPUMeterCommonDraw(Meter* this, int x, int y, int w, int nco...
function DualColCPUsMeter_draw (line 332) | static void DualColCPUsMeter_draw(Meter* this, int x, int y, int w) {
function QuadColCPUsMeter_draw (line 336) | static void QuadColCPUsMeter_draw(Meter* this, int x, int y, int w) {
function OctoColCPUsMeter_draw (line 340) | static void OctoColCPUsMeter_draw(Meter* this, int x, int y, int w) {
function SingleColCPUsMeter_draw (line 345) | static void SingleColCPUsMeter_draw(Meter* this, int x, int y, int w) {
FILE: CPUMeter.h
type CPUMeterValues (line 13) | typedef enum {
FILE: CRT.c
function initDegreeSign (line 109) | static void initDegreeSign(void) {
function ATTR_NORETURN (line 960) | ATTR_NORETURN
function createStderrCacheFile (line 984) | static int createStderrCacheFile(void) {
function redirectStderr (line 1003) | static void redirectStderr(void) {
function dumpStderr (line 1014) | static void dumpStderr(void) {
function CRT_debug_impl (line 1056) | void CRT_debug_impl(const char* file, size_t lineno, const char* func, c...
function redirectStderr (line 1068) | static void redirectStderr(void) {
function dumpStderr (line 1071) | static void dumpStderr(void) {
type sigaction (line 1076) | struct sigaction
function CRT_installSignalHandlers (line 1078) | static void CRT_installSignalHandlers(void) {
function CRT_resetSignalHandlers (line 1103) | void CRT_resetSignalHandlers(void) {
function CRT_setMouse (line 1120) | void CRT_setMouse(bool enabled) {
function terminalSupportsDefinedKeys (line 1133) | static bool terminalSupportsDefinedKeys(const char* termType) {
function CRT_done (line 1285) | void CRT_done(void) {
function CRT_fatalError (line 1303) | void CRT_fatalError(const char* note) {
function CRT_readKey (line 1310) | int CRT_readKey(void) {
function CRT_disableDelay (line 1319) | void CRT_disableDelay(void) {
function CRT_enableDelay (line 1325) | void CRT_enableDelay(void) {
function CRT_setColors (line 1329) | void CRT_setColors(int colorScheme) {
function print_backtrace (line 1355) | static void print_backtrace(void) {
function CRT_handleSIGSEGV (line 1415) | void CRT_handleSIGSEGV(int signal) {
FILE: CRT.h
type TreeStr (line 20) | typedef enum TreeStr_ {
type ColorScheme (line 32) | typedef enum ColorScheme_ {
type ColorElements (line 44) | typedef enum ColorElements_ {
function CRT_updateDelay (line 223) | static inline void CRT_updateDelay(void) {
FILE: CategoriesPanel.c
function CategoriesPanel_delete (line 37) | static void CategoriesPanel_delete(Object* object) {
function CategoriesPanel_makeMetersPage (line 43) | static void CategoriesPanel_makeMetersPage(CategoriesPanel* this) {
function CategoriesPanel_makeDisplayOptionsPage (line 65) | static void CategoriesPanel_makeDisplayOptionsPage(CategoriesPanel* this) {
function CategoriesPanel_makeColorsPage (line 71) | static void CategoriesPanel_makeColorsPage(CategoriesPanel* this) {
function CategoriesPanel_makeScreenTabsPage (line 78) | static void CategoriesPanel_makeScreenTabsPage(CategoriesPanel* this) {
function CategoriesPanel_makeScreensPage (line 87) | static void CategoriesPanel_makeScreensPage(CategoriesPanel* this) {
function CategoriesPanel_makeHeaderOptionsPage (line 97) | static void CategoriesPanel_makeHeaderOptionsPage(CategoriesPanel* this) {
type CategoriesPanelPage (line 104) | typedef struct CategoriesPanelPage_ {
function HandlerResult (line 120) | static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
function CategoriesPanel (line 172) | CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Header* header,...
FILE: CategoriesPanel.h
type CategoriesPanel (line 16) | typedef struct CategoriesPanel_ {
FILE: ClockMeter.c
function ClockMeter_updateValues (line 24) | static void ClockMeter_updateValues(Meter* this) {
FILE: ColorsPanel.c
function ColorsPanel_delete (line 44) | static void ColorsPanel_delete(Object* object) {
function HandlerResult (line 50) | static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) {
function ColorsPanel (line 92) | ColorsPanel* ColorsPanel_new(Settings* settings) {
FILE: ColorsPanel.h
type ColorsPanel (line 14) | typedef struct ColorsPanel_ {
FILE: ColumnsPanel.c
function ColumnsPanel_delete (line 30) | static void ColumnsPanel_delete(Object* object) {
function HandlerResult (line 36) | static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) {
function ColumnsPanel_add (line 109) | static void ColumnsPanel_add(Panel* super, unsigned int key, Hashtable* ...
function ColumnsPanel_fill (line 128) | void ColumnsPanel_fill(ColumnsPanel* this, ScreenSettings* ss, Hashtable...
function ColumnsPanel (line 136) | ColumnsPanel* ColumnsPanel_new(ScreenSettings* ss, Hashtable* columns, b...
function ColumnsPanel_update (line 153) | void ColumnsPanel_update(Panel* super) {
FILE: ColumnsPanel.h
type ColumnsPanel (line 17) | typedef struct ColumnsPanel_ {
FILE: CommandLine.c
function printVersionFlag (line 49) | static void printVersionFlag(const char* name) {
function printHelpFlag (line 53) | static void printHelpFlag(const char* name) {
type CommandLineSettings (line 83) | typedef struct CommandLineSettings_ {
function CommandLineStatus (line 103) | static CommandLineStatus parseArguments(int argc, char** argv, CommandLi...
function setCommFilter (line 328) | static void setCommFilter(State* state, char** commFilter) {
function CommandLine_run (line 339) | int CommandLine_run(int argc, char** argv) {
FILE: CommandLine.h
type CommandLineStatus (line 11) | typedef enum {
FILE: CommandScreen.c
function CommandScreen_scan (line 22) | static void CommandScreen_scan(InfoScreen* this) {
function CommandScreen_draw (line 68) | static void CommandScreen_draw(InfoScreen* this) {
function CommandScreen (line 81) | CommandScreen* CommandScreen_new(Process* process) {
function CommandScreen_delete (line 86) | void CommandScreen_delete(Object* this) {
FILE: CommandScreen.h
type CommandScreen (line 16) | typedef struct CommandScreen_ {
FILE: DateTimeMeter.c
function DateMeter_updateValues (line 28) | static void DateMeter_updateValues(Meter* this) {
function DateTimeMeter_updateValues (line 36) | static void DateTimeMeter_updateValues(Meter* this) {
FILE: DiskIOMeter.c
type DiskIOMeterData (line 24) | typedef struct DiskIOMeterData_ {
function DiskIOUpdateCache (line 47) | static void DiskIOUpdateCache(const Machine* host) {
function DiskIORateMeter_updateValues (line 116) | static void DiskIORateMeter_updateValues(Meter* this) {
function DiskIORateMeter_display (line 139) | static void DiskIORateMeter_display(ATTR_UNUSED const Object* cast, Rich...
function DiskIOTimeMeter_updateValues (line 163) | static void DiskIOTimeMeter_updateValues(Meter* this) {
function DiskIOTimeMeter_display (line 191) | static void DiskIOTimeMeter_display(ATTR_UNUSED const Object* cast, Rich...
function DiskIOMeter_display (line 221) | static void DiskIOMeter_display(const Object* cast, RichString* out) {
function DiskIOMeter_updateValues (line 237) | static void DiskIOMeter_updateValues(Meter* this) {
function DiskIOMeter_draw (line 244) | static void DiskIOMeter_draw(Meter* this, int x, int y, int w) {
function DiskIOMeter_init (line 265) | static void DiskIOMeter_init(Meter* this) {
function DiskIOMeter_updateMode (line 285) | static void DiskIOMeter_updateMode(Meter* this, MeterModeId mode) {
function DiskIOMeter_done (line 296) | static void DiskIOMeter_done(Meter* this) {
FILE: DiskIOMeter.h
type DiskIOData (line 15) | typedef struct DiskIOData_ {
FILE: DisplayOptionsPanel.c
function DisplayOptionsPanel_delete (line 29) | static void DisplayOptionsPanel_delete(Object* object) {
function HandlerResult (line 36) | static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ...
function DisplayOptionsPanel (line 141) | DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenM...
FILE: DisplayOptionsPanel.h
type DisplayOptionsPanel (line 16) | typedef struct DisplayOptionsPanel_ {
FILE: DynamicColumn.c
function Hashtable (line 22) | Hashtable* DynamicColumns_new(void) {
function DynamicColumns_delete (line 29) | void DynamicColumns_delete(Hashtable* dynamics) {
function DynamicColumn_done (line 40) | void DynamicColumn_done(DynamicColumn* this) {
type DynamicIterator (line 46) | typedef struct {
function DynamicColumn_compare (line 52) | static void DynamicColumn_compare(ht_key_t key, void* value, void* data) {
function DynamicColumn (line 61) | const DynamicColumn* DynamicColumn_search(Hashtable* dynamics, const cha...
function DynamicColumn (line 70) | const DynamicColumn* DynamicColumn_lookup(Hashtable* dynamics, unsigned ...
function DynamicColumn_writeField (line 74) | bool DynamicColumn_writeField(const Process* proc, RichString* str, unsi...
FILE: DynamicColumn.h
type DynamicColumn (line 21) | typedef struct DynamicColumn_ {
FILE: DynamicMeter.c
function Hashtable (line 39) | Hashtable* DynamicMeters_new(void) {
function DynamicMeters_delete (line 43) | void DynamicMeters_delete(Hashtable* dynamics) {
type DynamicIterator (line 50) | typedef struct {
function DynamicMeter_compare (line 56) | static void DynamicMeter_compare(ht_key_t key, void* value, void* data) {
function DynamicMeter_search (line 65) | bool DynamicMeter_search(Hashtable* dynamics, const char* name, ht_key_t...
function DynamicMeter_init (line 79) | static void DynamicMeter_init(Meter* meter) {
function DynamicMeter_updateValues (line 83) | static void DynamicMeter_updateValues(Meter* meter) {
function DynamicMeter_display (line 87) | static void DynamicMeter_display(const Object* cast, RichString* out) {
function DynamicMeter_getUiName (line 100) | static void DynamicMeter_getUiName(const Meter* this, char* name, size_t...
FILE: DynamicMeter.h
type DynamicMeter (line 17) | typedef struct DynamicMeter_ {
FILE: DynamicScreen.c
function Hashtable (line 22) | Hashtable* DynamicScreens_new(void) {
function DynamicScreens_delete (line 26) | void DynamicScreens_delete(Hashtable* screens) {
function DynamicScreen_done (line 33) | void DynamicScreen_done(DynamicScreen* this) {
type DynamicIterator (line 41) | typedef struct {
function DynamicScreen_compare (line 47) | static void DynamicScreen_compare(ht_key_t key, void* value, void* data) {
function DynamicScreen_search (line 56) | bool DynamicScreen_search(Hashtable* screens, const char* name, ht_key_t...
FILE: DynamicScreen.h
type DynamicScreen (line 16) | typedef struct DynamicScreen_ {
FILE: EnvScreen.c
function EnvScreen (line 25) | EnvScreen* EnvScreen_new(Process* process) {
function EnvScreen_delete (line 31) | void EnvScreen_delete(Object* this) {
function EnvScreen_draw (line 35) | static void EnvScreen_draw(InfoScreen* this) {
function EnvScreen_scan (line 39) | static void EnvScreen_scan(InfoScreen* this) {
FILE: EnvScreen.h
type EnvScreen (line 17) | typedef struct EnvScreen_ {
FILE: FileDescriptorMeter.c
function FileDescriptorMeter_updateValues (line 30) | static void FileDescriptorMeter_updateValues(Meter* this) {
function FileDescriptorMeter_display (line 80) | static void FileDescriptorMeter_display(const Object* cast, RichString* ...
FILE: FunctionBar.c
function FunctionBar (line 35) | FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc) {
function FunctionBar (line 40) | FunctionBar* FunctionBar_new(const char* const* functions, const char* c...
function FunctionBar_delete (line 67) | void FunctionBar_delete(FunctionBar* this) {
function FunctionBar_setLabel (line 83) | void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) {
function FunctionBar_draw (line 94) | int FunctionBar_draw(const FunctionBar* this) {
function FunctionBar_drawExtra (line 98) | int FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, i...
function FunctionBar_append (line 137) | void FunctionBar_append(const char* buffer, int attr) {
function FunctionBar_synthesizeEvent (line 149) | int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos) {
FILE: FunctionBar.h
type FunctionBar (line 14) | typedef struct FunctionBar_ {
FILE: GPUMeter.c
type GPUMeterEngineData (line 20) | struct GPUMeterEngineData
function GPUMeter_active (line 34) | bool GPUMeter_active(void) {
function humanTimeUnit (line 38) | static int humanTimeUnit(char* buffer, size_t size, unsigned long long i...
function GPUMeter_updateValues (line 82) | static void GPUMeter_updateValues(Meter* this) {
function GPUMeter_display (line 94) | static void GPUMeter_display(const Object* cast, RichString* out) {
function GPUMeter_init (line 137) | static void GPUMeter_init(Meter* this ATTR_UNUSED) {
function GPUMeter_done (line 141) | static void GPUMeter_done(Meter* this ATTR_UNUSED) {
FILE: GPUMeter.h
type GPUMeterEngineData (line 15) | struct GPUMeterEngineData {
type GPUMeterEngineData (line 21) | struct GPUMeterEngineData
FILE: Hashtable.c
type HashtableItem (line 26) | typedef struct HashtableItem_ {
type Hashtable_ (line 32) | struct Hashtable_ {
function Hashtable_dump (line 42) | static void Hashtable_dump(const Hashtable* this) {
function Hashtable_isConsistent (line 67) | static bool Hashtable_isConsistent(const Hashtable* this) {
function Hashtable_count (line 79) | size_t Hashtable_count(const Hashtable* this) {
function nextPrime (line 106) | static size_t nextPrime(size_t n) {
function Hashtable (line 117) | Hashtable* Hashtable_new(size_t size, bool owner) {
function Hashtable_delete (line 132) | void Hashtable_delete(Hashtable* this) {
function Hashtable_clear (line 139) | void Hashtable_clear(Hashtable* this) {
function insert (line 152) | static void insert(Hashtable* this, ht_key_t key, void* value) {
function Hashtable_setSize (line 195) | void Hashtable_setSize(Hashtable* this, size_t size) {
function Hashtable_put (line 226) | void Hashtable_put(Hashtable* this, ht_key_t key, void* value) {
function Hashtable_foreach (line 330) | void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* ...
FILE: Hashtable.h
type ht_key_t (line 14) | typedef unsigned int ht_key_t;
type Hashtable (line 18) | typedef struct Hashtable_ Hashtable;
FILE: Header.c
function Header (line 31) | Header* Header_new(Machine* host, HeaderLayout hLayout) {
function Header_delete (line 44) | void Header_delete(Header* this) {
function Header_setLayout (line 53) | void Header_setLayout(Header* this, HeaderLayout hLayout) {
function Header_addMeterByName (line 80) | static void Header_addMeterByName(Header* this, const char* name, MeterM...
function Header_populateFromSettings (line 120) | void Header_populateFromSettings(Header* this) {
function Header_writeBackToSettings (line 135) | void Header_writeBackToSettings(const Header* this) {
function Meter (line 173) | Meter* Header_addMeterByClass(Header* this, const MeterClass* type, unsi...
function Header_reinit (line 183) | void Header_reinit(Header* this) {
function Header_draw (line 194) | void Header_draw(const Header* this) {
function Header_updateData (line 240) | void Header_updateData(Header* this) {
function calcColumnWidthCount (line 256) | static int calcColumnWidthCount(const Header* this, const Meter* curMete...
function Header_calculateHeight (line 279) | int Header_calculateHeight(Header* this) {
FILE: Header.h
type Header (line 18) | typedef struct Header_ {
FILE: HeaderLayout.h
type HeaderLayout (line 18) | typedef enum HeaderLayout_ {
function HeaderLayout_getColumns (line 57) | static inline size_t HeaderLayout_getColumns(HeaderLayout hLayout) {
function HeaderLayout (line 75) | static inline HeaderLayout HeaderLayout_fromName(const char* name) {
FILE: HeaderOptionsPanel.c
function HeaderOptionsPanel_delete (line 27) | static void HeaderOptionsPanel_delete(Object* object) {
function HandlerResult (line 33) | static HandlerResult HeaderOptionsPanel_eventHandler(Panel* super, int c...
function HeaderOptionsPanel (line 74) | HeaderOptionsPanel* HeaderOptionsPanel_new(Settings* settings, ScreenMan...
FILE: HeaderOptionsPanel.h
type HeaderOptionsPanel (line 15) | typedef struct HeaderOptionsPanel_ {
FILE: HostnameMeter.c
function HostnameMeter_updateValues (line 21) | static void HostnameMeter_updateValues(Meter* this) {
FILE: IncSet.c
function IncMode_reset (line 23) | static void IncMode_reset(IncMode* mode) {
function IncSet_reset (line 28) | void IncSet_reset(IncSet* this, IncType type) {
function IncSet_setFilter (line 32) | void IncSet_setFilter(IncSet* this, const char* filter) {
function IncMode_initSearch (line 43) | static inline void IncMode_initSearch(IncMode* search) {
function IncMode_initFilter (line 53) | static inline void IncMode_initFilter(IncMode* filter) {
function IncMode_done (line 59) | static inline void IncMode_done(IncMode* mode) {
function IncSet (line 63) | IncSet* IncSet_new(FunctionBar* bar) {
function IncSet_delete (line 74) | void IncSet_delete(IncSet* this) {
function updateWeakPanel (line 80) | static void updateWeakPanel(const IncSet* this, Panel* panel, Vector* li...
function search (line 108) | static bool search(const IncSet* this, Panel* panel, IncMode_GetPanelVal...
function IncSet_activate (line 120) | void IncSet_activate(IncSet* this, IncType type, Panel* panel) {
function IncSet_deactivate (line 128) | static void IncSet_deactivate(IncSet* this, Panel* panel) {
function IncMode_find (line 135) | static bool IncMode_find(const IncMode* mode, Panel* panel, IncMode_GetP...
function IncSet_handleKey (line 158) | bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPan...
function IncSet_drawBar (line 236) | void IncSet_drawBar(const IncSet* this, int attr) {
function IncSet_synthesizeEvent (line 248) | int IncSet_synthesizeEvent(IncSet* this, int x) {
FILE: IncSet.h
type IncType (line 20) | typedef enum {
type IncMode (line 25) | typedef struct IncMode_ {
type IncSet (line 32) | typedef struct IncSet_ {
FILE: InfoScreen.c
function InfoScreen (line 31) | InfoScreen* InfoScreen_init(InfoScreen* this, const Process* process, Fu...
function InfoScreen (line 43) | InfoScreen* InfoScreen_done(InfoScreen* this) {
function InfoScreen_drawTitled (line 50) | void InfoScreen_drawTitled(InfoScreen* this, const char* fmt, ...) {
function InfoScreen_addLine (line 71) | void InfoScreen_addLine(InfoScreen* this, const char* line) {
function InfoScreen_appendLine (line 79) | void InfoScreen_appendLine(InfoScreen* this, const char* line) {
function InfoScreen_run (line 94) | void InfoScreen_run(InfoScreen* this) {
FILE: InfoScreen.h
type InfoScreen (line 22) | typedef struct InfoScreen_ {
type InfoScreenClass (line 35) | typedef struct InfoScreenClass_ {
FILE: ListItem.c
function ListItem_delete (line 21) | void ListItem_delete(Object* cast) {
function ListItem_display (line 27) | void ListItem_display(const Object* cast, RichString* out) {
function ListItem_init (line 41) | void ListItem_init(ListItem* this, const char* value, int key) {
function ListItem (line 47) | ListItem* ListItem_new(const char* value, int key) {
function ListItem_append (line 53) | void ListItem_append(ListItem* this, const char* text) {
function ListItem_compare (line 62) | int ListItem_compare(const void* cast1, const void* cast2) {
FILE: ListItem.h
type ListItem (line 16) | typedef struct ListItem_ {
FILE: LoadAverageMeter.c
function LoadAverageMeter_updateValues (line 42) | static void LoadAverageMeter_updateValues(Meter* this) {
function LoadAverageMeter_display (line 63) | static void LoadAverageMeter_display(const Object* cast, RichString* out) {
function LoadMeter_updateValues (line 76) | static void LoadMeter_updateValues(Meter* this) {
function LoadMeter_display (line 95) | static void LoadMeter_display(const Object* cast, RichString* out) {
FILE: Machine.c
function Machine_done (line 53) | void Machine_done(Machine* this) {
function Machine_addTable (line 63) | static void Machine_addTable(Machine* this, Table* table) {
function Machine_populateTablesFromSettings (line 76) | void Machine_populateTablesFromSettings(Machine* this, Settings* setting...
function Machine_setTablesPanel (line 94) | void Machine_setTablesPanel(Machine* this, Panel* panel) {
function Machine_scanTables (line 100) | void Machine_scanTables(Machine* this) {
FILE: Machine.h
type memory_t (line 35) | typedef unsigned long long int memory_t;
type Machine (line 38) | typedef struct Machine_ {
FILE: Macros.h
function isNaN (line 135) | static inline bool isNaN(double x) {
function isNonnegative (line 141) | static inline bool isNonnegative(double x) {
function isPositive (line 146) | static inline bool isPositive(double x) {
function saturatingSub (line 151) | static inline unsigned long long saturatingSub(unsigned long long a, uns...
FILE: MainPanel.c
function MainPanel_updateLabels (line 32) | void MainPanel_updateLabels(MainPanel* this, bool list, bool filter) {
function MainPanel_idSearch (line 38) | static void MainPanel_idSearch(MainPanel* this, int ch) {
function HandlerResult (line 59) | static HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
function MainPanel_selectedRow (line 158) | int MainPanel_selectedRow(MainPanel* this) {
function MainPanel_foreachRow (line 163) | bool MainPanel_foreachRow(MainPanel* this, MainPanel_foreachRowFn fn, Ar...
function MainPanel_drawFunctionBar (line 187) | static void MainPanel_drawFunctionBar(Panel* super, bool hideFunctionBar) {
function MainPanel_printHeader (line 202) | static void MainPanel_printHeader(Panel* super) {
function MainPanel (line 218) | MainPanel* MainPanel_new(void) {
function MainPanel_setState (line 233) | void MainPanel_setState(MainPanel* this, State* state) {
function MainPanel_setFunctionBar (line 237) | void MainPanel_setFunctionBar(MainPanel* this, bool readonly) {
function MainPanel_delete (line 242) | void MainPanel_delete(Object* object) {
FILE: MainPanel.h
type MainPanel (line 21) | typedef struct MainPanel_ {
FILE: MemoryMeter.c
function MemoryMeter_updateValues (line 33) | static void MemoryMeter_updateValues(Meter* this) {
function MemoryMeter_display (line 73) | static void MemoryMeter_display(const Object* cast, RichString* out) {
FILE: MemoryMeter.h
type MemoryClass (line 13) | typedef struct MemoryClass_s {
FILE: MemorySwapMeter.c
type MemorySwapMeterData (line 24) | typedef struct MemorySwapMeterData_ {
function MemorySwapMeter_updateValues (line 29) | static void MemorySwapMeter_updateValues(Meter* this) {
function MemorySwapMeter_draw (line 36) | static void MemorySwapMeter_draw(Meter* this, int x, int y, int w) {
function MemorySwapMeter_init (line 49) | static void MemorySwapMeter_init(Meter* this) {
function MemorySwapMeter_updateMode (line 68) | static void MemorySwapMeter_updateMode(Meter* this, MeterModeId mode) {
function MemorySwapMeter_done (line 79) | static void MemorySwapMeter_done(Meter* this) {
FILE: Meter.c
type MeterMode (line 35) | typedef struct MeterMode_ {
function Meter_displayBuffer (line 43) | static inline void Meter_displayBuffer(const Meter* this, RichString* ou...
function Meter_computeSum (line 51) | static double Meter_computeSum(const Meter* this) {
function TextMeterMode_draw (line 61) | static void TextMeterMode_draw(Meter* this, int x, int y, int w) {
function BarMeterMode_draw (line 89) | static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
function GraphMeterMode_draw (line 220) | static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
function LEDMeterMode_drawDigit (line 351) | static void LEDMeterMode_drawDigit(int x, int y, int n) {
function Meter (line 451) | Meter* Meter_new(const Machine* host, unsigned int param, const MeterCla...
function Meter_humanUnit (line 473) | int Meter_humanUnit(char* buffer, double value, size_t size) {
function Meter_delete (line 507) | void Meter_delete(Object* cast) {
function Meter_setCaption (line 521) | void Meter_setCaption(Meter* this, const char* caption) {
function Meter_setMode (line 525) | void Meter_setMode(Meter* this, MeterModeId modeIndex) {
function MeterModeId (line 556) | MeterModeId Meter_nextSupportedMode(const Meter* this) {
function ListItem (line 570) | ListItem* Meter_toListItem(const Meter* this, bool moving) {
function BlankMeter_updateValues (line 591) | static void BlankMeter_updateValues(Meter* this) {
function BlankMeter_display (line 595) | static void BlankMeter_display(ATTR_UNUSED const Object* cast, ATTR_UNUS...
FILE: Meter.h
type Meter_ (line 48) | struct Meter_
type Meter (line 49) | typedef struct Meter_ Meter;
type ATTR_NONNULL (line 51) | typedef ATTR_NONNULL void (*Meter_Init)(Meter*);
type ATTR_NONNULL (line 52) | typedef ATTR_NONNULL void (*Meter_Done)(Meter*);
type ATTR_NONNULL (line 53) | typedef ATTR_NONNULL void (*Meter_UpdateMode)(Meter*, MeterModeId);
type ATTR_NONNULL (line 54) | typedef ATTR_NONNULL void (*Meter_UpdateValues)(Meter*);
type ATTR_NONNULL (line 55) | typedef ATTR_NONNULL void (*Meter_Draw)(Meter*, int, int, int);
type ATTR_NONNULL (line 56) | typedef ATTR_NONNULL const char* (*Meter_GetCaption)(const Meter*);
type ATTR_NONNULL (line 57) | typedef ATTR_NONNULL ATTR_ACCESS3_W(2, 3)
type MeterClass (line 59) | typedef struct MeterClass_ {
type GraphData (line 106) | typedef struct GraphData_ {
type Meter_ (line 112) | struct Meter_ {
type MeterRateStatus (line 131) | typedef enum {
FILE: MeterMode.h
type MeterModeId_ (line 11) | enum MeterModeId_ {
type MeterModeId (line 20) | typedef unsigned int MeterModeId;
FILE: MetersPanel.c
function MetersPanel_cleanup (line 38) | void MetersPanel_cleanup(void) {
function MetersPanel_delete (line 45) | static void MetersPanel_delete(Object* object) {
function MetersPanel_setMoving (line 51) | void MetersPanel_setMoving(MetersPanel* this, bool moving) {
function moveToNeighbor (line 67) | static inline bool moveToNeighbor(MetersPanel* this, MetersPanel* neighb...
function HandlerResult (line 88) | static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
function MetersPanel (line 186) | MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vec...
FILE: MetersPanel.h
type MetersPanel_ (line 18) | struct MetersPanel_
type MetersPanel (line 19) | typedef struct MetersPanel_ MetersPanel;
type MetersPanel_ (line 21) | struct MetersPanel_ {
FILE: NetworkIOMeter.c
function NetworkIOMeter_updateValues (line 38) | static void NetworkIOMeter_updateValues(Meter* this) {
function NetworkIOMeter_display (line 132) | static void NetworkIOMeter_display(ATTR_UNUSED const Object* cast, RichS...
FILE: NetworkIOMeter.h
type NetworkIOData (line 15) | typedef struct NetworkIOData_ {
FILE: Object.c
function Object_isA (line 20) | bool Object_isA(const Object* o, const ObjectClass* klass) {
FILE: Object.h
type Object_ (line 18) | struct Object_
type Object (line 19) | typedef struct Object_ Object;
type ObjectClass (line 37) | typedef struct ObjectClass_ {
type Object_ (line 44) | struct Object_ {
type Arg (line 48) | typedef union {
FILE: OpenFilesScreen.c
type OpenFiles_Data (line 33) | typedef struct OpenFiles_Data_ {
type OpenFiles_ProcessData (line 37) | typedef struct OpenFiles_ProcessData_ {
type OpenFiles_FileData (line 44) | typedef struct OpenFiles_FileData_ {
function getIndexForType (line 49) | static size_t getIndexForType(char type) {
function OpenFilesScreen (line 78) | OpenFilesScreen* OpenFilesScreen_new(const Process* process) {
function OpenFilesScreen_delete (line 89) | void OpenFilesScreen_delete(Object* this) {
function OpenFilesScreen_draw (line 93) | static void OpenFilesScreen_draw(InfoScreen* this) {
function OpenFiles_ProcessData (line 97) | static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) {
function OpenFiles_Data_clear (line 252) | static void OpenFiles_Data_clear(OpenFiles_Data* data) {
function OpenFilesScreen_scan (line 257) | static void OpenFilesScreen_scan(InfoScreen* super) {
FILE: OpenFilesScreen.h
type OpenFilesScreen (line 17) | typedef struct OpenFilesScreen_ {
FILE: OptionItem.c
function OptionItem_delete (line 22) | static void OptionItem_delete(Object* cast) {
function TextItem_display (line 30) | static void TextItem_display(const Object* cast, RichString* out) {
function CheckItem_display (line 37) | static void CheckItem_display(const Object* cast, RichString* out) {
function NumberItem_display (line 51) | static void NumberItem_display(const Object* cast, RichString* out) {
function TextItem (line 109) | TextItem* TextItem_new(const char* text) {
function CheckItem (line 115) | CheckItem* CheckItem_newByRef(const char* text, bool* ref) {
function CheckItem (line 123) | CheckItem* CheckItem_newByVal(const char* text, bool value) {
function CheckItem_get (line 131) | bool CheckItem_get(const CheckItem* this) {
function CheckItem_set (line 139) | void CheckItem_set(CheckItem* this, bool value) {
function CheckItem_toggle (line 147) | void CheckItem_toggle(CheckItem* this) {
function NumberItem (line 155) | NumberItem* NumberItem_newByRef(const char* text, int* ref, int scale, i...
function NumberItem (line 168) | NumberItem* NumberItem_newByVal(const char* text, int value, int scale, ...
function NumberItem_get (line 181) | int NumberItem_get(const NumberItem* this) {
function NumberItem_decrease (line 189) | void NumberItem_decrease(NumberItem* this) {
function NumberItem_increase (line 197) | void NumberItem_increase(NumberItem* this) {
function NumberItem_toggle (line 205) | void NumberItem_toggle(NumberItem* this) {
FILE: OptionItem.h
type OptionItemType (line 15) | enum OptionItemType {
type OptionItemClass (line 21) | typedef struct OptionItemClass_ {
type OptionItem (line 30) | typedef struct OptionItem_ {
type TextItem (line 36) | typedef struct TextItem_ {
type CheckItem (line 42) | typedef struct CheckItem_ {
type NumberItem (line 49) | typedef struct NumberItem_ {
FILE: Panel.c
function Panel (line 36) | Panel* Panel_new(int x, int y, int w, int h, const ObjectClass* type, bo...
function Panel_delete (line 44) | void Panel_delete(Object* cast) {
function Panel_init (line 50) | void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectCla...
function Panel_done (line 73) | void Panel_done(Panel* this) {
function Panel_setCursorToSelection (line 81) | void Panel_setCursorToSelection(Panel* this) {
function Panel_setSelectionColor (line 86) | void Panel_setSelectionColor(Panel* this, ColorElements colorId) {
function Panel_setHeader (line 90) | inline void Panel_setHeader(Panel* this, const char* header) {
function Panel_move (line 95) | void Panel_move(Panel* this, int x, int y) {
function Panel_resize (line 103) | void Panel_resize(Panel* this, int w, int h) {
function Panel_prune (line 111) | void Panel_prune(Panel* this) {
function Panel_add (line 121) | void Panel_add(Panel* this, Object* o) {
function Panel_insert (line 128) | void Panel_insert(Panel* this, int i, Object* o) {
function Panel_set (line 135) | void Panel_set(Panel* this, int i, Object* o) {
function Object (line 141) | Object* Panel_get(Panel* this, int i) {
function Object (line 147) | Object* Panel_remove(Panel* this, int i) {
function Object (line 159) | Object* Panel_getSelected(Panel* this) {
function Panel_moveSelectedUp (line 168) | void Panel_moveSelectedUp(Panel* this) {
function Panel_moveSelectedDown (line 177) | void Panel_moveSelectedDown(Panel* this) {
function Panel_getSelectedIndex (line 186) | int Panel_getSelectedIndex(const Panel* this) {
function Panel_size (line 192) | int Panel_size(const Panel* this) {
function Panel_setSelected (line 198) | void Panel_setSelected(Panel* this, int selected) {
function Panel_splice (line 214) | void Panel_splice(Panel* this, Vector* from) {
function Panel_draw (line 222) | void Panel_draw(Panel* this, bool force_redraw, bool focus, bool highlig...
function Panel_headerHeight (line 346) | static int Panel_headerHeight(const Panel* this) {
function Panel_onKey (line 350) | bool Panel_onKey(Panel* this, int key) {
function HandlerResult (line 455) | HandlerResult Panel_selectByTyping(Panel* this, int ch) {
function Panel_getCh (line 512) | int Panel_getCh(Panel* this) {
FILE: Panel.h
type Panel_ (line 20) | struct Panel_
type Panel (line 21) | typedef struct Panel_ Panel;
type HandlerResult (line 23) | typedef enum HandlerResult_ {
type HandlerResult (line 44) | typedef HandlerResult (*Panel_EventHandler)(Panel*, int);
type PanelClass (line 48) | typedef struct PanelClass_ {
type Panel_ (line 63) | struct Panel_ {
FILE: Process.c
function Process_fillStarttimeBuffer (line 43) | void Process_fillStarttimeBuffer(Process* this) {
function findCommInCmdline (line 67) | static bool findCommInCmdline(const char* comm, const char* cmdline, siz...
function matchCmdlinePrefixWithExeSuffix (line 99) | static size_t matchCmdlinePrefixWithExeSuffix(const char* cmdline, size_...
function Process_makeCommandStr (line 183) | void Process_makeCommandStr(Process* this, const Settings* settings) {
function Process_writeCommand (line 471) | void Process_writeCommand(const Process* this, int attr, int baseAttr, R...
function processStateChar (line 545) | static inline char processStateChar(ProcessState state) {
function Process_rowWriteField (line 567) | static void Process_rowWriteField(const Row* super, RichString* str, Row...
function Process_writeField (line 573) | void Process_writeField(const Process* this, RichString* str, RowField f...
function Process_done (line 795) | void Process_done(Process* this) {
function Process_isHighlighted (line 829) | static bool Process_isHighlighted(const Process* this) {
function Process_rowIsHighlighted (line 835) | bool Process_rowIsHighlighted(const Row* super) {
function Process_isVisible (line 842) | static bool Process_isVisible(const Process* p, const Settings* settings) {
function Process_rowIsVisible (line 848) | bool Process_rowIsVisible(const Row* super, const Table* table) {
function Process_matchesFilter (line 855) | static bool Process_matchesFilter(const Process* this, const Table* tabl...
function Process_rowMatchesFilter (line 872) | bool Process_rowMatchesFilter(const Row* super, const Table* table) {
function Process_init (line 878) | void Process_init(Process* this, const Machine* host) {
function Process_setPriority (line 885) | static bool Process_setPriority(Process* this, int priority) {
function Process_rowChangePriorityBy (line 898) | bool Process_rowChangePriorityBy(Row* super, Arg delta) {
function Process_sendSignal (line 904) | static bool Process_sendSignal(Process* this, Arg sgn) {
function Process_rowSendSignal (line 908) | bool Process_rowSendSignal(Row* super, Arg sgn) {
function Process_compare (line 914) | int Process_compare(const void* v1, const void* v2) {
function Process_compareByParent (line 931) | int Process_compareByParent(const Row* r1, const Row* r2) {
function Process_compareByKey_Base (line 943) | int Process_compareByKey_Base(const Process* p1, const Process* p2, Proc...
function Process_updateComm (line 1020) | void Process_updateComm(Process* this, const char* comm) {
function skipPotentialPath (line 1033) | static size_t skipPotentialPath(const char* cmdline, size_t end) {
function Process_updateCmdline (line 1054) | void Process_updateCmdline(Process* this, const char* cmdline, size_t ba...
function Process_updateExe (line 1079) | void Process_updateExe(Process* this, const char* exe) {
function Process_updateCPUFieldWidths (line 1099) | void Process_updateCPUFieldWidths(float percentage) {
FILE: Process.h
type Tristate (line 31) | typedef enum Tristate_ {
type ProcessState (line 41) | typedef enum ProcessState_ {
type Machine_ (line 58) | struct Machine_
type Settings_ (line 59) | struct Settings_
type ProcessCmdlineHighlight (line 63) | typedef struct ProcessCmdlineHighlight_ {
type ProcessMergedCommand (line 74) | typedef struct ProcessMergedCommand_ {
type Process (line 81) | typedef struct Process_ {
type ProcessFieldData (line 203) | typedef struct ProcessFieldData_ {
type ProcessField (line 230) | typedef int32_t ProcessField;
type Process (line 241) | typedef Process* (*Process_New)(const struct Machine_*);
type ProcessClass (line 244) | typedef struct ProcessClass_ {
function Process_setPid (line 254) | static inline void Process_setPid(Process* this, pid_t pid) {
function pid_t (line 258) | static inline pid_t Process_getPid(const Process* this) {
function Process_setThreadGroup (line 262) | static inline void Process_setThreadGroup(Process* this, pid_t pid) {
function pid_t (line 266) | static inline pid_t Process_getThreadGroup(const Process* this) {
function Process_setParent (line 270) | static inline void Process_setParent(Process* this, pid_t pid) {
function pid_t (line 274) | static inline pid_t Process_getParent(const Process* this) {
function pid_t (line 278) | static inline pid_t Process_getGroupOrParent(const Process* this) {
function Process_isKernelThread (line 282) | static inline bool Process_isKernelThread(const Process* this) {
function Process_isUserlandThread (line 286) | static inline bool Process_isUserlandThread(const Process* this) {
function Process_isThread (line 290) | static inline bool Process_isThread(const Process* this) {
type Machine_ (line 306) | struct Machine_
type Table_ (line 316) | struct Table_
type Table_ (line 318) | struct Table_
function Process_pidEqualCompare (line 320) | static inline int Process_pidEqualCompare(const void* v1, const void* v2) {
type Settings_ (line 334) | struct Settings_
FILE: ProcessLocksScreen.c
function ProcessLocksScreen (line 23) | ProcessLocksScreen* ProcessLocksScreen_new(const Process* process) {
function ProcessLocksScreen_delete (line 34) | void ProcessLocksScreen_delete(Object* this) {
function ProcessLocksScreen_draw (line 38) | static void ProcessLocksScreen_draw(InfoScreen* this) {
function FileLocks_Data_clear (line 42) | static inline void FileLocks_Data_clear(FileLocks_Data* data) {
function ProcessLocksScreen_scan (line 49) | static void ProcessLocksScreen_scan(InfoScreen* this) {
FILE: ProcessLocksScreen.h
type ProcessLocksScreen (line 19) | typedef struct ProcessLocksScreen_ {
type FileLocks_Data (line 24) | typedef struct FileLocks_Data_ {
type FileLocks_LockData (line 36) | typedef struct FileLocks_LockData_ {
type FileLocks_ProcessData (line 41) | typedef struct FileLocks_ProcessData_ {
FILE: ProcessTable.c
function ProcessTable_init (line 21) | void ProcessTable_init(ProcessTable* this, const ObjectClass* klass, Mac...
function ProcessTable_done (line 27) | void ProcessTable_done(ProcessTable* this) {
function Process (line 31) | Process* ProcessTable_getProcess(ProcessTable* this, pid_t pid, bool* pr...
function ProcessTable_prepareEntries (line 46) | static void ProcessTable_prepareEntries(Table* super) {
function ProcessTable_iterateEntries (line 56) | static void ProcessTable_iterateEntries(Table* super) {
function ProcessTable_cleanupEntries (line 62) | static void ProcessTable_cleanupEntries(Table* super) {
FILE: ProcessTable.h
type ProcessTable (line 20) | typedef struct ProcessTable_ {
function ProcessTable_add (line 42) | static inline void ProcessTable_add(ProcessTable* this, Process* process) {
function Process (line 48) | static inline Process* ProcessTable_findProcess(ProcessTable* this, pid_...
FILE: RichString.c
function RichString_extendLen (line 24) | static void RichString_extendLen(RichString* this, size_t len) {
function RichString_setLen (line 52) | static void RichString_setLen(RichString* this, size_t len) {
function RichString_rewind (line 61) | void RichString_rewind(RichString* this, int count) {
function mbstowcs_nonfatal (line 67) | static size_t mbstowcs_nonfatal(wchar_t* restrict dest, const char* rest...
function RichString_writeFromWide (line 100) | static inline int RichString_writeFromWide(RichString* this, int attrs, ...
function RichString_appendnWideColumns (line 118) | int RichString_appendnWideColumns(RichString* this, int attrs, const cha...
function RichString_writeFromAscii (line 148) | static inline int RichString_writeFromAscii(RichString* this, int attrs,...
function RichString_setAttrn (line 159) | inline void RichString_setAttrn(RichString* this, int attrs, size_t star...
function RichString_appendChr (line 166) | void RichString_appendChr(RichString* this, int attrs, char c, int count) {
function RichString_findChar (line 175) | int RichString_findChar(const RichString* this, char c, int start) {
function RichString_writeFromWide (line 188) | static inline int RichString_writeFromWide(RichString* this, int attrs, ...
function RichString_appendnWideColumns (line 199) | int RichString_appendnWideColumns(RichString* this, int attrs, const cha...
function RichString_writeFromAscii (line 206) | static inline int RichString_writeFromAscii(RichString* this, int attrs,...
function RichString_setAttrn (line 210) | void RichString_setAttrn(RichString* this, int attrs, size_t start, size...
function RichString_appendChr (line 217) | void RichString_appendChr(RichString* this, int attrs, char c, int count) {
function RichString_findChar (line 226) | int RichString_findChar(const RichString* this, char c, int start) {
function RichString_delete (line 238) | void RichString_delete(RichString* this) {
function RichString_setAttr (line 245) | void RichString_setAttr(RichString* this, int attrs) {
function RichString_appendWide (line 249) | int RichString_appendWide(RichString* this, int attrs, const char* data) {
function RichString_appendnWide (line 253) | int RichString_appendnWide(RichString* this, int attrs, const char* data...
function RichString_writeWide (line 257) | int RichString_writeWide(RichString* this, int attrs, const char* data) {
function RichString_appendAscii (line 261) | int RichString_appendAscii(RichString* this, int attrs, const char* data) {
function RichString_appendnAscii (line 265) | int RichString_appendnAscii(RichString* this, int attrs, const char* dat...
function RichString_writeAscii (line 269) | int RichString_writeAscii(RichString* this, int attrs, const char* data) {
FILE: RichString.h
type RichString (line 42) | typedef struct RichString_ {
FILE: Row.c
function Row_init (line 35) | void Row_init(Row* this, const Machine* host) {
function Row_done (line 44) | void Row_done(Row* this) {
function Row_isNew (line 49) | static inline bool Row_isNew(const Row* this) {
function Row_isTomb (line 58) | static inline bool Row_isTomb(const Row* this) {
function Row_display (line 62) | void Row_display(const Object* cast, RichString* out) {
function Row_setPidColumnWidth (line 86) | void Row_setPidColumnWidth(pid_t maxPid) {
function Row_setUidColumnWidth (line 96) | void Row_setUidColumnWidth(uid_t maxUid) {
function Row_resetFieldWidths (line 108) | void Row_resetFieldWidths(void) {
function Row_updateFieldWidth (line 119) | void Row_updateFieldWidth(RowField key, size_t width) {
function RowField (line 179) | RowField RowField_keyAt(const Settings* settings, int at) {
function Row_printKBytes (line 193) | void Row_printKBytes(RichString* str, unsigned long long number, bool co...
function Row_printBytes (line 297) | void Row_printBytes(RichString* str, unsigned long long number, bool col...
function Row_printCount (line 304) | void Row_printCount(RichString* str, unsigned long long number, bool col...
function Row_printTime (line 335) | void Row_printTime(RichString* str, unsigned long long totalHundredths, ...
function Row_printNanoseconds (line 405) | void Row_printNanoseconds(RichString* str, unsigned long long totalNanos...
function Row_printRate (line 457) | void Row_printRate(RichString* str, double rate, bool coloring) {
function Row_printLeftAlignedField (line 496) | void Row_printLeftAlignedField(RichString* str, int attr, const char* co...
function Row_printPercentage (line 502) | int Row_printPercentage(float val, char* buffer, size_t n, uint8_t width...
function Row_toggleTag (line 529) | void Row_toggleTag(Row* this) {
function Row_compare (line 533) | int Row_compare(const void* v1, const void* v2) {
function Row_compareByParent_Base (line 540) | int Row_compareByParent_Base(const void* v1, const void* v2) {
FILE: Row.h
type Machine_ (line 29) | struct Machine_
type Settings_ (line 30) | struct Settings_
type Table_ (line 31) | struct Table_
type Row (line 37) | typedef struct Row_ {
type Row (line 79) | typedef Row* (*Row_New)(const struct Machine_*);
type Table_ (line 82) | struct Table_
type Table_ (line 83) | struct Table_
type RowClass (line 89) | typedef struct RowClass_ {
type Machine_ (line 121) | struct Machine_
type Settings_ (line 135) | struct Settings_
type Settings_ (line 137) | struct Settings_
function Row_idEqualCompare (line 165) | static inline int Row_idEqualCompare(const void* v1, const void* v2) {
function Row_getGroupOrParent (line 172) | static inline int Row_getGroupOrParent(const Row* this) {
function Row_isChildOf (line 176) | static inline bool Row_isChildOf(const Row* this, int id) {
FILE: RowField.h
type ReservedFields (line 13) | typedef enum ReservedFields_ {
type RowField (line 54) | typedef int32_t RowField;
FILE: Scheduling.c
function Panel (line 42) | Panel* Scheduling_newPolicyPanel(int preSelectedPolicy) {
function Scheduling_togglePolicyPanelResetOnFork (line 62) | void Scheduling_togglePolicyPanelResetOnFork(Panel* schedPanel) {
function Panel (line 74) | Panel* Scheduling_newPriorityPanel(int policy, int preSelectedPriority) {
function Scheduling_setPolicy (line 102) | static bool Scheduling_setPolicy(Process* p, Arg arg) {
function Scheduling_rowSetPolicy (line 124) | bool Scheduling_rowSetPolicy(Row* row, Arg arg) {
function Scheduling_readProcessPolicy (line 162) | void Scheduling_readProcessPolicy(Process* proc) {
FILE: Scheduling.h
type SchedulingPolicy (line 22) | typedef struct {
type SchedulingArg (line 37) | typedef struct {
FILE: ScreenManager.c
function ScreenManager (line 31) | ScreenManager* ScreenManager_new(Header* header, Machine* host, State* s...
function ScreenManager_delete (line 47) | void ScreenManager_delete(ScreenManager* this) {
function ScreenManager_size (line 52) | inline int ScreenManager_size(const ScreenManager* this) {
function ScreenManager_add (line 56) | void ScreenManager_add(ScreenManager* this, Panel* item, int size) {
function header_height (line 60) | static int header_height(const ScreenManager* this) {
function ScreenManager_insert (line 70) | void ScreenManager_insert(ScreenManager* this, Panel* item, int size, in...
function Panel (line 93) | Panel* ScreenManager_remove(ScreenManager* this, int idx) {
function ScreenManager_resize (line 107) | void ScreenManager_resize(ScreenManager* this) {
function checkRecalculation (line 122) | static void checkRecalculation(ScreenManager* this, double* oldTime, int...
function drawTab (line 171) | static inline bool drawTab(const int* y, int* x, int l, const char* name...
function ScreenManager_drawScreenTabs (line 194) | static void ScreenManager_drawScreenTabs(ScreenManager* this) {
function ScreenManager_drawPanels (line 222) | static void ScreenManager_drawPanels(ScreenManager* this, size_t focus, ...
function ScreenManager_run (line 239) | void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* last...
FILE: ScreenManager.h
type ScreenManager (line 19) | typedef struct ScreenManager_ {
FILE: ScreenTabsPanel.c
function ScreenNamesPanel_fill (line 36) | static void ScreenNamesPanel_fill(ScreenNamesPanel* this, DynamicScreen*...
function ScreenTabsPanel_delete (line 61) | static void ScreenTabsPanel_delete(Object* object) {
function HandlerResult (line 67) | static HandlerResult ScreenTabsPanel_eventHandler(Panel* super, int ch) {
function ScreenTabListItem (line 120) | static ScreenTabListItem* ScreenTabListItem_new(const char* value, Dynam...
function addDynamicScreen (line 127) | static void addDynamicScreen(ATTR_UNUSED ht_key_t key, void* value, void...
function ScreenTabsPanel (line 137) | ScreenTabsPanel* ScreenTabsPanel_new(Settings* settings) {
function ScreenNameListItem (line 166) | ScreenNameListItem* ScreenNameListItem_new(const char* value, ScreenSett...
function ScreenTabsPanel_cleanup (line 177) | void ScreenTabsPanel_cleanup(void) {
function ScreenNamesPanel_delete (line 184) | static void ScreenNamesPanel_delete(Object* object) {
function renameScreenSettings (line 203) | static void renameScreenSettings(ScreenNamesPanel* this, const ListItem*...
function HandlerResult (line 214) | static HandlerResult ScreenNamesPanel_eventHandlerRenaming(Panel* super,...
function startRenaming (line 273) | static void startRenaming(Panel* super) {
function addNewScreen (line 294) | static void addNewScreen(Panel* super, DynamicScreen* ds) {
function HandlerResult (line 304) | static HandlerResult ScreenNamesPanel_eventHandlerNormal(Panel* super, i...
function HandlerResult (line 348) | static HandlerResult ScreenNamesPanel_eventHandler(Panel* super, int ch) {
function ScreenNamesPanel (line 364) | ScreenNamesPanel* ScreenNamesPanel_new(Settings* settings) {
FILE: ScreenTabsPanel.h
type ScreenNamesPanel (line 19) | typedef struct ScreenNamesPanel_ {
type ScreenNameListItem (line 31) | typedef struct ScreenNameListItem_ {
type ScreenTabsPanel (line 36) | typedef struct ScreenTabsPanel_ {
type ScreenTabListItem (line 45) | typedef struct ScreenTabListItem_ {
FILE: ScreensPanel.c
function ScreenListItem_delete (line 27) | static void ScreenListItem_delete(Object* cast) {
function ScreenListItem (line 42) | ScreenListItem* ScreenListItem_new(const char* value, ScreenSettings* ss) {
function ScreensPanel_cleanup (line 56) | void ScreensPanel_cleanup(void) {
function ScreensPanel_delete (line 63) | static void ScreensPanel_delete(Object* object) {
function HandlerResult (line 76) | static HandlerResult ScreensPanel_eventHandlerRenaming(Panel* super, int...
function startRenaming (line 149) | static void startRenaming(Panel* super) {
function rebuildSettingsArray (line 169) | static void rebuildSettingsArray(Panel* super, int selected) {
function addNewScreen (line 190) | static void addNewScreen(Panel* super) {
function HandlerResult (line 201) | static HandlerResult ScreensPanel_eventHandlerNormal(Panel* super, int c...
function HandlerResult (line 305) | static HandlerResult ScreensPanel_eventHandler(Panel* super, int ch) {
function ScreensPanel (line 323) | ScreensPanel* ScreensPanel_new(Settings* settings) {
function ScreensPanel_update (line 353) | void ScreensPanel_update(Panel* super) {
FILE: ScreensPanel.h
type ScreensPanel (line 26) | typedef struct ScreensPanel_ {
type ScreenListItem (line 41) | typedef struct ScreenListItem_ {
FILE: Settings.c
function Settings_deleteColumns (line 35) | static void Settings_deleteColumns(Settings* this) {
function Settings_deleteScreens (line 43) | static void Settings_deleteScreens(Settings* this) {
function Settings_delete (line 51) | void Settings_delete(Settings* this) {
function Settings_readMeters (line 66) | static void Settings_readMeters(Settings* this, const char* line, size_t...
function Settings_readMeterModes (line 71) | static void Settings_readMeterModes(Settings* this, const char* line, si...
function Settings_validateMeters (line 90) | static bool Settings_validateMeters(Settings* this) {
function Settings_defaultMeters (line 120) | static void Settings_defaultMeters(Settings* this, const Machine* host) {
function toFieldIndex (line 198) | static int toFieldIndex(Hashtable* columns, const char* str) {
function ScreenSettings_readFields (line 230) | static void ScreenSettings_readFields(ScreenSettings* ss, Hashtable* col...
function ScreenSettings (line 254) | static ScreenSettings* Settings_initScreenSettings(ScreenSettings* ss, S...
function ScreenSettings (line 263) | ScreenSettings* Settings_newScreen(Settings* this, const ScreenDefaults*...
function ScreenSettings (line 286) | ScreenSettings* Settings_newDynamicScreen(Settings* this, const char* ta...
function ScreenSettings_delete (line 302) | void ScreenSettings_delete(ScreenSettings* this) {
function ScreenSettings (line 309) | static ScreenSettings* Settings_defaultScreens(Settings* this) {
function Settings_read (line 320) | static bool Settings_read(Settings* this, const char* fileName, const Ma...
function writeFields (line 573) | static void writeFields(OutputFunc of, FILE* fp,
function writeList (line 595) | static void writeList(OutputFunc of, FILE* fp,
function writeMeters (line 605) | static void writeMeters(const Settings* this, OutputFunc of,
function writeMeterModes (line 614) | static void writeMeterModes(const Settings* this, OutputFunc of,
function signal_safe_fprintf (line 630) | static int signal_safe_fprintf(FILE* stream, const char* fmt, ...) {
function Settings_write (line 645) | int Settings_write(const Settings* this, bool onCrash) {
function Settings (line 791) | Settings* Settings_new(const Machine* host, Hashtable* dynamicMeters, Ha...
function ScreenSettings_invertSortOrder (line 909) | void ScreenSettings_invertSortOrder(ScreenSettings* this) {
function ScreenSettings_setSortKey (line 914) | void ScreenSettings_setSortKey(ScreenSettings* this, ProcessField sortKe...
function Settings_enableReadonly (line 927) | void Settings_enableReadonly(void) {
function Settings_isReadonly (line 931) | bool Settings_isReadonly(void) {
function Settings_setHeaderLayout (line 935) | void Settings_setHeaderLayout(Settings* this, HeaderLayout hLayout) {
FILE: Settings.h
type DynamicScreen_ (line 25) | struct DynamicScreen_
type Machine_ (line 26) | struct Machine_
type Table_ (line 27) | struct Table_
type ScreenDefaults (line 29) | typedef struct {
type MeterColumnSetting (line 36) | typedef struct {
type ScreenSettings (line 42) | typedef struct ScreenSettings_ {
type Settings (line 57) | typedef struct Settings_ {
function RowField (line 119) | static inline RowField ScreenSettings_getActiveSortKey(const ScreenSetti...
function ScreenSettings_getActiveDirection (line 125) | static inline int ScreenSettings_getActiveDirection(const ScreenSettings...
type Machine_ (line 133) | struct Machine_
type DynamicScreen_ (line 137) | struct DynamicScreen_
type Table_ (line 137) | struct Table_
FILE: SignalsPanel.c
function Panel (line 23) | Panel* SignalsPanel_new(int preSelectedSignal) {
FILE: SignalsPanel.h
type SignalItem (line 17) | typedef struct SignalItem_ {
FILE: SwapMeter.c
function SwapMeter_updateValues (line 28) | static void SwapMeter_updateValues(Meter* this) {
function SwapMeter_display (line 45) | static void SwapMeter_display(const Object* cast, RichString* out) {
FILE: SwapMeter.h
type SwapMeterValues (line 12) | typedef enum {
FILE: SysArchMeter.c
function SysArchMeter_updateValues (line 22) | static void SysArchMeter_updateValues(Meter* this) {
FILE: Table.c
function Table (line 26) | Table* Table_init(Table* this, const ObjectClass* klass, Machine* host) {
function Table_done (line 36) | void Table_done(Table* this) {
function Table_delete (line 42) | static void Table_delete(Object* cast) {
function Table_setPanel (line 48) | void Table_setPanel(Table* this, Panel* panel) {
function Table_add (line 52) | void Table_add(Table* this, Row* row) {
function Table_removeIndex (line 72) | static void Table_removeIndex(Table* this, const Row* row, int idx) {
function Table_buildTreeBranch (line 90) | static void Table_buildTreeBranch(Table* this, int rowid, unsigned int l...
function compareRowByKnownParentThenNatural (line 140) | static int compareRowByKnownParentThenNatural(const void* v1, const void...
function Table_buildTree (line 145) | static void Table_buildTree(Table* this) {
function Table_updateDisplayList (line 194) | void Table_updateDisplayList(Table* this) {
function Table_expandTree (line 211) | void Table_expandTree(Table* this) {
function Table_collapseAllBranches (line 220) | void Table_collapseAllBranches(Table* this) {
function Table_rebuildPanel (line 232) | void Table_rebuildPanel(Table* this) {
function Table_printHeader (line 289) | void Table_printHeader(const Settings* settings, RichString* header) {
function Table_prepareEntries (line 322) | void Table_prepareEntries(Table* this) {
function Row (line 332) | Row* Table_cleanupRow(Table* table, Row* row, int idx) {
function Table_cleanupEntries (line 358) | void Table_cleanupEntries(Table* this) {
FILE: Table.h
type Machine_ (line 20) | struct Machine_
type Panel_ (line 21) | struct Panel_
type Row_ (line 22) | struct Row_
type Table (line 24) | typedef struct Table_ {
type Table (line 41) | typedef Table* (*Table_New)(const struct Machine_*);
type TableClass (line 46) | typedef struct TableClass_ {
type Machine_ (line 59) | struct Machine_
type Panel_ (line 65) | struct Panel_
type Row_ (line 69) | struct Row_
type Row_ (line 79) | struct Row_
type Row_ (line 80) | struct Row_
function Table_compact (line 89) | static inline void Table_compact(Table* this, int dirtyIndex) {
FILE: TasksMeter.c
function TasksMeter_updateValues (line 29) | static void TasksMeter_updateValues(Meter* this) {
function TasksMeter_display (line 41) | static void TasksMeter_display(const Object* cast, RichString* out) {
FILE: TraceScreen.c
function TraceScreen (line 37) | TraceScreen* TraceScreen_new(const Process* process) {
function TraceScreen_delete (line 48) | void TraceScreen_delete(Object* cast) {
function TraceScreen_draw (line 65) | static void TraceScreen_draw(InfoScreen* this) {
function TraceScreen_forkTracer (line 69) | bool TraceScreen_forkTracer(TraceScreen* this) {
function TraceScreen_updateTrace (line 135) | static void TraceScreen_updateTrace(InfoScreen* super) {
function TraceScreen_onKey (line 185) | static bool TraceScreen_onKey(InfoScreen* super, int ch) {
FILE: TraceScreen.h
type TraceScreen (line 19) | typedef struct TraceScreen_ {
FILE: UptimeMeter.c
function UptimeMeter_updateValues (line 22) | static void UptimeMeter_updateValues(Meter* this) {
function SecondsUptimeMeter_updateValues (line 64) | static void SecondsUptimeMeter_updateValues(Meter* this) {
FILE: UsersTable.c
function UsersTable (line 20) | UsersTable* UsersTable_new(void) {
function UsersTable_delete (line 27) | void UsersTable_delete(UsersTable* this) {
type passwd (line 35) | struct passwd
function UsersTable_foreach (line 49) | inline void UsersTable_foreach(UsersTable* this, Hashtable_PairFunction ...
FILE: UsersTable.h
type UsersTable (line 13) | typedef struct UsersTable_ {
FILE: Vector.c
function Vector (line 19) | Vector* Vector_new(const ObjectClass* type, bool owner, int size) {
function Vector_delete (line 36) | void Vector_delete(Vector* this) {
function Vector_isConsistent (line 50) | static bool Vector_isConsistent(const Vector* this) {
function Vector_countEquals (line 57) | bool Vector_countEquals(const Vector* this, unsigned int expectedCount) {
function Object (line 67) | Object* Vector_get(const Vector* this, size_t idx) {
function Vector_size (line 75) | int Vector_size(const Vector* this) {
function Vector_prune (line 82) | void Vector_prune(Vector* this) {
function swap (line 98) | static void swap(Object** array, int indexA, int indexB) {
function partition (line 106) | static int partition(Object** array, int left, int right, int pivotIndex...
function quickSort (line 121) | static void quickSort(Object** array, int left, int right, Object_Compar...
function insertionSort (line 154) | static void insertionSort(Object** array, int left, int right, Object_Co...
function Vector_quickSortCustomCompare (line 170) | void Vector_quickSortCustomCompare(Vector* this, Object_Compare compare) {
function Vector_insertionSort (line 177) | void Vector_insertionSort(Vector* this) {
function Vector_resizeIfNecessary (line 184) | static void Vector_resizeIfNecessary(Vector* this, int newSize) {
function Vector_insert (line 195) | void Vector_insert(Vector* this, int idx, void* data_) {
function Object (line 215) | Object* Vector_take(Vector* this, int idx) {
function Object (line 229) | Object* Vector_remove(Vector* this, int idx) {
function Object (line 239) | Object* Vector_softRemove(Vector* this, int idx) {
function Vector_compact (line 258) | void Vector_compact(Vector* this, int dirtyIndex) {
function Vector_moveUp (line 282) | void Vector_moveUp(Vector* this, int idx) {
function Vector_moveDown (line 294) | void Vector_moveDown(Vector* this, int idx) {
function Vector_set (line 306) | void Vector_set(Vector* this, int idx, void* data_) {
function Vector_add (line 342) | void Vector_add(Vector* this, void* data_) {
function Vector_indexOf (line 352) | int Vector_indexOf(const Vector* this, const void* search_, Object_Compa...
function Vector_splice (line 367) | void Vector_splice(Vector* this, Vector* from) {
FILE: Vector.h
type Vector (line 17) | typedef struct Vector_ {
function Vector_quickSort (line 39) | static inline void Vector_quickSort(Vector* this) {
function Object (line 78) | static inline Object* Vector_get(const Vector* this, size_t idx) {
function Vector_size (line 82) | static inline int Vector_size(const Vector* this) {
function ObjectClass (line 88) | static inline const ObjectClass* Vector_type(const Vector* this) {
FILE: XUtils.c
function fail (line 27) | void fail(void) {
function String_contains_i (line 107) | inline bool String_contains_i(const char* s1, const char* s2, bool multi) {
function String_freeArray (line 180) | void String_freeArray(char** s) {
function String_safeStrncpy (line 216) | size_t String_safeStrncpy(char* restrict dest, const char* restrict src,...
function strnlen (line 229) | size_t strnlen(const char* str, size_t maxLen) {
function xAsprintf (line 239) | int xAsprintf(char** strp, const char* fmt, ...) {
function xSnprintf (line 254) | int xSnprintf(char* buf, size_t len, const char* fmt, ...) {
function free_and_xStrdup (line 280) | void free_and_xStrdup(char** ptr, const char* str) {
function full_write (line 296) | ssize_t full_write(int fd, const void* buf, size_t count) {
function compareRealNumbers (line 322) | int compareRealNumbers(double a, double b) {
function sumPositiveValues (line 332) | double sumPositiveValues(const double* array, size_t count) {
function countDigits (line 344) | size_t countDigits(size_t n, size_t base) {
function countTrailingZeros (line 365) | unsigned int countTrailingZeros(unsigned int x) {
FILE: XUtils.h
function ATTR_RETNONNULL (line 39) | ATTR_RETNONNULL ATTR_ALLOC_SIZE1(2)
function ATTR_MALLOC (line 120) | ATTR_MALLOC ATTR_ACCESS3_R(1, 2)
function ATTR_NONNULL (line 139) | ATTR_NONNULL ATTR_ACCESS3_R(1, 2)
function skipEndOfLine (line 159) | static inline bool skipEndOfLine(FILE* fp) {
function xDirfd (line 169) | static inline int xDirfd(DIR* dirp) {
FILE: darwin/DarwinMachine.c
function DarwinMachine_getHostInfo (line 33) | static void DarwinMachine_getHostInfo(host_basic_info_data_t* p) {
function DarwinMachine_freeCPULoadInfo (line 41) | static void DarwinMachine_freeCPULoadInfo(processor_cpu_load_info_t* p) {
function DarwinMachine_allocateCPULoadInfo (line 55) | static unsigned int DarwinMachine_allocateCPULoadInfo(processor_cpu_load...
function DarwinMachine_getVMStats (line 67) | static void DarwinMachine_getVMStats(DarwinMachine* this) {
function Machine_scan (line 83) | void Machine_scan(Machine* super) {
function Machine (line 94) | Machine* Machine_new(UsersTable* usersTable, uid_t userId) {
function Machine_delete (line 121) | void Machine_delete(Machine* super) {
function Machine_isCPUonline (line 132) | bool Machine_isCPUonline(const Machine* host, unsigned int id) {
FILE: darwin/DarwinMachine.h
type DarwinMachine (line 18) | typedef struct DarwinMachine_ {
FILE: darwin/DarwinProcess.c
function Process (line 57) | Process* DarwinProcess_new(const Machine* host) {
function Process_delete (line 71) | void Process_delete(Object* cast) {
function DarwinProcess_rowWriteField (line 78) | static void DarwinProcess_rowWriteField(const Row* super, RichString* st...
function DarwinProcess_compareByKey (line 96) | static int DarwinProcess_compareByKey(const Process* v1, const Process* ...
function DarwinProcess_updateExe (line 109) | static void DarwinProcess_updateExe(pid_t pid, Process* proc) {
function DarwinProcess_updateCwd (line 119) | static void DarwinProcess_updateCwd(pid_t pid, Process* proc) {
function DarwinProcess_updateCmdLine (line 138) | static void DarwinProcess_updateCmdLine(const struct kinfo_proc* k, Proc...
function DarwinProcess_setFromKInfoProc (line 292) | void DarwinProcess_setFromKInfoProc(Process* proc, const struct kinfo_pr...
function DarwinProcess_setFromLibprocPidinfo (line 364) | void DarwinProcess_setFromLibprocPidinfo(DarwinProcess* proc, DarwinProc...
function DarwinProcess_scanThreads (line 410) | void DarwinProcess_scanThreads(DarwinProcess* dp, DarwinProcessTable* dp...
FILE: darwin/DarwinProcess.h
type DarwinProcess (line 18) | typedef struct DarwinProcess_ {
type kinfo_proc (line 35) | struct kinfo_proc
FILE: darwin/DarwinProcessTable.c
type kinfo_proc (line 31) | struct kinfo_proc
type kinfo_proc (line 33) | struct kinfo_proc
type kinfo_proc (line 41) | struct kinfo_proc
type kinfo_proc (line 45) | struct kinfo_proc
function ProcessTable (line 56) | ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
function ProcessTable_delete (line 66) | void ProcessTable_delete(Object* cast) {
function ProcessTable_goThroughEntries (line 72) | void ProcessTable_goThroughEntries(ProcessTable* super) {
FILE: darwin/DarwinProcessTable.h
type DarwinProcessTable (line 16) | typedef struct DarwinProcessTable_ {
FILE: darwin/Platform.c
function Platform_calculateNanosecondsPerMachTick (line 183) | static void Platform_calculateNanosecondsPerMachTick(uint64_t* numer, ui...
function Platform_machTicksToNanoseconds (line 227) | uint64_t Platform_machTicksToNanoseconds(uint64_t mach_ticks) {
function Platform_init (line 240) | bool Platform_init(void) {
function Platform_schedulerTicksToNanoseconds (line 259) | double Platform_schedulerTicksToNanoseconds(const double scheduler_ticks) {
function Platform_done (line 263) | void Platform_done(void) {
function Platform_setBindings (line 267) | void Platform_setBindings(Htop_Action* keys) {
function Platform_getUptime (line 272) | int Platform_getUptime(void) {
function Platform_getLoadAverage (line 286) | void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
function pid_t (line 300) | pid_t Platform_getMaxPid(void) {
function Platform_setCPUAverageValues (line 305) | static double Platform_setCPUAverageValues(Meter* mtr) {
function Platform_setCPUValues (line 324) | double Platform_setCPUValues(Meter* mtr, unsigned int cpu) {
function Platform_setGPUValues (line 364) | void Platform_setGPUValues(Meter* mtr, double* totalUsage, unsigned long...
function Platform_setMemoryValues (line 410) | void Platform_setMemoryValues(Meter* mtr) {
function Platform_setSwapValues (line 449) | void Platform_setSwapValues(Meter* mtr) {
function Platform_setZfsArcValues (line 459) | void Platform_setZfsArcValues(Meter* this) {
function Platform_setZfsCompressedArcValues (line 465) | void Platform_setZfsCompressedArcValues(Meter* this) {
function FileLocks_ProcessData (line 522) | FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
function Platform_getFileDescriptors (line 527) | void Platform_getFileDescriptors(double* used, double* max) {
function Platform_getDiskIO (line 531) | bool Platform_getDiskIO(DiskIOData* data) {
function Platform_getNetworkIO (line 620) | bool Platform_getNetworkIO(NetworkIOData* data) {
function Platform_getBattery (line 678) | void Platform_getBattery(double* percent, ACPresence* isOnAC) {
function Platform_gettime_monotonic (line 733) | void Platform_gettime_monotonic(uint64_t* msec) {
function Platform_getOSRelease (line 754) | static void Platform_getOSRelease(char* buffer, size_t bufferLen) {
FILE: darwin/Platform.h
function Platform_getHostname (line 88) | static inline void Platform_getHostname(char* buffer, size_t size) {
function Platform_longOptionsUsage (line 100) | static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* nam...
function CommandLineStatus (line 102) | static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int o...
function Platform_gettime_realtime (line 106) | static inline void Platform_gettime_realtime(struct timeval* tv, uint64_...
function Hashtable (line 112) | static inline Hashtable* Platform_dynamicMeters(void) {
function Platform_dynamicMetersDone (line 116) | static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* tab...
function Platform_dynamicMeterInit (line 118) | static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { }
function Platform_dynamicMeterUpdateValues (line 120) | static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* ...
function Platform_dynamicMeterDisplay (line 122) | static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter*...
function Hashtable (line 124) | static inline Hashtable* Platform_dynamicColumns(void) {
function Platform_dynamicColumnsDone (line 128) | static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* ta...
function Platform_dynamicColumnWriteField (line 134) | static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Pr...
function Hashtable (line 138) | static inline Hashtable* Platform_dynamicScreens(void) {
function Platform_defaultDynamicScreens (line 142) | static inline void Platform_defaultDynamicScreens(ATTR_UNUSED Settings* ...
function Platform_addDynamicScreen (line 144) | static inline void Platform_addDynamicScreen(ATTR_UNUSED ScreenSettings*...
function Platform_addDynamicScreenAvailableColumns (line 146) | static inline void Platform_addDynamicScreenAvailableColumns(ATTR_UNUSED...
function Platform_dynamicScreensDone (line 148) | static inline void Platform_dynamicScreensDone(ATTR_UNUSED Hashtable* sc...
FILE: darwin/PlatformHelpers.c
function Platform_GetKernelVersion (line 23) | void Platform_GetKernelVersion(KernelVersion* k) {
function Platform_CompareKernelVersion (line 39) | int Platform_CompareKernelVersion(KernelVersion v) {
function Platform_KernelVersionIsBetween (line 56) | bool Platform_KernelVersionIsBetween(KernelVersion lowerBound, KernelVer...
function Platform_getCPUBrandString (line 61) | void Platform_getCPUBrandString(char* cpuBrandString, size_t cpuBrandStr...
function Platform_isRunningTranslated (line 72) | bool Platform_isRunningTranslated(void) {
FILE: darwin/PlatformHelpers.h
type KernelVersion (line 14) | typedef struct KernelVersion {
FILE: dragonflybsd/DragonFlyBSDMachine.c
function Machine (line 41) | Machine* Machine_new(UsersTable* usersTable, uid_t userId) {
function Machine_delete (line 119) | void Machine_delete(Machine* super) {
function DragonFlyBSDMachine_scanCPUTime (line 141) | static void DragonFlyBSDMachine_scanCPUTime(Machine* super) {
function DragonFlyBSDMachine_scanMemoryInfo (line 223) | static void DragonFlyBSDMachine_scanMemoryInfo(Machine* super) {
function DragonFlyBSDMachine_scanJails (line 294) | static void DragonFlyBSDMachine_scanJails(DragonFlyBSDMachine* this) {
function Machine_scan (line 361) | void Machine_scan(Machine* super) {
function Machine_isCPUonline (line 369) | bool Machine_isCPUonline(const Machine* host, unsigned int id) {
FILE: dragonflybsd/DragonFlyBSDMachine.h
type CPUData (line 26) | typedef struct CPUData_ {
type DragonFlyBSDMachine (line 35) | typedef struct DragonFlyBSDMachine_ {
FILE: dragonflybsd/DragonFlyBSDProcess.c
function Process (line 55) | Process* DragonFlyBSDProcess_new(const Machine* host) {
function Process_delete (line 62) | void Process_delete(Object* cast) {
function DragonFlyBSDProcess_rowWriteField (line 69) | static void DragonFlyBSDProcess_rowWriteField(const Row* super, RichStri...
function DragonFlyBSDProcess_compareByKey (line 90) | static int DragonFlyBSDProcess_compareByKey(const Process* v1, const Pro...
FILE: dragonflybsd/DragonFlyBSDProcess.h
type DragonFlyBSDProcess (line 18) | typedef struct DragonFlyBSDProcess_ {
FILE: dragonflybsd/DragonFlyBSDProcessTable.c
function ProcessTable (line 30) | ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
function ProcessTable_delete (line 40) | void ProcessTable_delete(Object* cast) {
function DragonFlyBSDProcessTable_updateExe (line 64) | static void DragonFlyBSDProcessTable_updateExe(const struct kinfo_proc* ...
function DragonFlyBSDProcessTable_updateCwd (line 80) | static void DragonFlyBSDProcessTable_updateCwd(const struct kinfo_proc* ...
function DragonFlyBSDProcessTable_updateProcessName (line 100) | static void DragonFlyBSDProcessTable_updateProcessName(kvm_t* kd, const ...
function ProcessTable_goThroughEntries (line 133) | void ProcessTable_goThroughEntries(ProcessTable* super) {
FILE: dragonflybsd/DragonFlyBSDProcessTable.h
type DragonFlyBSDProcessTable (line 17) | typedef struct DragonFlyBSDProcessTable_ {
FILE: dragonflybsd/Platform.c
function Platform_init (line 150) | bool Platform_init(void) {
function Platform_done (line 155) | void Platform_done(void) {
function Platform_setBindings (line 159) | void Platform_setBindings(Htop_Action* keys) {
function Platform_getUptime (line 164) | int Platform_getUptime(void) {
function Platform_getLoadAverage (line 178) | void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
function pid_t (line 195) | pid_t Platform_getMaxPid(void) {
function Platform_setCPUValues (line 205) | double Platform_setCPUValues(Meter* this, unsigned int cpu) {
function Platform_setMemoryValues (line 241) | void Platform_setMemoryValues(Meter* this) {
function Platform_setSwapValues (line 259) | void Platform_setSwapValues(Meter* this) {
function FileLocks_ProcessData (line 271) | FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
function Platform_getFileDescriptors (line 276) | void Platform_getFileDescriptors(double* used, double* max) {
function Platform_getDiskIO (line 280) | bool Platform_getDiskIO(DiskIOData* data) {
function Platform_getNetworkIO (line 341) | bool Platform_getNetworkIO(NetworkIOData* data) {
function Platform_getBattery (line 367) | void Platform_getBattery(double* percent, ACPresence* isOnAC) {
FILE: dragonflybsd/Platform.h
function Platform_getHostname (line 76) | static inline void Platform_getHostname(char* buffer, size_t size) {
function Platform_longOptionsUsage (line 90) | static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* nam...
function CommandLineStatus (line 92) | static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int o...
function Platform_gettime_realtime (line 96) | static inline void Platform_gettime_realtime(struct timeval* tv, uint64_...
function Platform_gettime_monotonic (line 100) | static inline void Platform_gettime_monotonic(uint64_t* msec) {
function Hashtable (line 104) | static inline Hashtable* Platform_dynamicMeters(void) {
function Platform_dynamicMetersDone (line 108) | static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* tab...
function Platform_dynamicMeterInit (line 110) | static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { }
function Platform_dynamicMeterUpdateValues (line 112) | static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* ...
function Platform_dynamicMeterDisplay (line 114) | static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter*...
function Hashtable (line 116) | static inline Hashtable* Platform_dynamicColumns(void) {
function Platform_dynamicColumnsDone (line 120) | static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* ta...
function Platform_dynamicColumnWriteField (line 126) | static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Pr...
function Hashtable (line 130) | static inline Hashtable* Platform_dynamicScreens(void) {
function Platform_defaultDynamicScreens (line 134) | static inline void Platform_defaultDynamicScreens(ATTR_UNUSED Settings* ...
function Platform_addDynamicScreen (line 136) | static inline void Platform_addDynamicScreen(ATTR_UNUSED ScreenSettings*...
function Platform_addDynamicScreenAvailableColumns (line 138) | static inline void Platform_addDynamicScreenAvailableColumns(ATTR_UNUSED...
function Platform_dynamicScreensDone (line 140) | static inline void Platform_dynamicScreensDone(ATTR_UNUSED Hashtable* sc...
FILE: freebsd/FreeBSDMachine.c
function Machine (line 53) | Machine* Machine_new(UsersTable* usersTable, uid_t userId) {
function Machine_delete (line 147) | void Machine_delete(Machine* super) {
function FreeBSDMachine_scanCPU (line 165) | static inline void FreeBSDMachine_scanCPU(Machine* super) {
function FreeBSDMachine_scanMemoryInfo (line 305) | static void FreeBSDMachine_scanMemoryInfo(Machine* super) {
function Machine_scan (line 389) | void Machine_scan(Machine* super) {
function Machine_isCPUonline (line 397) | bool Machine_isCPUonline(const Machine* host, unsigned int id) {
FILE: freebsd/FreeBSDMachine.h
type CPUData (line 20) | typedef struct CPUData_ {
type FreeBSDMachine (line 31) | typedef struct FreeBSDMachine_ {
FILE: freebsd/FreeBSDProcess.c
function Process (line 62) | Process* FreeBSDProcess_new(const Machine* machine) {
function Process_delete (line 69) | void Process_delete(Object* cast) {
function FreeBSDProcess_rowWriteField (line 85) | static void FreeBSDProcess_rowWriteField(const Row* super, RichString* s...
function FreeBSDProcess_compareByKey (line 120) | static int FreeBSDProcess_compareByKey(const Process* v1, const Process*...
FILE: freebsd/FreeBSDProcess.h
type FreeBSDSchedClass (line 16) | typedef enum {
type FreeBSDProcess (line 27) | typedef struct FreeBSDProcess_ {
FILE: freebsd/FreeBSDProcessTable.c
function ProcessTable (line 45) | ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
function ProcessTable_delete (line 56) | void ProcessTable_delete(Object* cast) {
function FreeBSDProcessTable_updateExe (line 62) | static void FreeBSDProcessTable_updateExe(const struct kinfo_proc* kproc...
function FreeBSDProcessTable_updateCwd (line 79) | static void FreeBSDProcessTable_updateCwd(const struct kinfo_proc* kproc...
function FreeBSDProcessTable_updateProcessName (line 103) | static void FreeBSDProcessTable_updateProcessName(kvm_t* kd, const struc...
type kinfo_proc (line 135) | struct kinfo_proc
type iovec (line 140) | struct iovec
function ProcessTable_goThroughEntries (line 160) | void ProcessTable_goThroughEntries(ProcessTable* super) {
FILE: freebsd/FreeBSDProcessTable.h
type FreeBSDProcessTable (line 17) | typedef struct FreeBSDProcessTable_ {
FILE: freebsd/Platform.c
function Platform_init (line 161) | bool Platform_init(void) {
function Platform_done (line 166) | void Platform_done(void) {
function Platform_setBindings (line 170) | void Platform_setBindings(Htop_Action* keys) {
function Platform_getUptime (line 175) | int Platform_getUptime(void) {
function Platform_getLoadAverage (line 189) | void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
function pid_t (line 206) | pid_t Platform_getMaxPid(void) {
function Platform_setCPUValues (line 216) | double Platform_setCPUValues(Meter* this, unsigned int cpu) {
function Platform_setMemoryValues (line 248) | void Platform_setMemoryValues(Meter* this) {
function Platform_setSwapValues (line 275) | void Platform_setSwapValues(Meter* this) {
function Platform_setZfsArcValues (line 282) | void Platform_setZfsArcValues(Meter* this) {
function Platform_setZfsCompressedArcValues (line 288) | void Platform_setZfsCompressedArcValues(Meter* this) {
function FileLocks_ProcessData (line 315) | FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
function Platform_getFileDescriptors (line 320) | void Platform_getFileDescriptors(double* used, double* max) {
function Platform_getDiskIO (line 324) | bool Platform_getDiskIO(DiskIOData* data) {
function Platform_getNetworkIO (line 368) | bool Platform_getNetworkIO(NetworkIOData* data) {
function Platform_getBattery (line 400) | void Platform_getBattery(double* percent, ACPresence* isOnAC) {
FILE: freebsd/Platform.h
function Platform_getHostname (line 76) | static inline void Platform_getHostname(char* buffer, size_t size) {
function Platform_longOptionsUsage (line 90) | static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* nam...
function CommandLineStatus (line 92) | static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int o...
function Platform_gettime_realtime (line 96) | static inline void Platform_gettime_realtime(struct timeval* tv, uint64_...
function Platform_gettime_monotonic (line 100) | static inline void Platform_gettime_monotonic(uint64_t* msec) {
function Hashtable (line 104) | static inline Hashtable* Platform_dynamicMeters(void) {
function Platform_dynamicMetersDone (line 108) | static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* tab...
function Platform_dynamicMeterInit (line 110) | static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { }
function Platform_dynamicMeterUpdateValues (line 112) | static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* ...
function Platform_dynamicMeterDisplay (line 114) | static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter*...
function Hashtable (line 116) | static inline Hashtable* Platform_dynamicColumns(void) {
function Platform_dynamicColumnsDone (line 124) | static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* ta...
function Platform_dynamicColumnWriteField (line 126) | static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Pr...
function Hashtable (line 130) | static inline Hashtable* Platform_dynamicScreens(void) {
function Platform_defaultDynamicScreens (line 134) | static inline void Platform_defaultDynamicScreens(ATTR_UNUSED Settings* ...
function Platform_addDynamicScreen (line 136) | static inline void Platform_addDynamicScreen(ATTR_UNUSED ScreenSettings*...
function Platform_addDynamicScreenAvailableColumns (line 138) | static inline void Platform_addDynamicScreenAvailableColumns(ATTR_UNUSED...
function Platform_dynamicScreensDone (line 140) | static inline void Platform_dynamicScreensDone(ATTR_UNUSED Hashtable* sc...
FILE: generic/fdstat_sysctl.c
function Generic_getFileDescriptors_sysctl_internal (line 20) | static void Generic_getFileDescriptors_sysctl_internal(
function Generic_getFileDescriptors_sysctl (line 64) | void Generic_getFileDescriptors_sysctl(double* used, double* max) {
FILE: generic/gettime.c
function Generic_gettime_realtime (line 16) | void Generic_gettime_realtime(struct timeval* tvp, uint64_t* msec) {
function Generic_gettime_monotonic (line 44) | void Generic_gettime_monotonic(uint64_t* msec) {
FILE: generic/gettime.h
type timeval (line 14) | struct timeval
FILE: generic/hostname.c
function Generic_hostname (line 15) | void Generic_hostname(char* buffer, size_t size) {
FILE: generic/openzfs_sysctl.c
function openzfs_sysctl_init (line 28) | void openzfs_sysctl_init(ZfsArcStats* stats) {
function openzfs_sysctl_updateArcStats (line 58) | void openzfs_sysctl_updateArcStats(ZfsArcStats* stats) {
FILE: generic/uname.c
function parseOSRelease (line 24) | static void parseOSRelease(char* buffer, size_t bufferLen) {
type utsname (line 85) | struct utsname
type utsname (line 86) | struct utsname
type utsname (line 87) | struct utsname
type utsname (line 93) | struct utsname
FILE: htop.c
function main (line 16) | int main(int argc, char** argv) {
FILE: linux/CGroupUtils.c
type StrBuf_state (line 44) | typedef struct StrBuf_state {
function StrBuf_putc_count (line 52) | static bool StrBuf_putc_count(StrBuf_state* p, ATTR_UNUSED char c) {
function StrBuf_putc_write (line 57) | static bool StrBuf_putc_write(StrBuf_state* p, char c) {
function StrBuf_putsn (line 66) | static bool StrBuf_putsn(StrBuf_state* p, StrBuf_putc_t w, const char* s...
function StrBuf_putsz (line 74) | static bool StrBuf_putsz(StrBuf_state* p, StrBuf_putc_t w, const char* s) {
function Label_checkEqual (line 82) | static bool Label_checkEqual(const char* labelStart, size_t labelLen, co...
function Label_checkPrefix (line 86) | static bool Label_checkPrefix(const char* labelStart, size_t labelLen, c...
function Label_checkSuffix (line 90) | static bool Label_checkSuffix(const char* labelStart, size_t labelLen, c...
function CGroup_filterName_internal (line 94) | static bool CGroup_filterName_internal(const char* cgroup, StrBuf_state*...
function CGroup_filterContainer_internal (line 387) | static bool CGroup_filterContainer_internal(const char* cgroup, StrBuf_s...
FILE: linux/Compat.c
function Compat_faccessat (line 28) | int Compat_faccessat(int dirfd,
function Compat_fstatat (line 63) | int Compat_fstatat(int dirfd,
function Compat_openat (line 92) | int Compat_openat(const char* dirpath,
function Compat_readlinkat (line 104) | ssize_t Compat_readlinkat(int dirfd,
function Compat_readlink (line 128) | ssize_t Compat_readlink(openat_arg_t dirfd,
function readfd_internal (line 159) | static ssize_t readfd_internal(int fd, void* buffer, size_t count) {
function Compat_readfile (line 195) | ssize_t Compat_readfile(const char* pathname, void* buffer, size_t count) {
function Compat_readfileat (line 203) | ssize_t Compat_readfileat(openat_arg_t dirfd, const char* pathname, void...
FILE: linux/Compat.h
type stat (line 26) | struct stat
type openat_arg_t (line 31) | typedef int openat_arg_t;
function Compat_openatArgClose (line 33) | static inline void Compat_openatArgClose(openat_arg_t dirfd) {
function Compat_openat (line 37) | static inline int Compat_openat(openat_arg_t dirfd, const char* pathname...
function Compat_openatArgClose (line 45) | static inline void Compat_openatArgClose(openat_arg_t dirpath) {
FILE: linux/GPU.c
type ClientID (line 22) | typedef unsigned long long int ClientID;
type ClientInfo (line 26) | typedef struct ClientInfo_ {
type section_state (line 32) | enum section_state {
function is_duplicate_client (line 38) | static bool is_duplicate_client(const ClientInfo* parsed, ClientID id, c...
function update_machine_gpu (line 48) | static void update_machine_gpu(LinuxProcessTable* lpt, unsigned long lon...
function GPU_readProcessData (line 80) | void GPU_readProcessData(LinuxProcessTable* lpt, LinuxProcess* lp, opena...
FILE: linux/HugePageMeter.c
function HugePageMeter_updateValues (line 39) | static void HugePageMeter_updateValues(Meter* this) {
function HugePageMeter_display (line 76) | static void HugePageMeter_display(const Object* cast, RichString* out) {
FILE: linux/IOPriority.h
type IOPriority (line 29) | typedef int IOPriority;
FILE: linux/IOPriorityPanel.c
function Panel (line 22) | Panel* IOPriorityPanel_new(IOPriority currPrio) {
function IOPriority (line 56) | IOPriority IOPriorityPanel_getIOPriority(Panel* this) {
FILE: linux/LibNl.c
type nl_sock (line 29) | struct nl_sock
type nl_sock (line 30) | struct nl_sock
type nl_sock (line 31) | struct nl_sock
type nl_sock (line 32) | struct nl_sock
type nl_msg (line 32) | struct nl_msg
type nl_sock (line 33) | struct nl_sock
type nl_sock (line 34) | struct nl_sock
type nl_sock (line 35) | struct nl_sock
type nl_cb_type (line 35) | enum nl_cb_type
type nl_cb_kind (line 35) | enum nl_cb_kind
type nlattr (line 36) | struct nlattr
type nlattr (line 37) | struct nlattr
type nlattr (line 37) | struct nlattr
type nl_msg (line 38) | struct nl_msg
type nl_msg (line 39) | struct nl_msg
type nlmsghdr (line 40) | struct nlmsghdr
type nl_msg (line 40) | struct nl_msg
type nl_msg (line 41) | struct nl_msg
type nl_sock (line 43) | struct nl_sock
type nlmsghdr (line 44) | struct nlmsghdr
type nlattr (line 44) | struct nlattr
type nla_policy (line 44) | struct nla_policy
type nl_msg (line 45) | struct nl_msg
function unload_libnl (line 48) | static void unload_libnl(void) {
function load_libnl (line 77) | static int load_libnl(void) {
function initNetlinkSocket (line 134) | static void initNetlinkSocket(LinuxProcessTable* this) {
function LibNl_destroyNetlinkSocket (line 149) | void LibNl_destroyNetlinkSocket(LinuxProcessTable* this) {
function handleNetlinkMsg (line 161) | static int handleNetlinkMsg(struct nl_msg* nlmsg, void* linuxProcess) {
function LibNl_readDelayAcctData (line 199) | void LibNl_readDelayAcctData(LinuxProcessTable* this, LinuxProcess* proc...
FILE: linux/LibSensors.c
function LibSensors_init (line 55) | int LibSensors_init(void) {
function LibSensors_cleanup (line 106) | void LibSensors_cleanup(void) {
function LibSensors_reload (line 123) | int LibSensors_reload(void) {
function tempDriverPriority (line 135) | static int tempDriverPriority(const sensors_chip_name* chip) {
function LibSensors_countCCDs (line 177) | int LibSensors_countCCDs(void) {
function LibSensors_stringToID (line 209) | static int LibSensors_stringToID(const char* str) {
function LibSensors_getCPUTemperatures (line 217) | void LibSensors_getCPUTemperatures(CPUData* cpus, unsigned int existingC...
FILE: linux/LinuxMachine.c
function LinuxMachine_updateCPUcount (line 47) | static void LinuxMachine_updateCPUcount(LinuxMachine* this) {
function LinuxMachine_scanMemoryInfo (line 130) | static void LinuxMachine_scanMemoryInfo(LinuxMachine* this) {
function LinuxMachine_scanHugePages (line 221) | static void LinuxMachine_scanHugePages(LinuxMachine* this) {
function LinuxMachine_scanZramInfo (line 277) | static void LinuxMachine_scanZramInfo(LinuxMachine* this) {
function LinuxMachine_scanZfsArcstats (line 328) | static void LinuxMachine_scanZfsArcstats(LinuxMachine* this) {
function LinuxMachine_scanCPUTime (line 402) | static void LinuxMachine_scanCPUTime(LinuxMachine* this) {
function scanCPUFrequencyFromSysCPUFreq (line 510) | static int scanCPUFrequencyFromSysCPUFreq(LinuxMachine* this) {
function scanCPUFrequencyFromCPUinfo (line 572) | static void scanCPUFrequencyFromCPUinfo(LinuxMachine* this) {
function LinuxMachine_fetchCPUTopologyFromCPUinfo (line 624) | static void LinuxMachine_fetchCPUTopologyFromCPUinfo(LinuxMachine* this) {
function LinuxMachine_assignCCDs (line 675) | static void LinuxMachine_assignCCDs(LinuxMachine* this, int ccds) {
function LinuxMachine_scanCPUFrequency (line 717) | static void LinuxMachine_scanCPUFrequency(LinuxMachine* this) {
function Machine_scan (line 729) | void Machine_scan(Machine* super) {
function Machine (line 752) | Machine* Machine_new(UsersTable* usersTable, uid_t userId) {
function Machine_delete (line 804) | void Machine_delete(Machine* super) {
function Machine_isCPUonline (line 821) | bool Machine_isCPUonline(const Machine* super, unsigned int id) {
FILE: linux/LinuxMachine.h
type CPUData (line 21) | typedef struct CPUData_ {
type GPUEngineData (line 61) | typedef struct GPUEngineData_ {
type LinuxMachine (line 67) | typedef struct LinuxMachine_ {
FILE: linux/LinuxProcess.c
function Process (line 117) | Process* LinuxProcess_new(const Machine* host) {
function Process_delete (line 124) | void Process_delete(Object* cast) {
function LinuxProcess_effectiveIOPriority (line 145) | static int LinuxProcess_effectiveIOPriority(const LinuxProcess* this) {
function IOPriority (line 161) | IOPriority LinuxProcess_updateIOPriority(Process* p) {
function LinuxProcess_setIOPriority (line 172) | static bool LinuxProcess_setIOPriority(Process* p, Arg ioprio) {
function LinuxProcess_rowSetIOPriority (line 180) | bool LinuxProcess_rowSetIOPriority(Row* super, Arg ioprio) {
function LinuxProcess_isAutogroupEnabled (line 186) | bool LinuxProcess_isAutogroupEnabled(void) {
function LinuxProcess_changeAutogroupPriorityBy (line 193) | static bool LinuxProcess_changeAutogroupPriorityBy(Process* p, Arg delta) {
function LinuxProcess_rowChangeAutogroupPriorityBy (line 215) | bool LinuxProcess_rowChangeAutogroupPriorityBy(Row* super, Arg delta) {
function LinuxProcess_totalIORate (line 221) | static double LinuxProcess_totalIORate(const LinuxProcess* lp) {
function LinuxProcess_rowWriteField (line 234) | static void LinuxProcess_rowWriteField(const Row* super, RichString* str...
function LinuxProcess_compareByKey (line 373) | static int LinuxProcess_compareByKey(const Process* v1, const Process* v...
FILE: linux/LinuxProcess.h
type LinuxProcess (line 35) | typedef struct LinuxProcess_ {
FILE: linux/LinuxProcessTable.c
function FILE (line 71) | static FILE* fopenat(openat_arg_t openatArg, const char* pathname, const...
function pid_t (line 85) | static pid_t strtopid(const char* str) {
function fast_strtoull_dec (line 93) | static inline uint64_t fast_strtoull_dec(char** str, size_t maxlen) {
function fast_strtoll_dec (line 108) | static long long fast_strtoll_dec(char** str, size_t maxlen) {
function fast_strtoi_dec (line 123) | static int fast_strtoi_dec(char** str, size_t maxlen) {
function fast_strtol_dec (line 132) | static long fast_strtol_dec(char** str, size_t maxlen) {
function fast_strtoul_dec (line 139) | static unsigned long fast_strtoul_dec(char** str, size_t maxlen) {
function fast_strtoull_hex (line 145) | static inline uint64_t fast_strtoull_hex(char** str, size_t maxlen) {
function sortTtyDrivers (line 172) | static int sortTtyDrivers(const void* va, const void* vb) {
function LinuxProcessTable_initTtyDrivers (line 183) | static void LinuxProcessTable_initTtyDrivers(LinuxProcessTable* this) {
function ProcessTable (line 261) | ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
function ProcessTable_delete (line 287) | void ProcessTable_delete(Object* cast) {
function LinuxProcessTable_adjustTime (line 302) | static inline unsigned long long LinuxProcessTable_adjustTime(const Linu...
function ProcessState (line 307) | static inline ProcessState LinuxProcessTable_getProcessState(char state) {
function LinuxProcessTable_readStatFile (line 325) | static bool LinuxProcessTable_readStatFile(LinuxProcess* lp, openat_arg_...
function LinuxProcessTable_readStatusFile (line 549) | static bool LinuxProcessTable_readStatusFile(Process* process, openat_ar...
function LinuxProcessTable_updateUser (line 628) | static bool LinuxProcessTable_updateUser(const Machine* host, Process* p...
function LinuxProcessTable_readIoFile (line 655) | static void LinuxProcessTable_readIoFile(LinuxProcess* lp, openat_arg_t ...
type LibraryData (line 722) | typedef struct LibraryData_ {
function LinuxProcessTable_calcLibSize_helper (line 727) | static void LinuxProcessTable_calcLibSize_helper(ATTR_UNUSED ht_key_t ke...
function LinuxProcessTable_readMaps (line 745) | static void LinuxProcessTable_readMaps(LinuxProcess* process, openat_arg...
function LinuxProcessTable_readStatmFile (line 860) | static bool LinuxProcessTable_readStatmFile(LinuxProcess* process, opena...
function LinuxProcessTable_readSmapsFile (line 897) | static bool LinuxProcessTable_readSmapsFile(LinuxProcess* process, opena...
function LinuxProcessTable_readOpenVZData (line 934) | static void LinuxProcessTable_readOpenVZData(LinuxProcess* process, open...
function LinuxProcessTable_readCGroupFile (line 1024) | static void LinuxProcessTable_readCGroupFile(LinuxProcess* process, open...
function LinuxProcessTable_readOomData (line 1128) | static void LinuxProcessTable_readOomData(LinuxProcess* process, openat_...
function LinuxProcessTable_readAutogroup (line 1157) | static void LinuxProcessTable_readAutogroup(LinuxProcess* process, opena...
function LinuxProcessTable_readSecattrData (line 1182) | static void LinuxProcessTable_readSecattrData(LinuxProcess* process, ope...
function LinuxProcessTable_readCwd (line 1216) | static void LinuxProcessTable_readCwd(LinuxProcess* process, openat_arg_...
function LinuxProcessList_readExe (line 1250) | static void LinuxProcessList_readExe(Process* process, openat_arg_t proc...
function LinuxProcessTable_readCmdlineFile (line 1324) | static bool LinuxProcessTable_readCmdlineFile(Process* process, openat_a...
function LinuxProcessList_readComm (line 1501) | static void LinuxProcessList_readComm(Process* process, openat_arg_t pro...
type stat (line 1536) | struct stat
function isOlderThan (line 1571) | static bool isOlderThan(const Process* proc, unsigned int seconds) {
function LinuxProcessTable_recurseProcTree (line 1588) | static bool LinuxProcessTable_recurseProcTree(LinuxProcessTable* this, o...
function ProcessTable_goThroughEntries (line 1951) | void ProcessTable_goThroughEntries(ProcessTable* super) {
FILE: linux/LinuxProcessTable.h
type TtyDriver (line 15) | typedef struct TtyDriver_ {
type LinuxProcessTable (line 22) | typedef struct LinuxProcessTable_ {
FILE: linux/OpenRCMeter.c
type OpenRCMeterContext_t (line 29) | typedef struct OpenRCMeterContext {
function OpenRCMeter_done (line 38) | static void OpenRCMeter_done(ATTR_UNUSED Meter* this) {
function updateViaExec (line 45) | static void updateViaExec(bool user) {
function OpenRCMeter_updateValues (line 115) | static void OpenRCMeter_updateValues(Meter* this) {
function OpenRCMeter_display (line 129) | static void OpenRCMeter_display(ATTR_UNUSED const Object* cast, RichStri...
function OpenRCMeter_display_system (line 156) | static void OpenRCMeter_display_system(ATTR_UNUSED const Object* cast, R...
function OpenRCMeter_display_user (line 160) | static void OpenRCMeter_display_user(ATTR_UNUSED const Object* cast, Ric...
FILE: linux/Platform.c
type CapMode (line 81) | enum CapMode {
type CapMode (line 170) | enum CapMode
function Htop_Reaction (line 173) | static Htop_Reaction Platform_actionSetIOPriority(State* st) {
function Platform_changeAutogroupPriority (line 195) | static bool Platform_changeAutogroupPriority(MainPanel* panel, int delta) {
function Htop_Reaction (line 207) | static Htop_Reaction Platform_actionHigherAutogroupPriority(State* st) {
function Htop_Reaction (line 215) | static Htop_Reaction Platform_actionLowerAutogroupPriority(State* st) {
function Platform_setBindings (line 223) | void Platform_setBindings(Htop_Action* keys) {
function Platform_getUptime (line 284) | int Platform_getUptime(void) {
function Platform_getLoadAverage (line 303) | void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
function pid_t (line 326) | pid_t Platform_getMaxPid(void) {
function Platform_setCPUValues (line 344) | double Platform_setCPUValues(Meter* this, unsigned int cpu) {
function Platform_setGPUValues (line 396) | void Platform_setGPUValues(Meter* this, double* totalUsage, unsigned lon...
function Platform_setMemoryValues (line 442) | void Platform_setMemoryValues(Meter* this) {
function Platform_setSwapValues (line 470) | void Platform_setSwapValues(Meter* this) {
function Platform_setZramValues (line 500) | void Platform_setZramValues(Meter* this) {
function Platform_setZfsArcValues (line 508) | void Platform_setZfsArcValues(Meter* this) {
function Platform_setZfsCompressedArcValues (line 514) | void Platform_setZfsCompressedArcValues(Meter* this) {
function FileLocks_ProcessData (line 556) | FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
function Platform_getPressureStall (line 644) | void Platform_getPressureStall(const char* file, bool some, double* ten,...
function Platform_getFileDescriptors (line 662) | void Platform_getFileDescriptors(double* used, double* max) {
function Platform_getDiskIO (line 680) | bool Platform_getDiskIO(DiskIOData* data) {
function Platform_getNetworkIO (line 723) | bool Platform_getNetworkIO(NetworkIOData* data) {
function Platform_Battery_getProcBatInfo (line 765) | static double Platform_Battery_getProcBatInfo(void) {
function ACPresence (line 828) | static ACPresence procAcpiCheck(void) {
function Platform_Battery_getProcData (line 837) | static void Platform_Battery_getProcData(double* percent, ACPresence* is...
function Platform_Battery_getSysData (line 846) | static void Platform_Battery_getSysData(double* percent, ACPresence* isO...
function Platform_getBattery (line 965) | void Platform_getBattery(double* percent, ACPresence* isOnAC) {
function Platform_longOptionsUsage (line 995) | void Platform_longOptionsUsage(const char* name)
function CommandLineStatus (line 1009) | CommandLineStatus Platform_getLongOption(int opt, int argc, char** argv) {
function dropCapabilities (line 1045) | static int dropCapabilities(enum CapMode mode) {
function Platform_init (line 1130) | bool Platform_init(void) {
function Platform_done (line 1172) | void Platform_done(void) {
FILE: linux/Platform.h
function Platform_getHostname (line 97) | static inline void Platform_getHostname(char* buffer, size_t size) {
function Platform_gettime_realtime (line 120) | static inline void Platform_gettime_realtime(struct timeval* tv, uint64_...
function Platform_gettime_monotonic (line 124) | static inline void Platform_gettime_monotonic(uint64_t* msec) {
function Hashtable (line 128) | static inline Hashtable* Platform_dynamicMeters(void) {
function Platform_dynamicMetersDone (line 132) | static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* tab...
function Platform_dynamicMeterInit (line 134) | static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { }
function Platform_dynamicMeterUpdateValues (line 136) | static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* ...
function Platform_dynamicMeterDisplay (line 138) | static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter*...
function Hashtable (line 140) | static inline Hashtable* Platform_dynamicColumns(void) {
function Platform_dynamicColumnsDone (line 144) | static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* ta...
function Platform_dynamicColumnWriteField (line 150) | static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Pr...
function Hashtable (line 154) | static inline Hashtable* Platform_dynamicScreens(void) {
function Platform_defaultDynamicScreens (line 158) | static inline void Platform_defaultDynamicScreens(ATTR_UNUSED Settings* ...
function Platform_addDynamicScreen (line 160) | static inline void Platform_addDynamicScreen(ATTR_UNUSED ScreenSettings*...
function Platform_addDynamicScreenAvailableColumns (line 162) | static inline void Platform_addDynamicScreenAvailableColumns(ATTR_UNUSED...
function Platform_dynamicScreensDone (line 164) | static inline void Platform_dynamicScreensDone(ATTR_UNUSED Hashtable* sc...
FILE: linux/PressureStallMeter.c
function PressureStallMeter_updateValues (line 30) | static void PressureStallMeter_updateValues(Meter* this) {
function PressureStallMeter_display (line 57) | static void PressureStallMeter_display(const Object* cast, RichString* o...
FILE: linux/SELinuxMeter.c
function hasSELinuxMount (line 33) | static bool hasSELinuxMount(void) {
function isSelinuxEnabled (line 53) | static bool isSelinuxEnabled(void) {
function isSelinuxEnforcing (line 57) | static bool isSelinuxEnforcing(void) {
function SELinuxMeter_updateValues (line 75) | static void SELinuxMeter_updateValues(Meter* this) {
FILE: linux/SystemdMeter.c
type sd_bus (line 43) | typedef void sd_bus;
type sd_bus_error (line 44) | typedef void sd_bus_error;
type SystemdMeterContext_t (line 57) | typedef struct SystemdMeterContext {
function SystemdMeter_done (line 71) | static void SystemdMeter_done(ATTR_UNUSED Meter* this) {
function updateViaLib (line 98) | static int updateViaLib(bool user) {
function updateViaExec (line 214) | static void updateViaExec(bool user) {
function SystemdMeter_updateValues (line 300) | static void SystemdMeter_updateValues(Meter* this) {
function zeroDigitColor (line 318) | static int zeroDigitColor(unsigned int value) {
function valueDigitColor (line 329) | static int valueDigitColor(unsigned int value) {
function SystemdMeter_display (line 341) | static void SystemdMeter_display(ATTR_UNUSED const Object* cast, RichStr...
function SystemdMeter_display_system (line 399) | static void SystemdMeter_display_system(ATTR_UNUSED const Object* cast, ...
function SystemdMeter_display_user (line 403) | static void SystemdMeter_display_user(ATTR_UNUSED const Object* cast, Ri...
FILE: linux/ZramMeter.c
function ZramMeter_updateValues (line 28) | static void ZramMeter_updateValues(Meter* this) {
function ZramMeter_display (line 51) | static void ZramMeter_display(const Object* cast, RichString* out) {
FILE: linux/ZramMeter.h
type ZramMeterValues (line 13) | typedef enum {
FILE: linux/ZramStats.h
type ZramStats (line 12) | typedef struct ZramStats_ {
FILE: linux/ZswapStats.h
type ZswapStats (line 12) | typedef struct ZswapStats_ {
FILE: netbsd/NetBSDMachine.c
function NetBSDMachine_updateCPUcount (line 51) | static void NetBSDMachine_updateCPUcount(NetBSDMachine* this) {
function Machine (line 105) | Machine* Machine_new(UsersTable* usersTable, uid_t userId) {
function Machine_delete (line 135) | void Machine_delete(Machine* super) {
function NetBSDMachine_scanMemoryInfo (line 147) | static void NetBSDMachine_scanMemoryInfo(NetBSDMachine* this) {
function getKernelCPUTimes (line 172) | static void getKernelCPUTimes(int cpuId, u_int64_t* times) {
function kernelCPUTimesToHtop (line 180) | static void kernelCPUTimesToHtop(const u_int64_t* times, CPUData* cpu) {
function NetBSDMachine_scanCPUTime (line 205) | static void NetBSDMachine_scanCPUTime(NetBSDMachine* this) {
function NetBSDMachine_scanCPUFrequency (line 230) | static void NetBSDMachine_scanCPUFrequency(NetBSDMachine* this) {
function Machine_scan (line 276) | void Machine_scan(Machine* super) {
function Machine_isCPUonline (line 287) | bool Machine_isCPUonline(const Machine* host, unsigned int id) {
FILE: netbsd/NetBSDMachine.h
type CPUData (line 21) | typedef struct CPUData_ {
type NetBSDMachine (line 43) | typedef struct NetBSDMachine_ {
FILE: netbsd/NetBSDProcess.c
function Process (line 218) | Process* NetBSDProcess_new(const Machine* host) {
function Process_delete (line 225) | void Process_delete(Object* cast) {
function NetBSDProcess_rowWriteField (line 231) | static void NetBSDProcess_rowWriteField(const Row* super, RichString* st...
function NetBSDProcess_compareByKey (line 248) | static int NetBSDProcess_compareByKey(const Process* v1, const Process* ...
FILE: netbsd/NetBSDProcess.h
type NetBSDProcess (line 20) | typedef struct NetBSDProcess_ {
FILE: netbsd/NetBSDProcessTable.c
function ProcessTable (line 40) | ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
function ProcessTable_delete (line 50) | void ProcessTable_delete(Object* cast) {
function NetBSDProcessTable_updateExe (line 56) | static void NetBSDProcessTable_updateExe(const struct kinfo_proc2* kproc...
function NetBSDProcessTable_updateCwd (line 74) | static void NetBSDProcessTable_updateCwd(const struct kinfo_proc2* kproc...
function NetBSDProcessTable_updateProcessName (line 94) | static void NetBSDProcessTable_updateProcessName(kvm_t* kd, const struct...
function getpcpu (line 146) | static double getpcpu(const NetBSDMachine* nhost, const struct kinfo_pro...
function ProcessState (line 153) | static ProcessState get_active_status(const NetBSDMachine* nhost, const ...
function ProcessTable_goThroughEntries (line 171) | void ProcessTable_goThroughEntries(ProcessTable* super) {
FILE: netbsd/NetBSDProcessTable.h
type NetBSDProcessTable (line 20) | typedef struct NetBSDProcessTable_ {
FILE: netbsd/Platform.c
function Platform_init (line 207) | bool Platform_init(void) {
function Platform_done (line 212) | void Platform_done(void) {
function Platform_setBindings (line 216) | void Platform_setBindings(Htop_Action* keys) {
function Platform_getUptime (line 221) | int Platform_getUptime(void) {
function Platform_getLoadAverage (line 235) | void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
function pid_t (line 252) | pid_t Platform_getMaxPid(void) {
function Platform_setCPUValues (line 258) | double Platform_setCPUValues(Meter* this, int cpu) {
function Platform_setMemoryValues (line 291) | void Platform_setMemoryValues(Meter* this) {
function Platform_setSwapValues (line 301) | void Platform_setSwapValues(Meter* this) {
type kinfo_proc2 (line 313) | struct kinfo_proc2
type kinfo_proc2 (line 320) | struct kinfo_proc2
function FileLocks_ProcessData (line 361) | FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
function Platform_getFileDescriptors (line 366) | void Platform_getFileDescriptors(double* used, double* max) {
function Platform_getDiskIO (line 370) | bool Platform_getDiskIO(DiskIOData* data) {
function Platform_getNetworkIO (line 424) | bool Platform_getNetworkIO(NetworkIOData* data) {
function Platform_getBattery (line 450) | void Platform_getBattery(double* percent, ACPresence* isOnAC) {
FILE: netbsd/Platform.h
function Platform_getHostname (line 82) | static inline void Platform_getHostname(char* buffer, size_t size) {
function Platform_longOptionsUsage (line 94) | static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* nam...
function CommandLineStatus (line 96) | static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int o...
function Platform_gettime_realtime (line 100) | static inline void Platform_gettime_realtime(struct timeval* tv, uint64_...
function Platform_gettime_monotonic (line 104) | static inline void Platform_gettime_monotonic(uint64_t* msec) {
function Hashtable (line 108) | static inline Hashtable* Platform_dynamicMeters(void) {
function Platform_dynamicMetersDone (line 112) | static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* tab...
function Platform_dynamicMeterInit (line 114) | static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { }
function Platform_dynamicMeterUpdateValues (line 116) | static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* ...
function Platform_dynamicMeterDisplay (line 118) | static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter*...
function Hashtable (line 120) | static inline Hashtable* Platform_dynamicColumns(void) {
function Platform_dynamicColumnsDone (line 124) | static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* ta...
function Platform_dynamicColumnWriteField (line 130) | static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Pr...
function Hashtable (line 134) | static inline Hashtable* Platform_dynamicScreens(void) {
function Platform_defaultDynamicScreens (line 138) | static inline void Platform_defaultDynamicScreens(ATTR_UNUSED Settings* ...
function Platform_addDynamicScreen (line 140) | static inline void Platform_addDynamicScreen(ATTR_UNUSED ScreenSettings*...
function Platform_addDynamicScreenAvailableColumns (line 142) | static inline void Platform_addDynamicScreenAvailableColumns(ATTR_UNUSED...
function Platform_dynamicScreensDone (line 144) | static inline void Platform_dynamicScreensDone(ATTR_UNUSED Hashtable* sc...
FILE: openbsd/OpenBSDMachine.c
function OpenBSDMachine_updateCPUcount (line 34) | static void OpenBSDMachine_updateCPUcount(OpenBSDMachine* this) {
function Machine (line 91) | Machine* Machine_new(UsersTable* usersTable, uid_t userId) {
function Machine_delete (line 124) | void Machine_delete(Machine* super) {
function OpenBSDMachine_scanMemoryInfo (line 135) | static void OpenBSDMachine_scanMemoryInfo(OpenBSDMachine* this) {
function getKernelCPUTimes (line 193) | static void getKernelCPUTimes(unsigned int cpuId, u_int64_t* times) {
function kernelCPUTimesToHtop (line 201) | static void kernelCPUTimesToHtop(const u_int64_t* times, CPUData* cpu) {
function OpenBSDMachine_scanCPUTime (line 238) | static void OpenBSDMachine_scanCPUTime(OpenBSDMachine* this) {
function Machine_scan (line 281) | void Machine_scan(Machine* super) {
function Machine_isCPUonline (line 289) | bool Machine_isCPUonline(const Machine* super, unsigned int id) {
FILE: openbsd/OpenBSDMachine.h
type CPUData (line 18) | typedef struct CPUData_ {
type OpenBSDMachine (line 40) | typedef struct OpenBSDMachine_ {
FILE: openbsd/OpenBSDProcess.c
function Process (line 210) | Process* OpenBSDProcess_new(const Machine* host) {
function Process_delete (line 217) | void Process_delete(Object* cast) {
function OpenBSDProcess_rowWriteField (line 223) | static void OpenBSDProcess_rowWriteField(const Row* super, RichString* s...
function OpenBSDProcess_compareByKey (line 240) | static int OpenBSDProcess_compareByKey(const Process* v1, const Process*...
FILE: openbsd/OpenBSDProcess.h
type OpenBSDProcess (line 18) | typedef struct OpenBSDProcess_ {
FILE: openbsd/OpenBSDProcessTable.c
function ProcessTable (line 38) | ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
function ProcessTable_delete (line 48) | void ProcessTable_delete(Object* cast) {
function OpenBSDProcessTable_updateCwd (line 54) | static void OpenBSDProcessTable_updateCwd(const struct kinfo_proc* kproc...
function OpenBSDProcessTable_updateProcessName (line 74) | static void OpenBSDProcessTable_updateProcessName(kvm_t* kd, const struc...
function getpcpu (line 126) | static double getpcpu(const OpenBSDMachine* ohost, const struct kinfo_pr...
function OpenBSDProcessTable_scanProcs (line 133) | static void OpenBSDProcessTable_scanProcs(OpenBSDProcessTable* this) {
function ProcessTable_goThroughEntries (line 242) | void ProcessTable_goThroughEntries(ProcessTable* super) {
FILE: openbsd/OpenBSDProcessTable.h
type OpenBSDProcessTable (line 17) | typedef struct OpenBSDProcessTable_ {
FILE: openbsd/Platform.c
function Platform_init (line 153) | bool Platform_init(void) {
function Platform_done (line 158) | void Platform_done(void) {
function Platform_setBindings (line 162) | void Platform_setBindings(Htop_Action* keys) {
function Platform_getUptime (line 167) | int Platform_getUptime(void) {
function Platform_getLoadAverage (line 181) | void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
function pid_t (line 198) | pid_t Platform_getMaxPid(void) {
function Platform_setCPUValues (line 202) | double Platform_setCPUValues(Meter* this, unsigned int cpu) {
function Platform_setMemoryValues (line 244) | void Platform_setMemoryValues(Meter* this) {
function Platform_setSwapValues (line 260) | void Platform_setSwapValues(Meter* this) {
type kinfo_proc (line 272) | struct kinfo_proc
type kinfo_proc (line 280) | struct kinfo_proc
function FileLocks_ProcessData (line 321) | FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
function Platform_getFileDescriptors (line 326) | void Platform_getFileDescriptors(double* used, double* max) {
function Platform_getDiskIO (line 350) | bool Platform_getDiskIO(DiskIOData* data) {
function Platform_getNetworkIO (line 356) | bool Platform_getNetworkIO(NetworkIOData* data) {
function findDevice (line 362) | static bool findDevice(const char* name, int* mib, struct sensordev* sns...
function Platform_getBattery (line 377) | void Platform_getBattery(double* percent, ACPresence* isOnAC) {
FILE: openbsd/Platform.h
function Platform_getHostname (line 74) | static inline void Platform_getHostname(char* buffer, size_t size) {
function Platform_longOptionsUsage (line 88) | static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* nam...
function CommandLineStatus (line 90) | static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int o...
function Platform_gettime_realtime (line 94) | static inline void Platform_gettime_realtime(struct timeval* tv, uint64_...
function Platform_gettime_monotonic (line 98) | static inline void Platform_gettime_monotonic(uint64_t* msec) {
function Hashtable (line 102) | static inline Hashtable* Platform_dynamicMeters(void) {
function Platform_dynamicMetersDone (line 106) | static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* tab...
function Platform_dynamicMeterInit (line 108) | static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { }
function Platform_dynamicMeterUpdateValues (line 110) | static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* ...
function Platform_dynamicMeterDisplay (line 112) | static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter*...
function Hashtable (line 114) | static inline Hashtable* Platform_dynamicColumns(void) {
function Platform_dynamicColumnsDone (line 118) | static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* ta...
function Platform_dynamicColumnWriteField (line 124) | static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Pr...
function Hashtable (line 128) | static inline Hashtable* Platform_dynamicScreens(void) {
function Platform_defaultDynamicScreens (line 132) | static inline void Platform_defaultDynamicScreens(ATTR_UNUSED Settings* ...
function Platform_addDynamicScreen (line 134) | static inline void Platform_addDynamicScreen(ATTR_UNUSED ScreenSettings*...
function Platform_addDynamicScreenAvailableColumns (line 136) | static inline void Platform_addDynamicScreenAvailableColumns(ATTR_UNUSED...
function Platform_dynamicScreensDone (line 138) | static inline void Platform_dynamicScreensDone(ATTR_UNUSED Hashtable* sc...
FILE: pcp-htop.c
function main (line 19) | int main(int argc, char** argv) {
FILE: pcp/InDomTable.c
function InDomTable (line 31) | InDomTable* InDomTable_new(Machine* host, pmInDom indom, int metricKey) {
function InDomTable_done (line 43) | void InDomTable_done(InDomTable* this) {
function InDomTable_delete (line 47) | static void InDomTable_delete(Object* cast) {
function Instance (line 53) | static Instance* InDomTable_getInstance(InDomTable* this, int id, bool* ...
function InDomTable_goThroughEntries (line 68) | static void InDomTable_goThroughEntries(InDomTable* this) {
function InDomTable_iterateEntries (line 86) | static void InDomTable_iterateEntries(Table* super) {
FILE: pcp/InDomTable.h
type InDomTable (line 18) | typedef struct InDomTable_ {
FILE: pcp/Instance.c
function Instance (line 34) | Instance* Instance_new(const Machine* host, const InDomTable* indom) {
function Instance_done (line 46) | void Instance_done(Instance* this) {
function Instance_delete (line 52) | static void Instance_delete(Object* cast) {
function Instance_writeField (line 58) | static void Instance_writeField(const Row* super, RichString* str, RowFi...
function Instance_compareByKey (line 90) | static int Instance_compareByKey(const Row* v1, const Row* v2, int key) {
function Instance_compare (line 141) | static int Instance_compare(const void* v1, const void* v2) {
FILE: pcp/Instance.h
type Instance (line 17) | typedef struct Instance_ {
type InDomTable_ (line 33) | struct InDomTable_
FILE: pcp/Metric.c
function pmDesc (line 25) | const pmDesc* Metric_desc(Metric metric) {
function Metric_type (line 29) | int Metric_type(Metric metric) {
function pmAtomValue (line 33) | pmAtomValue* Metric_values(Metric metric, pmAtomValue* atom, int count, ...
function Metric_instanceCount (line 58) | int Metric_instanceCount(Metric metric) {
function Metric_instanceOffset (line 65) | int Metric_instanceOffset(Metric metric, int inst) {
function pmAtomValue (line 78) | static pmAtomValue* Metric_extract(Metric metric, int inst, int offset, ...
function pmDesc (line 94) | static const pmDesc* Metric_instanceDesc(Metric metric, int inst, int of...
function pmAtomValue (line 114) | pmAtomValue* Metric_instance(Metric metric, int inst, int offset, pmAtom...
function pmAtomValue (line 120) | static inline pmAtomValue* kibibytes(pmAtomValue* atom, int scale) {
function pmAtomValue (line 133) | pmAtomValue* Metric_instance_kibibytes(Metric metric, int inst, int offs...
function pmAtomValue (line 140) | static inline pmAtomValue* milliseconds(pmAtomValue* atom, int scale) {
function pmAtomValue (line 163) | pmAtomValue* Metric_instance_milliseconds(Metric metric, int inst, int o...
function Metric_iterate (line 176) | bool Metric_iterate(Metric metric, int* instp, int* offsetp, size_t entr...
function Metric_enable (line 195) | void Metric_enable(Metric metric, bool enable) {
function Metric_enabled (line 199) | bool Metric_enabled(Metric metric) {
function Metric_enableThreads (line 203) | void Metric_enableThreads(void) {
function Metric_fetch (line 222) | bool Metric_fetch(struct timeval* timestamp) {
function Metric_externalName (line 254) | void Metric_externalName(Metric metric, int inst, char** externalName) {
function Metric_lookupText (line 260) | int Metric_lookupText(const char* metric, char** desc) {
FILE: pcp/Metric.h
type Metric (line 25) | typedef enum Metric_ {
type timeval (line 177) | struct timeval
function Metric (line 185) | static inline Metric Metric_fromId(size_t id) { return (Metric)id; }
FILE: pcp/PCPDynamicColumn.c
function PCPDynamicColumn_addMetric (line 35) | static bool PCPDynamicColumn_addMetric(PCPDynamicColumns* columns, PCPDy...
function PCPDynamicColumn_parseMetric (line 51) | static void PCPDynamicColumn_parseMetric(PCPDynamicColumns* columns, PCP...
function PCPDynamicColumn_validateColumnName (line 75) | static bool PCPDynamicColumn_validateColumnName(char* key, const char* p...
function PCPDynamicColumn_uniqueName (line 108) | static bool PCPDynamicColumn_uniqueName(char* key, PCPDynamicColumns* co...
function PCPDynamicColumn (line 112) | static PCPDynamicColumn* PCPDynamicColumn_new(PCPDynamicColumns* columns...
function PCPDynamicColumn_parseFile (line 127) | static void PCPDynamicColumn_parseFile(PCPDynamicColumns* columns, const...
function PCPDynamicColumn_scanDir (line 189) | static void PCPDynamicColumn_scanDir(PCPDynamicColumns* columns, char* p...
function PCPDynamicColumns_init (line 206) | void PCPDynamicColumns_init(PCPDynamicColumns* columns) {
function PCPDynamicColumn_done (line 252) | void PCPDynamicColumn_done(PCPDynamicColumn* this) {
function PCPDynamicColumns_free (line 258) | static void PCPDynamicColumns_free(ATTR_UNUSED ht_key_t key, void* value...
function PCPDynamicColumns_done (line 263) | void PCPDynamicColumns_done(Hashtable* table) {
function PCPDynamicColumn_setupWidth (line 267) | static void PCPDynamicColumn_setupWidth(ATTR_UNUSED ht_key_t key, void* ...
function PCPDynamicColumns_setupWidths (line 310) | void PCPDynamicColumns_setupWidths(PCPDynamicColumns* columns) {
function PCPDynamicColumn_normalize (line 315) | static int PCPDynamicColumn_normalize(const pmDesc* desc, const pmAtomVa...
function PCPDynamicColumn_writeAtomValue (line 356) | void PCPDynamicColumn_writeAtomValue(PCPDynamicColumn* column, RichStrin...
function PCPDynamicColumn_writeField (line 458) | void PCPDynamicColumn_writeField(PCPDynamicColumn* this, const Process* ...
function PCPDynamicColumn_compareByKey (line 474) | int PCPDynamicColumn_compareByKey(const PCPProcess* p1, const PCPProcess...
FILE: pcp/PCPDynamicColumn.h
type pmDesc (line 20) | struct pmDesc
type PCPDynamicColumn (line 22) | typedef struct PCPDynamicColumn_ {
type PCPDynamicColumns (line 33) | typedef struct PCPDynamicColumns_ {
type Settings_ (line 48) | struct Settings_
type pmDesc (line 48) | struct pmDesc
FILE: pcp/PCPDynamicMeter.c
function PCPDynamicMetric (line 32) | static PCPDynamicMetric* PCPDynamicMeter_lookupMetric(PCPDynamicMeters* ...
function PCPDynamicMeter_parseMetric (line 61) | static void PCPDynamicMeter_parseMetric(PCPDynamicMeters* meters, PCPDyn...
function PCPDynamicMeter_validateMeterName (line 119) | static bool PCPDynamicMeter_validateMeterName(char* key, const char* pat...
function PCPDynamicMeter_uniqueName (line 152) | static bool PCPDynamicMeter_uniqueName(char* key, PCPDynamicMeters* mete...
function PCPDynamicMeter (line 156) | static PCPDynamicMeter* PCPDynamicMeter_new(PCPDynamicMeters* meters, co...
function PCPDynamicMeter_parseFile (line 164) | static void PCPDynamicMeter_parseFile(PCPDynamicMeters* meters, const ch...
function PCPDynamicMeter_scanDir (line 234) | static void PCPDynamicMeter_scanDir(PCPDynamicMeters* meters, char* path) {
function PCPDynamicMeters_init (line 251) | void PCPDynamicMeters_init(PCPDynamicMeters* meters) {
function PCPDynamicMeter_free (line 297) | static void PCPDynamicMeter_free(ATTR_UNUSED ht_key_t key, void* value, ...
function PCPDynamicMeters_done (line 309) | void PCPDynamicMeters_done(Hashtable* table) {
function PCPDynamicMeter_enable (line 313) | void PCPDynamicMeter_enable(PCPDynamicMeter* this) {
function PCPDynamicMeter_updateValues (line 318) | void PCPDynamicMeter_updateValues(PCPDynamicMeter* this, Meter* meter) {
function PCPDynamicMeter_display (line 402) | void PCPDynamicMeter_display(PCPDynamicMeter* this, ATTR_UNUSED const Me...
FILE: pcp/PCPDynamicMeter.h
type PCPDynamicMetric (line 19) | typedef struct PCPDynamicMetric_ {
type PCPDynamicMeter (line 27) | typedef struct PCPDynamicMeter_ {
type PCPDynamicMeters (line 33) | typedef struct PCPDynamicMeters_ {
FILE: pcp/PCPDynamicScreen.c
function PCPDynamicScreens_appendDynamicColumns (line 43) | static void PCPDynamicScreens_appendDynamicColumns(PCPDynamicScreens* sc...
function PCPDynamicColumn (line 73) | static PCPDynamicColumn* PCPDynamicScreen_lookupMetric(PCPDynamicScreen*...
function PCPDynamicScreen_parseColumn (line 104) | static void PCPDynamicScreen_parseColumn(PCPDynamicScreen* screen, const...
function PCPDynamicScreen_validateScreenName (line 168) | static bool PCPDynamicScreen_validateScreenName(char* key, const char* p...
function PCPDynamicScreen_uniqueName (line 201) | static bool PCPDynamicScreen_uniqueName(char* key, PCPDynamicScreens* sc...
function PCPDynamicScreen (line 205) | static PCPDynamicScreen* PCPDynamicScreen_new(PCPDynamicScreens* screens...
function PCPDynamicScreen_parseFile (line 217) | static void PCPDynamicScreen_parseFile(PCPDynamicScreens* screens, const...
function PCPDynamicScreen_scanDir (line 282) | static void PCPDynamicScreen_scanDir(PCPDynamicScreens* screens, char* p...
function PCPDynamicScreens_init (line 299) | void PCPDynamicScreens_init(PCPDynamicScreens* screens, PCPDynamicColumn...
function PCPDynamicScreen_done (line 342) | static void PCPDynamicScreen_done(PCPDynamicScreen* ds) {
function PCPDynamicScreens_free (line 348) | static void PCPDynamicScreens_free(ATTR_UNUSED ht_key_t key, void* value...
function PCPDynamicScreens_done (line 353) | void PCPDynamicScreens_done(Hashtable* table) {
function PCPDynamicScreen_appendTables (line 357) | void PCPDynamicScreen_appendTables(PCPDynamicScreens* screens, Machine* ...
function PCPDynamicScreen_appendScreens (line 367) | void PCPDynamicScreen_appendScreens(PCPDynamicScreens* screens, Settings...
function PCPDynamicScreen_addDynamicScreen (line 381) | void PCPDynamicScreen_addDynamicScreen(PCPDynamicScreens* screens, Scree...
function PCPDynamicScreens_addAvailableColumns (line 393) | void PCPDynamicScreens_addAvailableColumns(Panel* availableColumns, Hash...
FILE: pcp/PCPDynamicScreen.h
type InDomTable_ (line 21) | struct InDomTable_
type PCPDynamicColumn_ (line 22) | struct PCPDynamicColumn_
type PCPDynamicColumns_ (line 23) | struct PCPDynamicColumns_
type PCPDynamicScreen (line 25) | typedef struct PCPDynamicScreen_ {
type PCPDynamicScreens (line 39) | typedef struct PCPDynamicScreens_ {
type PCPDynamicColumns_ (line 44) | struct PCPDynamicColumns_
FILE: pcp/PCPMachine.c
function PCPMachine_updateCPUcount (line 32) | static void PCPMachine_updateCPUcount(PCPMachine* this) {
function PCPMachine_updateSystemName (line 53) | static void PCPMachine_updateSystemName(PCPMachine* this) {
function PCPMachine_updateLinuxMemoryInfo (line 64) | static void PCPMachine_updateLinuxMemoryInfo(PCPMachine* this) {
function PCPMachine_updateDarwinMemoryInfo (line 97) | static void PCPMachine_updateDarwinMemoryInfo(PCPMachine* this, Settings...
function PCPMachine_updateMemoryInfo (line 131) | static void PCPMachine_updateMemoryInfo(Machine* super) {
function PCPMachine_backupCPUTime (line 148) | static inline void PCPMachine_backupCPUTime(pmAtomValue* values) {
function PCPMachine_saveCPUTimePeriod (line 155) | static inline void PCPMachine_saveCPUTimePeriod(pmAtomValue* values, CPU...
function PCPMachine_deriveCPUTime (line 171) | static void PCPMachine_deriveCPUTime(pmAtomValue* values) {
function PCPMachine_updateAllCPUTime (line 214) | static void PCPMachine_updateAllCPUTime(PCPMachine* this, Metric metric,...
function PCPMachine_updatePerCPUTime (line 221) | static void PCPMachine_updatePerCPUTime(PCPMachine* this, Metric metric,...
function PCPMachine_updatePerCPUReal (line 230) | static void PCPMachine_updatePerCPUReal(PCPMachine* this, Metric metric,...
function PCPMachine_scanZswapInfo (line 239) | static inline void PCPMachine_scanZswapInfo(PCPMachine* this) {
function PCPMachine_scanZfsArcstats (line 249) | static inline void PCPMachine_scanZfsArcstats(PCPMachine* this) {
function PCPMachine_scan (line 286) | static void PCPMachine_scan(PCPMachine* this) {
function Machine_scan (line 325) | void Machine_scan(Machine* super) {
function Machine (line 366) | Machine* Machine_new(UsersTable* usersTable, uid_t userId) {
function Machine_delete (line 387) | void Machine_delete(Machine* super) {
function Machine_isCPUonline (line 398) | bool Machine_isCPUonline(const Machine* host, unsigned int id) {
FILE: pcp/PCPMachine.h
type CPUMetric (line 22) | typedef enum CPUMetric_ {
type MemoryMetric (line 56) | typedef enum MemoryMetric_ {
type SystemName (line 74) | typedef enum SystemName_ {
type PCPMachine (line 80) | typedef struct PCPMachine_ {
FILE: pcp/PCPProcess.c
function Process (line 96) | Process* PCPProcess_new(const Machine* host) {
function Process_delete (line 103) | void Process_delete(Object* cast) {
function PCPProcess_printDelay (line 112) | static void PCPProcess_printDelay(float delay_percent, char* buffer, siz...
function PCPProcess_totalIORate (line 120) | static double PCPProcess_totalIORate(const PCPProcess* pp) {
function PCPProcess_rowWriteField (line 133) | static void PCPProcess_rowWriteField(const Row* super, RichString* str, ...
function PCPProcess_compareByKey (line 214) | static int PCPProcess_compareByKey(const Process* v1, const Process* v2,...
FILE: pcp/PCPProcess.h
type PCPProcess (line 26) | typedef struct PCPProcess_ {
FILE: pcp/PCPProcessTable.c
function ProcessTable (line 35) | ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
function ProcessTable_delete (line 45) | void ProcessTable_delete(Object* cast) {
function Metric_instance_s32 (line 51) | static inline long Metric_instance_s32(int metric, int pid, int offset, ...
function Metric_instance_s64 (line 58) | static inline long long Metric_instance_s64(int metric, int pid, int off...
function Metric_instance_u32 (line 65) | static inline unsigned long Metric_instance_u32(int metric, int pid, int...
function Metric_instance_u64 (line 72) | static inline unsigned long long Metric_instance_u64(int metric, int pid...
function Metric_instance_time (line 79) | static inline unsigned long long Metric_instance_time(int metric, int pi...
function Metric_instance_ONE_K (line 86) | static inline unsigned long long Metric_instance_ONE_K(int metric, int p...
function Metric_instance_char (line 93) | static inline char Metric_instance_char(int metric, int pid, int offset,...
function ProcessState (line 116) | static inline ProcessState PCPProcessTable_getProcessState(char state) {
function PCPProcessTable_updateID (line 133) | static void PCPProcessTable_updateID(Process* process, int pid, int offs...
function PCPProcessTable_updateInfo (line 139) | static void PCPProcessTable_updateInfo(PCPProcess* pp, int pid, int offs...
function PCPProcessTable_updateIO (line 169) | static void PCPProcessTable_updateIO(PCPProcess* pp, int pid, int offset...
function PCPProcessTable_updateMemory (line 203) | static void PCPProcessTable_updateMemory(PCPProcess* pp, int pid, int of...
function PCPProcessTable_updateSmaps (line 214) | static void PCPProcessTable_updateSmaps(PCPProcess* pp, pid_t pid, int o...
function PCPProcessTable_readOomData (line 220) | static void PCPProcessTable_readOomData(PCPProcess* pp, int pid, int off...
function PCPProcessTable_readAutogroup (line 224) | static void PCPProcessTable_readAutogroup(PCPProcess* pp, int pid, int o...
function PCPProcessTable_readCtxtData (line 229) | static void PCPProcessTable_readCtxtData(PCPProcess* pp, int pid, int of...
function PCPProcessTable_updateTTY (line 253) | static void PCPProcessTable_updateTTY(Process* process, int pid, int off...
function PCPProcessTable_readCGroups (line 257) | static void PCPProcessTable_readCGroups(PCPProcess* pp, int pid, int off...
function PCPProcessTable_readSecattrData (line 292) | static void PCPProcessTable_readSecattrData(PCPProcess* pp, int pid, int...
function PCPProcessTable_readCwd (line 296) | static void PCPProcessTable_readCwd(PCPProcess* pp, int pid, int offset) {
function PCPProcessTable_updateUsername (line 300) | static void PCPProcessTable_updateUsername(Process* process, int pid, in...
function PCPProcessTable_updateCmdline (line 305) | static void PCPProcessTable_updateCmdline(Process* process, int pid, int...
function PCPProcessTable_updateProcesses (line 355) | static bool PCPProcessTable_updateProcesses(PCPProcessTable* this) {
function ProcessTable_goThroughEntries (line 485) | void ProcessTable_goThroughEntries(ProcessTable* super) {
FILE: pcp/PCPProcessTable.h
type PCPProcessTable (line 20) | typedef struct PCPProcessTable_ {
FILE: pcp/Platform.c
function pmLookupDescs (line 304) | int pmLookupDescs(int numpmid, pmID* pmids, pmDesc* descs) {
function Platform_addMetric (line 327) | size_t Platform_addMetric(Metric id, const char* name) {
function Platform_init (line 348) | bool Platform_init(void) {
function Platform_dynamicColumnsDone (line 460) | void Platform_dynamicColumnsDone(Hashtable* columns) {
function Platform_dynamicMetersDone (line 464) | void Platform_dynamicMetersDone(Hashtable* meters) {
function Platform_dynamicScreensDone (line 468) | void Platform_dynamicScreensDone(Hashtable* screens) {
function Platform_done (line 472) | void Platform_done(void) {
function Platform_setBindings (line 484) | void Platform_setBindings(Htop_Action* keys) {
function Platform_getUptime (line 489) | int Platform_getUptime(void) {
function Platform_getLoadAverage (line 496) | void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
function Platform_getMaxCPU (line 507) | unsigned int Platform_getMaxCPU(void) {
function pid_t (line 519) | pid_t Platform_getMaxPid(void) {
function Platform_getBootTime (line 530) | long long Platform_getBootTime(void) {
function Platform_setOneCPUValues (line 540) | static double Platform_setOneCPUValues(Meter* this, const Settings* sett...
function Platform_setCPUValues (line 581) | double Platform_setCPUValues(Meter* this, int cpu) {
function Platform_setLinuxMemoryValues (line 590) | static void Platform_setLinuxMemoryValues(double* v, const PCPMachine *h...
function Platform_setDarwinMemoryValues (line 615) | static void Platform_setDarwinMemoryValues(double* v, const PCPMachine *...
function Platform_setMemoryValues (line 624) | void Platform_setMemoryValues(Meter* this) {
function Platform_setSwapValues (line 637) | void Platform_setSwapValues(Meter* this) {
function Platform_setZramValues (line 658) | void Platform_setZramValues(Meter* this) {
function Platform_setZfsArcValues (line 694) | void Platform_setZfsArcValues(Meter* this) {
function Platform_setZfsCompressedArcValues (line 700) | void Platform_setZfsCompressedArcValues(Meter* this) {
function Platform_getHostname (line 706) | void Platform_getHostname(char* buffer, size_t size) {
function Platform_setRelease (line 711) | static void Platform_setRelease(void) {
function FileLocks_ProcessData (line 785) | FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
function Platform_getPressureStall (line 790) | void Platform_getPressureStall(const char* file, bool some, double* ten,...
function Platform_getDiskIO (line 813) | bool Platform_getDiskIO(DiskIOData* data) {
function Platform_getNetworkIO (line 828) | bool Platform_getNetworkIO(NetworkIOData* data) {
function Platform_getFileDescriptors (line 841) | void Platform_getFileDescriptors(double* used, double* max) {
function Platform_getBattery (line 852) | void Platform_getBattery(double* level, ACPresence* isOnAC) {
function Platform_longOptionsUsage (line 861) | void Platform_longOptionsUsage(ATTR_UNUSED const char* name) {
function CommandLineStatus (line 868) | CommandLineStatus Platform_getLongOption(int opt, ATTR_UNUSED int argc, ...
function Platform_gettime_realtime (line 906) | void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) {
function Platform_gettime_monotonic (line 918) | void Platform_gettime_monotonic(uint64_t* msec) {
function Hashtable (line 930) | Hashtable* Platform_dynamicMeters(void) {
function Platform_dynamicMeterInit (line 934) | void Platform_dynamicMeterInit(Meter* meter) {
function Platform_dynamicMeterUpdateValues (line 940) | void Platform_dynamicMeterUpdateValues(Meter* meter) {
function Platform_dynamicMeterDisplay (line 946) | void Platform_dynamicMeterDisplay(const Meter* meter, RichString* out) {
function Hashtable (line 952) | Hashtable* Platform_dynamicColumns(void) {
function Platform_dynamicColumnWriteField (line 970) | bool Platform_dynamicColumnWriteField(const Process* proc, RichString* s...
function Hashtable (line 979) | Hashtable* Platform_dynamicScreens(void) {
function Platform_defaultDynamicScreens (line 983) | void Platform_defaultDynamicScreens(Settings* settings) {
function Platform_addDynamicScreen (line 987) | void Platform_addDynamicScreen(ScreenSettings* ss) {
function Platform_addDynamicScreenAvailableColumns (line 991) | void Platform_addDynamicScreenAvailableColumns(Panel* availableColumns, ...
function Platform_updateTables (line 996) | void Platform_updateTables(Machine* host) {
FILE: pcp/Platform.h
type Platform (line 45) | typedef struct Platform_ {
type timeval (line 145) | struct timeval
FILE: solaris/Platform.c
function Platform_init (line 149) | bool Platform_init(void) {
function Platform_done (line 154) | void Platform_done(void) {
function Platform_setBindings (line 158) | void Platform_setBindings(Htop_Action* keys) {
function Platform_getUptime (line 163) | int Platform_getUptime(void) {
function Platform_getLoadAverage (line 179) | void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
function pid_t (line 192) | pid_t Platform_getMaxPid(void) {
function Platform_setCPUValues (line 212) | double Platform_setCPUValues(Meter* this, unsigned int cpu) {
function Platform_setMemoryValues (line 253) | void Platform_setMemoryValues(Meter* this) {
function Platform_setSwapValues (line 261) | void Platform_setSwapValues(Meter* this) {
function Platform_setZfsArcValues (line 267) | void Platform_setZfsArcValues(Meter* this) {
function Platform_setZfsCompressedArcValues (line 273) | void Platform_setZfsCompressedArcValues(Meter* this) {
function Platform_buildenv (line 279) | static int Platform_buildenv(void* accum, struct ps_prochandle* Phandle,...
type ps_prochandle (line 305) | struct ps_prochandle
function FileLocks_ProcessData (line 324) | FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
function Platform_getFileDescriptors (line 329) | void Platform_getFileDescriptors(double* used, double* max) {
function Platform_getDiskIO (line 334) | bool Platform_getDiskIO(DiskIOData* data) {
function Platform_getNetworkIO (line 340) | bool Platform_getNetworkIO(NetworkIOData* data) {
function Platform_getBattery (line 346) | void Platform_getBattery(double* percent, ACPresence* isOnAC) {
FILE: solaris/Platform.h
type kvar_t (line 45) | typedef struct var kvar_t;
type envAccum (line 47) | typedef struct envAccum_ {
function Platform_getHostname (line 102) | static inline void Platform_getHostname(char* buffer, size_t size) {
function Platform_longOptionsUsage (line 116) | static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* nam...
function CommandLineStatus (line 118) | static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int o...
function Platform_gettime_realtime (line 122) | static inline void Platform_gettime_realtime(struct timeval* tv, uint64_...
function Platform_gettime_monotonic (line 126) | static inline void Platform_gettime_monotonic(uint64_t* msec) {
function kstat_t (line 136) | static inline kstat_t* kstat_lookup_wrapper(kstat_ctl_t* kc, const char*...
function Hashtable (line 142) | static inline Hashtable* Platform_dynamicMeters(void) {
function Platform_dynamicMetersDone (line 146) | static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* tab...
function Platform_dynamicMeterInit (line 148) | static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { }
function Platform_dynamicMeterUpdateValues (line 150) | static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* ...
function Platform_dynamicMeterDisplay (line 152) | static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter*...
function Hashtable (line 154) | static inline Hashtable* Platform_dynamicColumns(void) {
function Platform_dynamicColumnsDone (line 158) | static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* ta...
function Platform_dynamicColumnWriteField (line 164) | static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Pr...
function Hashtable (line 168) | static inline Hashtable* Platform_dynamicScreens(void) {
function Platform_defaultDynamicScreens (line 172) | static inline void Platform_defaultDynamicScreens(ATTR_UNUSED Settings* ...
function Platform_addDynamicScreen (line 174) | static inline void Platform_addDynamicScreen(ATTR_UNUSED ScreenSettings*...
function Platform_addDynamicScreenAvailableColumns (line 176) | static inline void Platform_addDynamicScreenAvailableColumns(ATTR_UNUSED...
function Platform_dynamicScreensDone (line 178) | static inline void Platform_dynamicScreensDone(ATTR_UNUSED Hashtable* sc...
FILE: solaris/SolarisMachine.c
function SolarisMachine_updateCPUcount (line 29) | static void SolarisMachine_updateCPUcount(SolarisMachine* this) {
function SolarisMachine_scanCPUTime (line 71) | static void SolarisMachine_scanCPUTime(SolarisMachine* this) {
function SolarisMachine_scanMemoryInfo (line 165) | static void SolarisMachine_scanMemoryInfo(SolarisMachine* this) {
function SolarisMachine_scanZfsArcstats (line 234) | static void SolarisMachine_scanZfsArcstats(SolarisMachine* this) {
function Machine_scan (line 283) | void Machine_scan(Machine* super) {
function Machine (line 292) | Machine* Machine_new(UsersTable* usersTable, uid_t userId) {
function Machine_delete (line 313) | void Machine_delete(Machine* super) {
function Machine_isCPUonline (line 325) | bool Machine_isCPUonline(const Machine* super, unsigned int id) {
FILE: solaris/SolarisMachine.h
type CPUData (line 32) | typedef struct CPUData_ {
type SolarisMachine (line 47) | typedef struct SolarisMachine_ {
FILE: solaris/SolarisProcess.c
function Process (line 63) | Process* SolarisProcess_new(const Machine* host) {
function Process_delete (line 70) | void Process_delete(Object* cast) {
function SolarisProcess_rowWriteField (line 77) | static void SolarisProcess_rowWriteField(const Row* super, RichString* s...
function SolarisProcess_compareByKey (line 104) | static int SolarisProcess_compareByKey(const Process* v1, const Process*...
FILE: solaris/SolarisProcess.h
type SolarisProcess (line 26) | typedef struct SolarisProcess_ {
FILE: solaris/SolarisProcessTable.c
function ProcessTable (line 49) | ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
function ProcessTable_delete (line 59) | void ProcessTable_delete(Object* cast) {
function SolarisProcessTable_updateExe (line 65) | static void SolarisProcessTable_updateExe(pid_t pid, Process* proc) {
function SolarisProcessTable_updateCwd (line 78) | static void SolarisProcessTable_updateCwd(pid_t pid, Process* proc) {
function ProcessState (line 92) | static inline ProcessState SolarisProcessTable_getProcessState(char stat...
function SolarisProcessTable_walkproc (line 110) | static int SolarisProcessTable_walkproc(psinfo_t* _psinfo, lwpsinfo_t* _...
function ProcessTable_goThroughEntries (line 266) | void ProcessTable_goThroughEntries(ProcessTable* super) {
FILE: solaris/SolarisProcessTable.h
type SolarisProcessTable (line 27) | typedef struct SolarisProcessTable_ {
FILE: unsupported/Platform.c
function Platform_init (line 93) | bool Platform_init(void) {
function Platform_done (line 98) | void Platform_done(void) {
function Platform_setBindings (line 102) | void Platform_setBindings(Htop_Action* keys) {
function Platform_getUptime (line 107) | int Platform_getUptime(void) {
function Platform_getLoadAverage (line 111) | void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
function pid_t (line 117) | pid_t Platform_getMaxPid(void) {
function Platform_setCPUValues (line 121) | double Platform_setCPUValues(Meter* this, unsigned int cpu) {
function Platform_setMemoryValues (line 133) | void Platform_setMemoryValues(Meter* this) {
function Platform_setSwapValues (line 141) | void Platform_setSwapValues(Meter* this) {
function FileLocks_ProcessData (line 150) | FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
function Platform_getFileDescriptors (line 155) | void Platform_getFileDescriptors(double* used, double* max) {
function Platform_getDiskIO (line 160) | bool Platform_getDiskIO(DiskIOData* data) {
function Platform_getNetworkIO (line 165) | bool Platform_getNetworkIO(NetworkIOData* data) {
function Platform_getBattery (line 170) | void Platform_getBattery(double* percent, ACPresence* isOnAC) {
function Platform_getHostname (line 175) | void Platform_getHostname(char* buffer, size_t size) {
FILE: unsupported/Platform.h
function Platform_longOptionsUsage (line 81) | static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* nam...
function CommandLineStatus (line 83) | static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int o...
function Platform_gettime_realtime (line 87) | static inline void Platform_gettime_realtime(struct timeval* tv, uint64_...
function Platform_gettime_monotonic (line 91) | static inline void Platform_gettime_monotonic(uint64_t* msec) {
function Hashtable (line 95) | static inline Hashtable* Platform_dynamicMeters(void) {
function Platform_dynamicMetersDone (line 99) | static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* tab...
function Platform_dynamicMeterInit (line 101) | static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { }
function Platform_dynamicMeterUpdateValues (line 103) | static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* ...
function Platform_dynamicMeterDisplay (line 105) | static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter*...
function Hashtable (line 107) | static inline Hashtable* Platform_dynamicColumns(void) {
function Platform_dynamicColumnsDone (line 111) | static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* ta...
function Platform_dynamicColumnWriteField (line 117) | static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Pr...
function Hashtable (line 121) | static inline Hashtable* Platform_dynamicScreens(void) {
function Platform_defaultDynamicScreens (line 125) | static inline void Platform_defaultDynamicScreens(ATTR_UNUSED Settings* ...
function Platform_addDynamicScreen (line 127) | static inline void Platform_addDynamicScreen(ATTR_UNUSED ScreenSettings*...
function Platform_addDynamicScreenAvailableColumns (line 129) | static inline void Platform_addDynamicScreenAvailableColumns(ATTR_UNUSED...
function Platform_dynamicScreensDone (line 131) | static inline void Platform_dynamicScreensDone(ATTR_UNUSED Hashtable* sc...
FILE: unsupported/UnsupportedMachine.c
function Machine (line 18) | Machine* Machine_new(UsersTable* usersTable, uid_t userId) {
function Machine_delete (line 30) | void Machine_delete(Machine* super) {
function Machine_isCPUonline (line 36) | bool Machine_isCPUonline(const Machine* host, unsigned int id) {
function Machine_scan (line 44) | void Machine_scan(Machine* super) {
FILE: unsupported/UnsupportedMachine.h
type UnsupportedMachine (line 13) | typedef struct UnsupportedMachine_ {
FILE: unsupported/UnsupportedProcess.c
function Process (line 47) | Process* UnsupportedProcess_new(const Machine* host) {
function Process_delete (line 54) | void Process_delete(Object* cast) {
function UnsupportedProcess_rowWriteField (line 61) | static void UnsupportedProcess_rowWriteField(const Row* super, RichStrin...
function UnsupportedProcess_compareByKey (line 82) | static int UnsupportedProcess_compareByKey(const Process* v1, const Proc...
FILE: unsupported/UnsupportedProcess.h
type UnsupportedProcess (line 14) | typedef struct UnsupportedProcess_ {
FILE: unsupported/UnsupportedProcessTable.c
function ProcessTable (line 19) | ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
function ProcessTable_delete (line 29) | void ProcessTable_delete(Object* cast) {
function ProcessTable_goThroughEntries (line 35) | void ProcessTable_goThroughEntries(ProcessTable* super) {
FILE: unsupported/UnsupportedProcessTable.h
type UnsupportedProcessTable (line 13) | typedef struct UnsupportedProcessTable_ {
FILE: zfs/ZfsArcMeter.c
function ZfsArcMeter_readStats (line 26) | void ZfsArcMeter_readStats(Meter* this, const ZfsArcStats* stats) {
function ZfsArcMeter_updateValues (line 41) | static void ZfsArcMeter_updateValues(Meter* this) {
function ZfsArcMeter_display (line 55) | static void ZfsArcMeter_display(const Object* cast, RichString* out) {
FILE: zfs/ZfsArcStats.h
type ZfsArcStats (line 10) | typedef struct ZfsArcStats_ {
FILE: zfs/ZfsCompressedArcMeter.c
function ZfsCompressedArcMeter_readStats (line 27) | void ZfsCompressedArcMeter_readStats(Meter* this, const ZfsArcStats* sta...
function ZfsCompressedArcMeter_printRatioString (line 38) | static int ZfsCompressedArcMeter_printRatioString(const Meter* this, cha...
function ZfsCompressedArcMeter_updateValues (line 46) | static void ZfsCompressedArcMeter_updateValues(Meter* this) {
function ZfsCompressedArcMeter_display (line 52) | static void ZfsCompressedArcMeter_display(const Object* cast, RichString...
Condensed preview — 335 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,768K chars).
[
{
"path": ".editorconfig",
"chars": 384,
"preview": "# EditorConfig configuration for htop\n# http://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n# Unix-style "
},
{
"path": ".github/FUNDING.yml",
"chars": 58,
"preview": "custom: [\"https://hcb.hackclub.com/donations/start/htop\"]\n"
},
{
"path": ".github/dependabot.yml",
"chars": 118,
"preview": "---\n\nversion: 2\n\nupdates:\n - package-ecosystem: github-actions\n directory: /\n schedule:\n interval: weekly\n"
},
{
"path": ".github/workflows/build_release.yml",
"chars": 1454,
"preview": "name: Build Source Release\n\n# Trigger whenever a release is created\non:\n release:\n types:\n - created\n\njobs:\n b"
},
{
"path": ".github/workflows/ci.yml",
"chars": 15818,
"preview": "name: CI\n\non: [ push, pull_request ]\n\nenv:\n # Enable format attributes in ncurses headers\n # Enable fortified memory/s"
},
{
"path": ".github/workflows/codeql-analysis.yml",
"chars": 1190,
"preview": "name: \"CodeQL\"\n\non:\n push:\n branches: [main]\n pull_request:\n branches: [main]\n schedule:\n - cron: '0 1 * * 0"
},
{
"path": ".github/workflows/coverity.yml",
"chars": 1152,
"preview": "name: \"Coverity\"\non:\n schedule:\n - cron: '0 1 * * *'\n\njobs:\n analyze:\n name: Analyze\n if: github.repository "
},
{
"path": ".github/workflows/htoprc",
"chars": 2286,
"preview": "# Beware! This file is rewritten by htop when settings are changed in the interface.\n# The parser is also very primitive"
},
{
"path": ".gitignore",
"chars": 588,
"preview": "# the binaries:\nhtop\npcp-htop\n\n# all object files\n*.o\n\n# skip all backups\n*.bak\n*~\n.*.sw?\n\n# skip coverage files\n*.gcda\n"
},
{
"path": ".travis.yml",
"chars": 233,
"preview": "language: c\n\ncompiler:\n - clang\n - gcc\n\nos:\n - freebsd\n\nscript:\n - ./autogen.sh\n - ./configure --enable-werror\n - "
},
{
"path": "AUTHORS",
"chars": 225,
"preview": "Originally authored by:\n Hisham H. Muhammad\n\nCurrently maintained by the htop dev team:\n Benny Baumann\n Christian Göttsc"
},
{
"path": "Action.c",
"chars": 33236,
"preview": "/*\nhtop - Action.c\n(C) 2015 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source distrib"
},
{
"path": "Action.h",
"chars": 1682,
"preview": "#ifndef HEADER_Action\n#define HEADER_Action\n/*\nhtop - Action.h\n(C) 2015 Hisham H. Muhammad\nReleased under the GNU GPLv2+"
},
{
"path": "Affinity.c",
"chars": 3541,
"preview": "/*\nhtop - Affinity.c\n(C) 2004-2011 Hisham H. Muhammad\n(C) 2020 Red Hat, Inc. All Rights Reserved.\nReleased under the GN"
},
{
"path": "Affinity.h",
"chars": 979,
"preview": "#ifndef HEADER_Affinity\n#define HEADER_Affinity\n/*\nhtop - Affinity.h\n(C) 2004-2011 Hisham H. Muhammad\n(C) 2020,2023 Red "
},
{
"path": "AffinityPanel.c",
"chars": 12902,
"preview": "/*\nhtop - AffinityPanel.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the so"
},
{
"path": "AffinityPanel.h",
"chars": 483,
"preview": "#ifndef HEADER_AffinityPanel\n#define HEADER_AffinityPanel\n/*\nhtop - AffinityPanel.h\n(C) 2004-2011 Hisham H. Muhammad\nRel"
},
{
"path": "AvailableColumnsPanel.c",
"chars": 4845,
"preview": "/*\nhtop - AvailableColumnsPanel.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\ni"
},
{
"path": "AvailableColumnsPanel.h",
"chars": 660,
"preview": "#ifndef HEADER_AvailableColumnsPanel\n#define HEADER_AvailableColumnsPanel\n/*\nhtop - AvailableColumnsPanel.h\n(C) 2004-201"
},
{
"path": "AvailableMetersPanel.c",
"chars": 6033,
"preview": "/*\nhtop - AvailableMetersPanel.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin"
},
{
"path": "AvailableMetersPanel.h",
"chars": 767,
"preview": "#ifndef HEADER_AvailableMetersPanel\n#define HEADER_AvailableMetersPanel\n/*\nhtop - AvailableMetersPanel.h\n(C) 2004-2011 H"
},
{
"path": "BatteryMeter.c",
"chars": 1680,
"preview": "/*\nhtop - BatteryMeter.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sou"
},
{
"path": "BatteryMeter.h",
"chars": 448,
"preview": "#ifndef HEADER_BatteryMeter\n#define HEADER_BatteryMeter\n/*\nhtop - BatteryMeter.h\n(C) 2004-2011 Hisham H. Muhammad\nReleas"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 5479,
"preview": "# `htop` Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participation in our\nco"
},
{
"path": "CONTRIBUTING.md",
"chars": 2800,
"preview": "Contributing Guide\n==================\n\nThank you so much for taking the time to contribute to htop!\n\nBe Kind\n-------\n\nWe"
},
{
"path": "COPYING",
"chars": 18092,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Fr"
},
{
"path": "CPUMeter.c",
"chars": 20544,
"preview": "/*\nhtop - CPUMeter.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source "
},
{
"path": "CPUMeter.h",
"chars": 1183,
"preview": "#ifndef HEADER_CPUMeter\n#define HEADER_CPUMeter\n/*\nhtop - CPUMeter.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the"
},
{
"path": "CRT.c",
"chars": 55862,
"preview": "/*\nhtop - CRT.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source distr"
},
{
"path": "CRT.h",
"chars": 4382,
"preview": "#ifndef HEADER_CRT\n#define HEADER_CRT\n/*\nhtop - CRT.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, se"
},
{
"path": "CategoriesPanel.c",
"chars": 6412,
"preview": "/*\nhtop - CategoriesPanel.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the "
},
{
"path": "CategoriesPanel.h",
"chars": 589,
"preview": "#ifndef HEADER_CategoriesPanel\n#define HEADER_CategoriesPanel\n/*\nhtop - CategoriesPanel.h\n(C) 2004-2011 Hisham H. Muhamm"
},
{
"path": "ChangeLog",
"chars": 50289,
"preview": "What's new in version 3.4.1\n\n* Support for PMAPI v3 for PCP\n* PCP code cleanups\n* Proper checks for strchrnul\n* Code cle"
},
{
"path": "ClockMeter.c",
"chars": 1046,
"preview": "/*\nhtop - ClockMeter.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sourc"
},
{
"path": "ClockMeter.h",
"chars": 281,
"preview": "#ifndef HEADER_ClockMeter\n#define HEADER_ClockMeter\n/*\nhtop - ClockMeter.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased und"
},
{
"path": "ColorsPanel.c",
"chars": 2799,
"preview": "/*\nhtop - ColorsPanel.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sour"
},
{
"path": "ColorsPanel.h",
"chars": 444,
"preview": "#ifndef HEADER_ColorsPanel\n#define HEADER_ColorsPanel\n/*\nhtop - ColorsPanel.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased "
},
{
"path": "ColumnsPanel.c",
"chars": 4629,
"preview": "/*\nhtop - ColumnsPanel.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sou"
},
{
"path": "ColumnsPanel.h",
"chars": 692,
"preview": "#ifndef HEADER_ColumnsPanel\n#define HEADER_ColumnsPanel\n/*\nhtop - ColumnsPanel.h\n(C) 2004-2011 Hisham H. Muhammad\nReleas"
},
{
"path": "CommandLine.c",
"chars": 15448,
"preview": "/*\nhtop - CommandLine.c\n(C) 2004-2011 Hisham H. Muhammad\n(C) 2020-2021 htop dev team\nReleased under the GNU GPLv2+, see "
},
{
"path": "CommandLine.h",
"chars": 413,
"preview": "#ifndef HEADER_CommandLine\n#define HEADER_CommandLine\n/*\nhtop - CommandLine.h\n(C) 2004-2011 Hisham H. Muhammad\n(C) 2020-"
},
{
"path": "CommandScreen.c",
"chars": 2214,
"preview": "/*\nhtop - CommandScreen.c\n(C) 2017,2020 ryenus\n(C) 2020,2021 htop dev team\nReleased under the GNU GPLv2+, see the COPYIN"
},
{
"path": "CommandScreen.h",
"chars": 526,
"preview": "#ifndef HEADER_CommandScreen\n#define HEADER_CommandScreen\n/*\nhtop - CommandScreen.h\n(C) 2017,2020 ryenus\n(C) 2020,2021 h"
},
{
"path": "DateTimeMeter.c",
"chars": 1818,
"preview": "/*\nhtop - DateTimeMeter.c\n(C) 2004-2020 Hisham H. Muhammad, Michael Schönitzer\nReleased under the GNU GPLv2+, see the CO"
},
{
"path": "DateTimeMeter.h",
"chars": 335,
"preview": "#ifndef HEADER_DateTimeMeter\n#define HEADER_DateTimeMeter\n/*\nhtop - DateTimeMeter.h\n(C) 2004-2011 Hisham H. Muhammad\nRel"
},
{
"path": "Debug.h",
"chars": 952,
"preview": "#ifndef HEADER_Debug\n#define HEADER_Debug\n/*\nhtop - Debug.h\n(C) 2020 htop dev team\nReleased under the GNU GPLv2+, see th"
},
{
"path": "DiskIOMeter.c",
"chars": 11063,
"preview": "/*\nhtop - DiskIOMeter.c\n(C) 2020 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source distrib"
},
{
"path": "DiskIOMeter.h",
"chars": 572,
"preview": "#ifndef HEADER_DiskIOMeter\n#define HEADER_DiskIOMeter\n/*\nhtop - DiskIOMeter.h\n(C) 2020 htop dev team\nReleased under the "
},
{
"path": "DisplayOptionsPanel.c",
"chars": 9627,
"preview": "/*\nhtop - DisplayOptionsPanel.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin "
},
{
"path": "DisplayOptionsPanel.h",
"chars": 630,
"preview": "#ifndef HEADER_DisplayOptionsPanel\n#define HEADER_DisplayOptionsPanel\n/*\nhtop - DisplayOptionsPanel.h\n(C) 2004-2011 Hish"
},
{
"path": "DynamicColumn.c",
"chars": 1962,
"preview": "/*\nhtop - DynamicColumn.c\n(C) 2021 Sohaib Mohammed\n(C) 2021 htop dev team\n(C) 2021 Red Hat, Inc. All Rights Reserved.\nR"
},
{
"path": "DynamicColumn.h",
"chars": 1396,
"preview": "#ifndef HEADER_DynamicColumn\n#define HEADER_DynamicColumn\n/*\nhtop - DynamicColumn.h\n(C) 2023 htop dev team\nReleased unde"
},
{
"path": "DynamicMeter.c",
"chars": 3594,
"preview": "/*\nhtop - DynamicMeter.c\n(C) 2021 htop dev team\n(C) 2021 Red Hat, Inc. All Rights Reserved.\nReleased under the GNU GPLv"
},
{
"path": "DynamicMeter.h",
"chars": 794,
"preview": "#ifndef HEADER_DynamicMeter\n#define HEADER_DynamicMeter\n/*\nhtop - DynamicMeter.h\n(C) 2021 htop dev team\n(C) 2021 Red Hat"
},
{
"path": "DynamicScreen.c",
"chars": 1627,
"preview": "/*\nhtop - DynamicScreen.c\n(C) 2022 Sohaib Mohammed\n(C) 2022-2023 htop dev team\nReleased under the GNU GPLv2+, see the CO"
},
{
"path": "DynamicScreen.h",
"chars": 953,
"preview": "#ifndef HEADER_DynamicScreen\n#define HEADER_DynamicScreen\n/*\nhtop - DynamicColumn.h\n(C) 2023 htop dev team\nReleased unde"
},
{
"path": "EnvScreen.c",
"chars": 1692,
"preview": "/*\nhtop - EnvScreen.c\n(C) 2015,2016 Michael Klein\n(C) 2016,2017 Hisham H. Muhammad\n(C) 2020,2021 htop dev team\nReleased "
},
{
"path": "EnvScreen.h",
"chars": 530,
"preview": "#ifndef HEADER_EnvScreen\n#define HEADER_EnvScreen\n/*\nhtop - EnvScreen.h\n(C) 2015,2016 Michael Klein\n(C) 2016,2017 Hisham"
},
{
"path": "FileDescriptorMeter.c",
"chars": 3761,
"preview": "/*\nhtop - FileDescriptorMeter.c\n(C) 2022 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source"
},
{
"path": "FileDescriptorMeter.h",
"chars": 307,
"preview": "#ifndef HEADER_FileDescriptorMeter\n#define HEADER_FileDescriptorMeter\n/*\nhtop - FileDescriptorMeter.h\n(C) 2022 htop dev "
},
{
"path": "FunctionBar.c",
"chars": 4615,
"preview": "/*\nhtop - FunctionBar.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sour"
},
{
"path": "FunctionBar.h",
"chars": 1015,
"preview": "#ifndef HEADER_FunctionBar\n#define HEADER_FunctionBar\n/*\nhtop - FunctionBar.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased "
},
{
"path": "GPUMeter.c",
"chars": 4643,
"preview": "/*\nhtop - GPUMeter.c\n(C) 2023 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source distributi"
},
{
"path": "GPUMeter.h",
"chars": 533,
"preview": "#ifndef HEADER_GPUMeter\n#define HEADER_GPUMeter\n/*\nhtop - GPUMeter.h\n(C) 2023 htop dev team\nReleased under the GNU GPLv2"
},
{
"path": "Hashtable.c",
"chars": 7918,
"preview": "/*\nhtop - Hashtable.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source"
},
{
"path": "Hashtable.h",
"chars": 941,
"preview": "#ifndef HEADER_Hashtable\n#define HEADER_Hashtable\n/*\nhtop - Hashtable.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased under "
},
{
"path": "Header.c",
"chars": 9650,
"preview": "/*\nhtop - Header.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source di"
},
{
"path": "Header.h",
"chars": 1126,
"preview": "#ifndef HEADER_Header\n#define HEADER_Header\n/*\nhtop - Header.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU G"
},
{
"path": "HeaderLayout.h",
"chars": 3167,
"preview": "#ifndef HEADER_HeaderLayout\n#define HEADER_HeaderLayout\n/*\nhtop - HeaderLayout.h\n(C) 2021 htop dev team\nReleased under t"
},
{
"path": "HeaderOptionsPanel.c",
"chars": 2501,
"preview": "/*\nhtop - HeaderOptionsPanel.c\n(C) 2021 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source "
},
{
"path": "HeaderOptionsPanel.h",
"chars": 585,
"preview": "#ifndef HEADER_HeaderOptionsPanel\n#define HEADER_HeaderOptionsPanel\n/*\nhtop - ColorsPanel.h\n(C) 2021 htop dev team\nRelea"
},
{
"path": "HostnameMeter.c",
"chars": 883,
"preview": "/*\nhtop - HostnameMeter.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the so"
},
{
"path": "HostnameMeter.h",
"chars": 293,
"preview": "#ifndef HEADER_HostnameMeter\n#define HEADER_HostnameMeter\n/*\nhtop - HostnameMeter.h\n(C) 2004-2011 Hisham H. Muhammad\nRel"
},
{
"path": "IncSet.c",
"chars": 7155,
"preview": "/*\nhtop - IncSet.c\n(C) 2005-2012 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source di"
},
{
"path": "IncSet.h",
"chars": 1395,
"preview": "#ifndef HEADER_IncSet\n#define HEADER_IncSet\n/*\nhtop - IncSet.h\n(C) 2005-2012 Hisham H. Muhammad\nReleased under the GNU G"
},
{
"path": "InfoScreen.c",
"chars": 5584,
"preview": "/*\nhtop - InfoScreen.c\n(C) 2016 Hisham H. Muhammad\n(C) 2020,2022 htop dev team\nReleased under the GNU GPLv2+, see the CO"
},
{
"path": "InfoScreen.h",
"chars": 1843,
"preview": "#ifndef HEADER_InfoScreen\n#define HEADER_InfoScreen\n/*\nhtop - InfoScreen.h\n(C) 2016 Hisham H. Muhammad\n(C) 2020,2022 hto"
},
{
"path": "ListItem.c",
"chars": 1813,
"preview": "/*\nhtop - ListItem.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source "
},
{
"path": "ListItem.h",
"chars": 848,
"preview": "#ifndef HEADER_ListItem\n#define HEADER_ListItem\n/*\nhtop - ListItem.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the"
},
{
"path": "LoadAverageMeter.c",
"chars": 4024,
"preview": "/*\nhtop - LoadAverageMeter.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the"
},
{
"path": "LoadAverageMeter.h",
"chars": 347,
"preview": "#ifndef HEADER_LoadAverageMeter\n#define HEADER_LoadAverageMeter\n/*\nhtop - LoadAverageMeter.h\n(C) 2004-2011 Hisham H. Muh"
},
{
"path": "Machine.c",
"chars": 3699,
"preview": "/*\nhtop - Machine.c\n(C) 2023 Red Hat, Inc.\n(C) 2004,2005 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYI"
},
{
"path": "Machine.h",
"chars": 2058,
"preview": "#ifndef HEADER_Machine\n#define HEADER_Machine\n/*\nhtop - Machine.h\n(C) 2023 Red Hat, Inc.\n(C) 2004,2005 Hisham H. Muhamma"
},
{
"path": "Macros.h",
"chars": 4548,
"preview": "#ifndef HEADER_Macros\n#define HEADER_Macros\n/*\nhtop - Macros.h\n(C) 2020-2023 htop dev team\nReleased under the GNU GPLv2+"
},
{
"path": "MainPanel.c",
"chars": 7869,
"preview": "/*\nhtop - ColumnsPanel.c\n(C) 2004-2015 Hisham H. Muhammad\n(C) 2020 Red Hat, Inc. All Rights Reserved.\nReleased under th"
},
{
"path": "MainPanel.h",
"chars": 1389,
"preview": "#ifndef HEADER_MainPanel\n#define HEADER_MainPanel\n/*\nhtop - ColumnsPanel.h\n(C) 2004-2015 Hisham H. Muhammad\n(C) 2020 Red"
},
{
"path": "Makefile.am",
"chars": 11408,
"preview": "if !HTOP_PCP\nbin_PROGRAMS = htop\nmyhtopplatprogram = htop.c\nelse\nbin_PROGRAMS = pcp-htop\nmyhtopplatprogram = pcp-htop.c\n"
},
{
"path": "MemoryMeter.c",
"chars": 3798,
"preview": "/*\nhtop - MemoryMeter.c\n(C) 2004-2011 Hisham H. Muhammad\n(C) 2025 htop dev team\nReleased under the GNU GPLv2+, see the C"
},
{
"path": "MemoryMeter.h",
"chars": 682,
"preview": "#ifndef HEADER_MemoryMeter\n#define HEADER_MemoryMeter\n/*\nhtop - MemoryMeter.h\n(C) 2004-2011 Hisham H. Muhammad\n(C) 2025 "
},
{
"path": "MemorySwapMeter.c",
"chars": 2818,
"preview": "/*\nhtop - MemorySwapMeter.c\n(C) 2021 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source dis"
},
{
"path": "MemorySwapMeter.h",
"chars": 291,
"preview": "#ifndef HEADER_MemorySwapMeter\n#define HEADER_MemorySwapMeter\n/*\nhtop - MemorySwapMeter.h\n(C) 2021 htop dev team\nRelease"
},
{
"path": "Meter.c",
"chars": 16919,
"preview": "/*\nhtop - Meter.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source dis"
},
{
"path": "Meter.h",
"chars": 6072,
"preview": "#ifndef HEADER_Meter\n#define HEADER_Meter\n/*\nhtop - Meter.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv"
},
{
"path": "MeterMode.h",
"chars": 632,
"preview": "#ifndef HEADER_MeterMode\n#define HEADER_MeterMode\n/*\nhtop - MeterMode.h\n(C) 2024 htop dev team\nReleased under the GNU GP"
},
{
"path": "MetersPanel.c",
"chars": 6590,
"preview": "/*\nhtop - MetersPanel.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sour"
},
{
"path": "MetersPanel.h",
"chars": 825,
"preview": "#ifndef HEADER_MetersPanel\n#define HEADER_MetersPanel\n/*\nhtop - MetersPanel.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased "
},
{
"path": "NEWS",
"chars": 131,
"preview": "\nSee the commit history for news of the past.\nSee the bug tracker for news of the future.\nRun the program for news of th"
},
{
"path": "NetworkIOMeter.c",
"chars": 6051,
"preview": "/*\nhtop - NetworkIOMeter.c\n(C) 2020-2023 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source"
},
{
"path": "NetworkIOMeter.h",
"chars": 509,
"preview": "#ifndef HEADER_NetworkIOMeter\n#define HEADER_NetworkIOMeter\n/*\nhtop - NetworkIOMeter.h\n(C) 2020-2023 htop dev team\nRelea"
},
{
"path": "Object.c",
"chars": 591,
"preview": "/*\nhtop - Object.c\n(C) 2004-2012 Hisham H. Muhammad\n(C) 2020 Red Hat, Inc. All Rights Reserved.\nReleased under the GNU "
},
{
"path": "Object.h",
"chars": 1759,
"preview": "#ifndef HEADER_Object\n#define HEADER_Object\n/*\nhtop - Object.h\n(C) 2004-2012 Hisham H. Muhammad\n(C) 2020 Red Hat, Inc. "
},
{
"path": "OpenFilesScreen.c",
"chars": 9626,
"preview": "/*\nhtop - OpenFilesScreen.c\n(C) 2005-2006 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the "
},
{
"path": "OpenFilesScreen.h",
"chars": 572,
"preview": "#ifndef HEADER_OpenFilesScreen\n#define HEADER_OpenFilesScreen\n/*\nhtop - OpenFilesScreen.h\n(C) 2005-2006 Hisham H. Muhamm"
},
{
"path": "OptionItem.c",
"chars": 5465,
"preview": "/*\nhtop - OptionItem.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sourc"
},
{
"path": "OptionItem.h",
"chars": 1862,
"preview": "#ifndef HEADER_OptionItem\n#define HEADER_OptionItem\n/*\nhtop - OptionItem.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased und"
},
{
"path": "Panel.c",
"chars": 13586,
"preview": "/*\nhtop - Panel.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source dis"
},
{
"path": "Panel.h",
"chars": 4023,
"preview": "#ifndef HEADER_Panel\n#define HEADER_Panel\n/*\nhtop - Panel.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv"
},
{
"path": "Process.c",
"chars": 43423,
"preview": "/*\nhtop - Process.c\n(C) 2004-2015 Hisham H. Muhammad\n(C) 2020 Red Hat, Inc. All Rights Reserved.\nReleased under the GNU"
},
{
"path": "Process.h",
"chars": 9981,
"preview": "#ifndef HEADER_Process\n#define HEADER_Process\n/*\nhtop - Process.h\n(C) 2004-2015 Hisham H. Muhammad\n(C) 2020 Red Hat, Inc"
},
{
"path": "ProcessLocksScreen.c",
"chars": 3475,
"preview": "/*\nhtop - ProcessLocksScreen.c\n(C) 2020 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source "
},
{
"path": "ProcessLocksScreen.h",
"chars": 1080,
"preview": "#ifndef HEADER_ProcessLocksScreen\n#define HEADER_ProcessLocksScreen\n/*\nhtop - ProcessLocksScreen.h\n(C) 2020 htop dev tea"
},
{
"path": "ProcessTable.c",
"chars": 2842,
"preview": "/*\nhtop - ProcessTable.c\n(C) 2004,2005 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sou"
},
{
"path": "ProcessTable.h",
"chars": 1364,
"preview": "#ifndef HEADER_ProcessTable\n#define HEADER_ProcessTable\n/*\nhtop - ProcessTable.h\n(C) 2004,2005 Hisham H. Muhammad\nReleas"
},
{
"path": "ProvideCurses.h",
"chars": 858,
"preview": "#ifndef HEADER_ProvideCurses\n#define HEADER_ProvideCurses\n/*\nhtop - ProvideCurses.h\n(C) 2004,2011 Hisham H. Muhammad\nRel"
},
{
"path": "ProvideTerm.h",
"chars": 509,
"preview": "#ifndef HEADER_ProvideTerm\n#define HEADER_ProvideTerm\n/*\nhtop - ProvideTerm.h\n(C) 2023 htop dev team\nReleased under the "
},
{
"path": "README.md",
"chars": 8511,
"preview": "# [](https://htop.dev)\n\n[](https://g"
},
{
"path": "RichString.c",
"chars": 7904,
"preview": "/*\nhtop - RichString.c\n(C) 2004,2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sourc"
},
{
"path": "RichString.h",
"chars": 2869,
"preview": "#ifndef HEADER_RichString\n#define HEADER_RichString\n/*\nhtop - RichString.h\n(C) 2004,2011 Hisham H. Muhammad\nReleased und"
},
{
"path": "Row.c",
"chars": 19265,
"preview": "/*\nhtop - Row.c\n(C) 2004-2015 Hisham H. Muhammad\n(C) 2020-2023 Red Hat, Inc. All Rights Reserved.\nReleased under the GN"
},
{
"path": "Row.h",
"chars": 5735,
"preview": "#ifndef HEADER_Row\n#define HEADER_Row\n/*\nhtop - Row.h\n(C) 2004-2015 Hisham H. Muhammad\n(C) 2023 htop dev team\nReleased u"
},
{
"path": "RowField.h",
"chars": 1175,
"preview": "#ifndef HEADER_RowField\n#define HEADER_RowField\n/*\nhtop - RowField.h\n(C) 2023 htop dev team\nReleased under the GNU GPLv2"
},
{
"path": "Scheduling.c",
"chars": 4281,
"preview": "/*\nhtop - Scheduling.c\n(C) 2023 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source distribu"
},
{
"path": "Scheduling.h",
"chars": 1076,
"preview": "#ifndef HEADER_Scheduling\n#define HEADER_Scheduling\n/*\nhtop - Scheduling.h\n(C) 2023 htop dev team\nReleased under the GNU"
},
{
"path": "ScreenManager.c",
"chars": 13029,
"preview": "/*\nhtop - ScreenManager.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the so"
},
{
"path": "ScreenManager.h",
"chars": 1137,
"preview": "#ifndef HEADER_ScreenManager\n#define HEADER_ScreenManager\n/*\nhtop - ScreenManager.h\n(C) 2004-2011 Hisham H. Muhammad\nRel"
},
{
"path": "ScreenTabsPanel.c",
"chars": 11907,
"preview": "/*\nhtop - ScreenTabsPanel.c\n(C) 2023 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source dis"
},
{
"path": "ScreenTabsPanel.h",
"chars": 1318,
"preview": "#ifndef HEADER_ScreenTabsPanel\n#define HEADER_ScreenTabsPanel\n/*\nhtop - ScreenTabsPanel.h\n(C) 2023 htop dev team\nRelease"
},
{
"path": "ScreensPanel.c",
"chars": 11410,
"preview": "/*\nhtop - ScreensPanel.c\n(C) 2004-2011 Hisham H. Muhammad\n(C) 2020-2026 htop dev team\nReleased under the GNU GPLv2+, see"
},
{
"path": "ScreensPanel.h",
"chars": 1214,
"preview": "#ifndef HEADER_ScreensPanel\n#define HEADER_ScreensPanel\n/*\nhtop - ScreensPanel.h\n(C) 2004-2011 Hisham H. Muhammad\n(C) 20"
},
{
"path": "Settings.c",
"chars": 36732,
"preview": "/*\nhtop - Settings.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source "
},
{
"path": "Settings.h",
"chars": 3999,
"preview": "#ifndef HEADER_Settings\n#define HEADER_Settings\n/*\nhtop - Settings.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the"
},
{
"path": "SignalsPanel.c",
"chars": 1532,
"preview": "/*\nhtop - SignalsPanel.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sou"
},
{
"path": "SignalsPanel.h",
"chars": 471,
"preview": "#ifndef HEADER_SignalsPanel\n#define HEADER_SignalsPanel\n/*\nhtop - SignalsPanel.h\n(C) 2004-2011 Hisham H. Muhammad\nReleas"
},
{
"path": "SwapMeter.c",
"chars": 2597,
"preview": "/*\nhtop - SwapMeter.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source"
},
{
"path": "SwapMeter.h",
"chars": 452,
"preview": "#ifndef HEADER_SwapMeter\n#define HEADER_SwapMeter\n/*\nhtop - SwapMeter.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased under "
},
{
"path": "SysArchMeter.c",
"chars": 951,
"preview": "/*\nhtop - SysArchMeter.c\n(C) 2021 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source distri"
},
{
"path": "SysArchMeter.h",
"chars": 278,
"preview": "#ifndef HEADER_SysArchMeter\n#define HEADER_SysArchMeter\n/*\nhtop - SysArchMeter.h\n(C) 2021 htop dev team\nReleased under t"
},
{
"path": "TESTPLAN",
"chars": 2868,
"preview": "\nMain screen:\n\n For all views, all modes:\n\n Mouse click header - nothing happens.\n\n Mouse click on ProcessTa"
},
{
"path": "Table.c",
"chars": 11761,
"preview": "/*\nhtop - Table.c\n(C) 2004,2005 Hisham H. Muhammad\n(C) 2023 htop dev team\nReleased under the GNU GPLv2+, see the COPYING"
},
{
"path": "Table.h",
"chars": 2755,
"preview": "#ifndef HEADER_Table\n#define HEADER_Table\n/*\nhtop - Table.h\n(C) 2004,2005 Hisham H. Muhammad\n(C) 2023 htop dev team\nRele"
},
{
"path": "TasksMeter.c",
"chars": 3001,
"preview": "/*\nhtop - TasksMeter.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sourc"
},
{
"path": "TasksMeter.h",
"chars": 281,
"preview": "#ifndef HEADER_TasksMeter\n#define HEADER_TasksMeter\n/*\nhtop - TasksMeter.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased und"
},
{
"path": "TraceScreen.c",
"chars": 6321,
"preview": "/*\nhtop - TraceScreen.c\n(C) 2005-2006 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sour"
},
{
"path": "TraceScreen.h",
"chars": 718,
"preview": "#ifndef HEADER_TraceScreen\n#define HEADER_TraceScreen\n/*\nhtop - TraceScreen.h\n(C) 2005-2006 Hisham H. Muhammad\nReleased "
},
{
"path": "UptimeMeter.c",
"chars": 2338,
"preview": "/*\nhtop - UptimeMeter.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sour"
},
{
"path": "UptimeMeter.h",
"chars": 336,
"preview": "#ifndef HEADER_UptimeMeter\n#define HEADER_UptimeMeter\n/*\nhtop - UptimeMeter.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased "
},
{
"path": "UsersTable.c",
"chars": 1151,
"preview": "/*\nhtop - UsersTable.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sourc"
},
{
"path": "UsersTable.h",
"chars": 533,
"preview": "#ifndef HEADER_UsersTable\n#define HEADER_UsersTable\n/*\nhtop - UsersTable.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased und"
},
{
"path": "Vector.c",
"chars": 9461,
"preview": "/*\nhtop - Vector.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source di"
},
{
"path": "Vector.h",
"chars": 2523,
"preview": "#ifndef HEADER_Vector\n#define HEADER_Vector\n/*\nhtop - Vector.h\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU G"
},
{
"path": "XUtils.c",
"chars": 8189,
"preview": "/*\nhtop - StringUtils.c\n(C) 2004-2011 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sour"
},
{
"path": "XUtils.h",
"chars": 4981,
"preview": "#ifndef HEADER_XUtils\n#define HEADER_XUtils\n/*\nhtop - StringUtils.h\n(C) 2004-2011 Hisham H. Muhammad\n(C) 2020-2023 htop "
},
{
"path": "autogen.sh",
"chars": 55,
"preview": "#!/bin/sh\nautoreconf --force --install --verbose -Wall\n"
},
{
"path": "check-pcp-style.sh",
"chars": 5440,
"preview": "#!/bin/bash\n\nset -eu -o pipefail\n\nPCP_DIR=\"$(dirname \"$0\")/pcp\"\n\nif [ ! -d \"${PCP_DIR}\" ]; then\n echo Could not find P"
},
{
"path": "configure.ac",
"chars": 48657,
"preview": "# -*- Autoconf -*-\n# Process this file with autoconf to produce a configur"
},
{
"path": "darwin/DarwinMachine.c",
"chars": 3991,
"preview": "/*\nhtop - DarwinMachine.c\n(C) 2014 Hisham H. Muhammad\n(C) 2023 htop dev team\nReleased under the GNU GPLv2+, see the COPY"
},
{
"path": "darwin/DarwinMachine.h",
"chars": 626,
"preview": "#ifndef HEADER_DarwinMachine\n#define HEADER_DarwinMachine\n/*\nhtop - DarwinMachine.h\n(C) 2014 Hisham H. Muhammad\nReleased"
},
{
"path": "darwin/DarwinProcess.c",
"chars": 19671,
"preview": "/*\nhtop - DarwinProcess.c\n(C) 2015 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source "
},
{
"path": "darwin/DarwinProcess.h",
"chars": 1232,
"preview": "#ifndef HEADER_DarwinProcess\n#define HEADER_DarwinProcess\n/*\nhtop - DarwinProcess.h\n(C) 2015 Hisham H. Muhammad\nReleased"
},
{
"path": "darwin/DarwinProcessTable.c",
"chars": 4030,
"preview": "/*\nhtop - DarwinProcessTable.c\n(C) 2014 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the so"
},
{
"path": "darwin/DarwinProcessTable.h",
"chars": 426,
"preview": "#ifndef HEADER_DarwinProcessTable\n#define HEADER_DarwinProcessTable\n/*\nhtop - DarwinProcessTable.h\n(C) 2014 Hisham H. Mu"
},
{
"path": "darwin/Platform.c",
"chars": 26737,
"preview": "/*\nhtop - darwin/Platform.c\n(C) 2014 Hisham H. Muhammad\n(C) 2015 David C. Hunt\nReleased under the GNU GPLv2+, see the CO"
},
{
"path": "darwin/Platform.h",
"chars": 4375,
"preview": "#ifndef HEADER_Platform\n#define HEADER_Platform\n/*\nhtop - darwin/Platform.h\n(C) 2014 Hisham H. Muhammad\n(C) 2015 David C"
},
{
"path": "darwin/PlatformHelpers.c",
"chars": 2673,
"preview": "/*\nhtop - darwin/PlatformHelpers.c\n(C) 2018 Pierre Malhaire, 2020-2021 htop dev team, 2021 Alexander Momchilov\nReleased "
},
{
"path": "darwin/PlatformHelpers.h",
"chars": 1003,
"preview": "#ifndef HEADER_PlatformHelpers\n#define HEADER_PlatformHelpers\n/*\nhtop - darwin/PlatformHelpers.h\n(C) 2018 Pierre Malhair"
},
{
"path": "darwin/ProcessField.h",
"chars": 425,
"preview": "#ifndef HEADER_DarwinProcessField\n#define HEADER_DarwinProcessField\n/*\nhtop - darwin/ProcessField.h\n(C) 2020 htop dev te"
},
{
"path": "docs/ai-contributions-policy.md",
"chars": 2354,
"preview": "# AI-Assisted Contributions Policy for htop\nv1.0, 2026-02-18\n\n1. You **MAY** use AI assistance for contributing to htop"
},
{
"path": "docs/styleguide.md",
"chars": 11854,
"preview": "htop coding style guide\n=======================\n\nNaming conventions\n------------------\n\nNames are important to convey wh"
},
{
"path": "dragonflybsd/DragonFlyBSDMachine.c",
"chars": 11704,
"preview": "/*\nhtop - DragonFlyBSDMachine.c\n(C) 2014 Hisham H. Muhammad\n(C) 2017 Diederik de Groot\nReleased under the GNU GPLv2+, se"
},
{
"path": "dragonflybsd/DragonFlyBSDMachine.h",
"chars": 1260,
"preview": "#ifndef HEADER_DragonFlyBSDMachine\n#define HEADER_DragonFlyBSDMachine\n/*\nhtop - DragonFlyBSDMachine.h\n(C) 2014 Hisham H."
},
{
"path": "dragonflybsd/DragonFlyBSDProcess.c",
"chars": 7327,
"preview": "/*\nhtop - dragonflybsd/DragonFlyBSDProcess.c\n(C) 2015 Hisham H. Muhammad\n(C) 2017 Diederik de Groot\nReleased under the G"
},
{
"path": "dragonflybsd/DragonFlyBSDProcess.h",
"chars": 687,
"preview": "#ifndef HEADER_DragonFlyBSDProcess\n#define HEADER_DragonFlyBSDProcess\n/*\nhtop - dragonflybsd/DragonFlyBSDProcess.h\n(C) 2"
},
{
"path": "dragonflybsd/DragonFlyBSDProcessTable.c",
"chars": 11351,
"preview": "/*\nhtop - DragonFlyBSDProcessTable.c\n(C) 2014 Hisham H. Muhammad\n(C) 2017 Diederik de Groot\nReleased under the GNU GPLv2"
},
{
"path": "dragonflybsd/DragonFlyBSDProcessTable.h",
"chars": 449,
"preview": "#ifndef HEADER_DragonFlyBSDProcessTable\n#define HEADER_DragonFlyBSDProcessTable\n/*\nhtop - DragonFlyBSDProcessTable.h\n(C)"
},
{
"path": "dragonflybsd/Platform.c",
"chars": 11468,
"preview": "/*\nhtop - dragonflybsd/Platform.c\n(C) 2014 Hisham H. Muhammad\n(C) 2017 Diederik de Groot\nReleased under the GNU GPLv2+, "
},
{
"path": "dragonflybsd/Platform.h",
"chars": 3869,
"preview": "#ifndef HEADER_Platform\n#define HEADER_Platform\n/*\nhtop - dragonflybsd/Platform.h\n(C) 2014 Hisham H. Muhammad\n(C) 2017 D"
},
{
"path": "dragonflybsd/ProcessField.h",
"chars": 484,
"preview": "#ifndef HEADER_DragonFlyBSDProcessField\n#define HEADER_DragonFlyBSDProcessField\n/*\nhtop - dragonflybsd/ProcessField.h\n(C"
},
{
"path": "freebsd/FreeBSDMachine.c",
"chars": 13967,
"preview": "/*\nhtop - FreeBSDMachine.c\n(C) 2014 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source"
},
{
"path": "freebsd/FreeBSDMachine.h",
"chars": 1031,
"preview": "#ifndef HEADER_FreeBSDMachine\n#define HEADER_FreeBSDMachine\n/*\nhtop - FreeBSDMachine.h\n(C) 2014 Hisham H. Muhammad\nRelea"
},
{
"path": "freebsd/FreeBSDProcess.c",
"chars": 8388,
"preview": "/*\nhtop - FreeBSDProcess.c\n(C) 2015 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the source"
},
{
"path": "freebsd/FreeBSDProcess.h",
"chars": 889,
"preview": "#ifndef HEADER_FreeBSDProcess\n#define HEADER_FreeBSDProcess\n/*\nhtop - FreeBSDProcess.h\n(C) 2015 Hisham H. Muhammad\nRelea"
},
{
"path": "freebsd/FreeBSDProcessTable.c",
"chars": 10344,
"preview": "/*\nhtop - FreeBSDProcessTable.c\n(C) 2014 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the s"
},
{
"path": "freebsd/FreeBSDProcessTable.h",
"chars": 462,
"preview": "#ifndef HEADER_FreeBSDProcessTable\n#define HEADER_FreeBSDProcessTable\n/*\nhtop - FreeBSDProcessTable.h\n(C) 2014 Hisham H."
},
{
"path": "freebsd/Platform.c",
"chars": 12633,
"preview": "/*\nhtop - freebsd/Platform.c\n(C) 2014 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin the sour"
},
{
"path": "freebsd/Platform.h",
"chars": 3877,
"preview": "#ifndef HEADER_Platform\n#define HEADER_Platform\n/*\nhtop - freebsd/Platform.h\n(C) 2014 Hisham H. Muhammad\nReleased under "
},
{
"path": "freebsd/ProcessField.h",
"chars": 534,
"preview": "#ifndef HEADER_FreeBSDProcessField\n#define HEADER_FreeBSDProcessField\n/*\nhtop - freebsd/ProcessField.h\n(C) 2020 htop dev"
},
{
"path": "generic/fdstat_sysctl.c",
"chars": 2133,
"preview": "/*\nhtop - generic/fdstat_sysctl.c\n(C) 2022-2023 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the"
},
{
"path": "generic/fdstat_sysctl.h",
"chars": 298,
"preview": "#ifndef HEADER_fdstat_sysctl\n#define HEADER_fdstat_sysctl\n/*\nhtop - generic/fdstat_sysctl.h\n(C) 2022-2023 htop dev team\n"
},
{
"path": "generic/gettime.c",
"chars": 1518,
"preview": "/*\nhtop - generic/gettime.c\n(C) 2021 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source dis"
},
{
"path": "generic/gettime.h",
"chars": 368,
"preview": "#ifndef HEADER_gettime\n#define HEADER_gettime\n/*\nhtop - generic/gettime.h\n(C) 2021 htop dev team\nReleased under the GNU "
},
{
"path": "generic/hostname.c",
"chars": 365,
"preview": "/*\nhtop - generic/hostname.c\n(C) 2021 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source di"
},
{
"path": "generic/hostname.h",
"chars": 282,
"preview": "#ifndef HEADER_hostname\n#define HEADER_hostname\n/*\nhtop - generic/hostname.h\n(C) 2021 htop dev team\nReleased under the G"
},
{
"path": "generic/openzfs_sysctl.c",
"chars": 4043,
"preview": "/*\nhtop - generic/openzfs_sysctl.c\n(C) 2014 Hisham H. Muhammad\nReleased under the GNU GPLv2+, see the COPYING file\nin th"
},
{
"path": "generic/openzfs_sysctl.h",
"chars": 367,
"preview": "#ifndef HEADER_openzfs_sysctl\n#define HEADER_openzfs_sysctl\n/*\nhtop - generic/openzfs_sysctl.h\n(C) 2014 Hisham H. Muhamm"
},
{
"path": "generic/uname.c",
"chars": 3426,
"preview": "/*\nhtop - generic/uname.c\n(C) 2021 htop dev team\nReleased under the GNU GPLv2+, see the COPYING file\nin the source distr"
},
{
"path": "generic/uname.h",
"chars": 411,
"preview": "#ifndef HEADER_uname\n#define HEADER_uname\n/*\nhtop - generic/uname.h\n(C) 2021 htop dev team\nReleased under the GNU GPLv2+"
},
{
"path": "htop.1.in",
"chars": 23644,
"preview": ".TH \"HTOP\" \"1\" \"2026\" \"@PACKAGE_STRING@\" \"User Commands\"\n.SH \"NAME\"\nhtop, pcp-htop \\- interactive process viewer\n.SH \"SY"
},
{
"path": "htop.c",
"chars": 356,
"preview": "/*\nhtop - htop.c\n(C) 2004-2011 Hisham H. Muhammad\n(C) 2020-2021 htop dev team\nReleased under the GNU GPLv2+, see the COP"
},
{
"path": "htop.desktop",
"chars": 2415,
"preview": "[Desktop Entry]\nType=Application\nVersion=1.0\nName=Htop\nGenericName=Process Viewer\nGenericName[ca]=Visualitzador de proce"
},
{
"path": "iwyu/htop.imp",
"chars": 1521,
"preview": "[\n { include: [\"<curses.h>\", \"private\", \"\\\"ProvideCurses.h\\\"\", \"public\"] },\n { include: [\"<ncurses.h>\", \"private\","
}
]
// ... and 135 more files (download for full content)
About this extraction
This page contains the full source code of the htop-dev/htop GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 335 files (1.6 MB), approximately 465.2k tokens, and a symbol index with 1659 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.