summaryrefslogtreecommitdiffstats
path: root/Meter.h
Commit message (Collapse)AuthorAgeFilesLines
* LoadMeter: dynamically adjust color and total of barChristian Göttsche2020-12-261-0/+1
| | | | | | | | | | Change the color and total based on the actual 1min load value: < 1 : green and total of 1.0 < cpu-count : yellow and total of cpu-count else : red and total of 2*cpu-count Closes: #32
* Introduce METER_BUFFER_CHECK and METER_BUFFER_APPEND_CHR to cleanup writing ↵Christian Göttsche2020-12-061-0/+23
| | | | | | to bar buffers Closes: #294
* Use size_t as len type for Meter_UpdateValuesChristian Göttsche2020-12-061-2/+2
| | | | Most of the time the parameter is passed to snprintf type functions
* Meter: document MeterClass string fieldsChristian Göttsche2020-12-021-4/+4
|
* IWYU update (Linux)Christian Göttsche2020-11-191-0/+1
|
* Use integer type for item count instead of charChristian Göttsche2020-10-311-2/+2
|
* Hold only a const version of the ProcessList in MetersChristian Göttsche2020-10-261-2/+2
|
* XUtils string related updatesChristian Göttsche2020-10-191-0/+2
| | | | | | | | | | - allow count out-parameter of String_split() to be NULL - introduce xStrndup() - do not allow NULL pointers passed to String_eq() it is not used in any code - implement String_startsWith(), String_contains_i() and String_eq() as inline header functions - adjust several conversion issues
* Make all required includes explicitBenny Baumann2020-10-181-2/+7
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* CPUMeter: avoid crashes and leaks in case the CPU count changesChristian Göttsche2020-10-121-0/+1
| | | | | | | E.g. if the HT/SMT mode changes Use separate data for sub-meters Do not reuse drawData for maintainability
* Meter: use explicit type for drawDataChristian Göttsche2020-10-121-6/+6
|
* Mark Object instances constChristian Göttsche2020-10-071-3/+3
|
* Mark Object classes and Object class fields constChristian Göttsche2020-10-071-11/+9
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Sort headers/includesBenny Baumann2020-09-291-1/+2
|
* Covert Meter attributes to file-local constant arraysChristian Göttsche2020-09-291-2/+0
|
* Clean up some code duplication in the header filesHugo Musso Gualandi2020-09-121-23/+2
| | | | | | | | | | | | | 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-10/+0
| | | | | | | | 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.
* Further, minor cleanups to headers post-MakeHeadersNathan Scott2020-09-081-6/+0
| | | | | Remove leftover empty ifdef/endif pairs, whitespace. The generated htop.h file was also unused - removed.
* Remove superfluous 'extern's from function declarations.Zev Weiss2020-09-031-6/+6
| | | | | | | | Applied via: $ find * -name '*.h' -exec sed -i -r 's/^extern (.+\()/\1/;' {} + Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com>
* Axe automated header generation.Zev Weiss2020-09-031-2/+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.
* Merge branch 'hishamhm-pull-960'Nathan Scott2020-08-201-1/+1
|\
| * Clean up existing whitespaceDaniel Flanagan2019-10-311-1/+1
| |
* | Re-generate all headers with latest scripts/MakeHeader.pyNathan Scott2020-08-181-6/+6
|/ | | | Sync-up missing extern declarations for many functions.
* Rename Meter.setValues() functions to updateValues()Explorer092016-05-041-3/+4
| | | | | | | | | | | | Rationale (copied from htop issue #471): The function name "setValues" is misleading. For most OOP (object- oriented programming) contexts, setXXX functions mean they will change some member variables of an object into something specified in function arguments. But in the *Meter_setValues() case, the new values are not from the arguments, but from a hard-coded source. The caller is not supposed to change the values[] to anything it likes, but rather to "update" the values from the source. Hence, updateValues is a better name for this family of functions.
* New macro GRAPH_HEIGHT for Graph Meter heightExplorer092016-01-211-0/+2
| | | | | | | | (Cherry-picked from e93028d7fa0c5f00b5dc3336fd28abaf905cd572, the experimental graph coloring branch) Currently GRAPH_HEIGHT=4 . This prevents hard-coding the height of the graph meters, and allows user to change it at compile-time.
* Introduce CLAMP macro. Unify all MIN(MAX(a,b),c) uses.Explorer092016-01-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | With the CLAMP macro replacing the combination of MIN and MAX, we will have at least two advantages: 1. It's more obvious semantically. 2. There are no more mixes of confusing uses like MIN(MAX(a,b),c) and MAX(MIN(a,b),c) and MIN(a,MAX(b,c)) appearing everywhere. We unify the 'clamping' with a single macro. Note that the behavior of this CLAMP macro is different from the combination `MAX(low,MIN(x,high))`. * This CLAMP macro expands to two comparisons instead of three from MAX and MIN combination. In theory, this makes the code slightly smaller, in case that (low) or (high) or both are computed at runtime, so that compilers cannot optimize them. (The third comparison will matter if (low)>(high); see below.) * CLAMP has a side effect, that if (low)>(high) it will produce weird results. Unlike MIN & MAX which will force either (low) or (high) to win. No assertion of ((low)<=(high)) is done in this macro, for now. This CLAMP macro is implemented like described in glib <http://developer.gnome.org/glib/stable/glib-Standard-Macros.html> and does not handle weird uses like CLAMP(a++, low++, high--) .
* make units more dynamicChristian Hesse2015-08-271-0/+2
| | | | Signed-off-by: Christian Hesse <mail@eworm.de>
* remove UTF-8 code when compiling with --disable-unicodeChristian Hesse2015-08-191-0/+8
|
* make arrays one dimensionalChristian Hesse2015-08-191-0/+3
| | | | | | With more dimensional arrays we have to define the array size. Use one dimensional arrays to be more flexible. Additionally this allows to shrink array size for ASCII.
* Fix saving of header states, motion in Setup screen.Hisham Muhammad2015-03-161-1/+1
|
* Add longer descriptions to available meters.Hisham Muhammad2015-02-031-0/+1
|
* Another mega-patch for the refactoring process.Hisham Muhammad2015-01-231-0/+2
| | | | | Kinda runs, but functionality from the original main loop is still missing. Patience.
* Sorry about the mega-patch.Hisham Muhammad2015-01-211-6/+5
| | | | | 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-2/+0
| | | | Set up environment to move other meters.
* alignment improvementsHisham Muhammad2014-02-271-0/+6
|
* BUGFIX: Fix crash when adding meters and toggling detailed CPU time.Hisham Muhammad2014-01-161-3/+4
| | | | | See https://bugzilla.redhat.com/show_bug.cgi?id=987805 for details. (thanks to Dawid Gajownik for the detailed analysis!)
* Changes in object model: separate class objects to store vtable. Also, nicer ↵Hisham Muhammad2012-12-051-51/+45
| | | | UTF-8 display of big numbers.
* major header cleanupHisham Muhammad2011-12-261-27/+2
|
* Convert affinity control from the deprecated PLPA to HWLOCHisham Muhammad2011-09-241-1/+0
|
* Tempus fugit.Hisham Muhammad2011-05-261-1/+1
|
* * Option for counting CPUs from zeroHisham Muhammad2011-03-221-1/+9
| | | | | | (thanks to Sean Noonan) * Meters update in every screen (no longer halting while on Setup, etc.)
* Tempus fugit.Hisham Muhammad2010-02-251-1/+1
|
* warning fixesHisham Muhammad2010-02-251-5/+5
|
* changes for htop 0.8.2Hisham Muhammad2009-06-021-7/+6
|
* Option to display hostname in the meters areaHisham Muhammad2009-02-171-0/+1
|
* ACPI Battery meterHisham Muhammad2008-09-231-0/+2
| | | | | contributed by Ian Hands
* Clean up headers by using 'static' whenever possible.Hisham Muhammad2008-03-091-13/+5
| | | | | Reduces resulting code size.
* Add Unicode support, enabled with the --enable-unicodeHisham Muhammad2008-03-091-0/+1
| | | | | | flag, which requires libncursesw. Thanks to Sergej Pupykin!
* Performance improvement hackathon: improve process comparison routines,Hisham Muhammad2006-07-111-0/+5
| | | | | | | | | | disable useless code in release builds such as runtime type-checking on dynamic data structures and process fields that are not being computed, faster(?) method for verifying the process owner (still need to ensure correctness), don't destroy and create process objects for hidden kernel threads over and over. Phew. I shouldn't be doing all this today, but I could not resist.

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