summaryrefslogtreecommitdiffstats
path: root/Header.c
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* Header: do not let multi-column meters expand to empty neighborsChristian Göttsche2021-09-181-1/+4
| | | | | | | | | | Extending to right neighbors is intended for text meters with an overlong content, so the whole text is shown if possible. Multi column meters, like the combined memory and swap meter, position its text depending on the given total width; keep the position to the original assigned header slot. Short term resolution for #796
* Header: use upper case floating point suffixChristian Göttsche2021-09-041-6/+6
|
* Reduce variable scopeChristian Göttsche2021-09-041-1/+2
| | | | | Also avoid declaring variables of different type, pointer and array, in the same line.
* IWYU updateChristian Göttsche2021-08-251-0/+2
|
* Tiny cleanup from review commentsDaniel Lange2021-08-231-2/+2
|
* Add option to change Header layoutChristian Göttsche2021-08-221-81/+114
|
* Add assert to improve backtraces on NULL function pointerChristian Göttsche2021-08-101-0/+1
|
* Ensure PCP dynamic metric configuration definition uniquenessNathan Scott2021-07-141-2/+2
| | | | | | | | | | | | | | It can happen that pcp-htop is presented multiple definitions of the same dynamic meter, e.g. if /etc/pcp/htop/meters has a definition matching one in ~/.config/htop/meters - instead of exiting with a duplicate metric error provide more meaningful diagnostics (on close) and also just skip over such entries. System files override home directories which overrides those found below the current working directory. Also fix the derived metric error diagnostic; because this is using CRT_fatalError, which is like perror(3), we must give a meaningful prefix (like program name) at the string end.
* Ensure we do not attempt to add a DynamicMeter via theNathan Scott2021-07-141-8/+12
| | | | | | | htoprc that we didn't find during start up. This just leaves blank sections of the display as @smalinux found. Related to https://github.com/htop-dev/htop/pull/682
* Add a new DynamicMeter class for runtime Meter extensionNathan Scott2021-07-071-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is based on exploratory work by Sohaib Mohamed. The end goal is two-fold - to support addition of Meters we build via configuration files for both the PCP platform and for scripts ( https://github.com/htop-dev/htop/issues/526 ) Here, we focus on generic code and the PCP support. A new class DynamicMeter is introduced - it uses the special case 'param' field handling that previously was used only by the CPUMeter, such that every runtime-configured Meter is given a unique identifier. Unlike with the CPUMeter this is used internally only. When reading/writing to htoprc instead of CPU(N) - where N is an integer param (CPU number) - we use the string name for each meter. For example, if we have a configuration for a DynamicMeter for some Redis metrics, we might read and write "Dynamic(redis)". This identifier is subsequently matched (back) up to the configuration file so we're able to re-create arbitrary user configurations. The PCP platform configuration file format is fairly simple. We expand configs from several directories, including the users homedir alongside htoprc (below htop/meters/) and also /etc/pcp/htop/meters. The format will be described via a new pcp-htop(5) man page, but its basically ini-style and each Meter has one or more metric expressions associated, as well as specifications for labels, color and so on via a dot separated notation for individual metrics within the Meter. A few initial sample configuration files are provided below ./pcp/meters that give the general idea. The PCP "derived" metric specification - see pmRegisterDerived(3) - is used as the syntax for specifying metrics in PCP DynamicMeters.
* Use unsigned types for CPU counts and associated variablesChristian Göttsche2021-03-191-4/+4
|
* Separate data-update and drawing of headerChristian Göttsche2021-03-041-0/+11
|
* Leave less right margin next to long (text) metersDaniel Lange2021-02-021-1/+1
|
* Use typedef names instead of raw struct onesChristian Göttsche2021-01-261-1/+1
|
* Allow meters in text mode to span empty neighbors to the rightChristian Göttsche2021-01-231-6/+42
| | | | Closes: #484
* Mark several non-modified pointer variables constChristian Göttsche2021-01-111-11/+11
|
* Remove unused function Header_readMeterNameChristian Göttsche2020-12-061-15/+0
|
* Update even more snprintfsChristian Göttsche2020-11-281-3/+3
| | | | Use size of actual buffers instead of magic numbers
* Embracing branchesBenny Baumann2020-11-021-2/+7
|
* Spacing around operatorsBenny Baumann2020-11-021-1/+1
|
* Make all required includes explicitBenny Baumann2020-10-181-4/+8
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* Rename StringUtils.[ch] to XUtils.[ch]Benny Baumann2020-10-161-1/+1
|
* Mark Object instances constChristian Göttsche2020-10-071-2/+2
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Clean up some code duplication in the header filesHugo Musso Gualandi2020-09-121-2/+0
| | | | | | | | | | | | | PR htop-dev/htop#70 got rid of the infrastructure for generating header files, but it left behind some code duplication. Some of cases are things that belong in the header file and don't need to be repeated in the C file. Other cases are things that belong in the C file and don't need to be in the header file. In this commit I tried to fix all of these that I could find. When given a choice I preferred keeping things out of the header file, unless they were being used by someone else.
* Consolidate repeated macro definitions into one headerNathan Scott2020-09-091-8/+1
| | | | | | | | The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear throughout the codebase with many re-definitions. Make a single copy of each in a common header file, and use the BSD variants of MINIMUM/MAXIMUM due to conflicts in the system <sys/param.h> headers.
* Axe automated header generation.Zev Weiss2020-09-031-15/+0
| | | | | | | | | | | | | | Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
* Avoid string overflow warningChristian Göttsche2020-08-251-1/+1
| | | | | | | | | | | | Enough memory is allocated. Header.c: In function ‘Header_readMeterName’: Header.c:157:4: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=] 157 | strncpy(name, Meter_name(meter), nameLen); | ^ Header.c:154:18: note: length computed here 154 | int nameLen = strlen(Meter_name(meter)); | ^
* Merge branch 'hishamhm-pull-960'Nathan Scott2020-08-201-5/+5
|\
| * Clean up existing whitespaceDaniel Flanagan2019-10-311-5/+5
| |
* | Restore meter name after used in Header_addMeterByName()wangqr2019-02-121-0/+2
|/ | | | Fix #852
* Security review: check results of snprintf.Hisham Muhammad2017-07-271-3/+3
| | | | | Calls marked with xSnprintf shouldn't fail. Abort program cleanly if any of them does.
* Fix macro Header_forEachColumnExplorer092016-05-071-1/+1
| | | | | | | The (this_) token was not expanded properly, but the bug was not caught because all uses of this macro specifies (this_)=this . Also parenthesize macro tokens to prevent further problems.
* Check for failure in allocations.Hisham2016-02-021-6/+6
|
* fix calloc() callsChristian Hesse2015-09-071-1/+1
| | | | | | | * size_t nmemb (number of elements) first, then size_t size * do not assume char is size 1 but use sizeof() * allocate for char, not pointer to char (found by Michael McConville, fixes #261)
* Rename String to StringUtils.David Hunt2015-08-191-1/+1
| | | | | | | | | Fixes building on case-insensitive filesystems where String.h gets confused with <string.h>. From d734dacea0a10d0465dad4e95b3421511e7da112 Mon Sep 17 00:00:00 2001 From: David Hunt <dhunt@iolanthe.attlocal.net> Date: Sat, 11 Jul 2015 20:56:31 -0500 Subject: [PATCH 1/8] Rename String to StringUtils
* write header length (number of columns) back to configurationChristian Hesse2015-06-121-0/+1
|
* Fix saving of header states, motion in Setup screen.Hisham Muhammad2015-03-161-1/+30
|
* Another mega-patch for the refactoring process.Hisham Muhammad2015-01-231-7/+20
| | | | | Kinda runs, but functionality from the original main loop is still missing. Patience.
* Sorry about the mega-patch.Hisham Muhammad2015-01-211-71/+64
| | | | | This is a work-in-progress, code is currently broken. (Some actions, and notably, the header, are missing.)
* Move UptimeMeter into platform-dependent area.Hisham Muhammad2014-11-271-1/+2
| | | | Set up environment to move other meters.
* Decouple Header from Meter classes.Hisham Muhammad2014-11-271-26/+0
| | | | (Yes, that's dynamic typing!)
* Restrict size of read.Hisham Muhammad2014-04-211-1/+1
|
* alignment improvementsHisham Muhammad2014-02-271-1/+1
|
* Fix order of calloc arguments.Hisham Muhammad2014-01-161-1/+1
| | | | (Patch by Dawid Gajownik)
* Changes in object model: separate class objects to store vtable. Also, nicer ↵Hisham Muhammad2012-12-051-21/+20
| | | | UTF-8 display of big numbers.
* Remove old memory debugging routines. We have Valgrind nowadays.Hisham Muhammad2011-12-261-1/+0
|
* major header cleanupHisham Muhammad2011-12-261-1/+16
|
* Mega-commit with features and tweaks for 1.0:Hisham Muhammad2011-11-181-2/+10
| | | | | | | | | | | * Performance improvements * Support for splitting CPU meters into two or four columns (thanks to Wim Heirman) * Switch from PLPA, which is now deprecated, to HWLOC. * Bring back support for native Linux sched_setaffinity, so we don't have to use HWLOC where we don't need to. * Support for typing in user names and column fields in selection panels.

© 2014-2024 Faster IT GmbH | imprint | privacy policy